def __init__(self): self.version = base.Integer(1, name='version', check=True) self.digestAlgorithms = DigestAlgorithms() self.contentInfo = ContentInfo() self.certificates = base.Optional(x509.Certificate, [x509.Certificate()], name='certificates') self.signerInfos = base.Set([SignerInfo()], name="signerInfos") base.Sequence.__init__(self, [self.version, self.digestAlgorithms, self.contentInfo, self.certificates, self.signerInfos])
class AttKeyPref(Attribute): value = [base.ObjectId('id-aa-encrypKeyPref'), base.Set([IssuerAndSerial(tag=0xA0)])] def setup(self, value): self.value[1].value[0].setup(value.value)
class AttSMIMECaps(Attribute): value = [base.ObjectId('smimeCapabilities'), base.Set([SMIMECaps()])]
class AttMSEncryptionCert(Attribute): value = [base.ObjectId('Microsoft_Encryption_Cert'), base.Set([IssuerAndSerial()])] def setup(self, value): self.value[1].value[0].setup(value.value)
class AttMessageDigest(Attribute): value = [base.ObjectId('messageDigest'), base.Set([base.OctetString()])]
class AttSigningTime(Attribute): value = [base.ObjectId('signing-time'), base.Set([base.UTCTime()])]
class AttContentType(Attribute): value = [base.ObjectId('contentType'), base.Set([base.ObjectId('data')])]
class Attribute(base.Sequence): value = [base.ObjectId(), base.Set()] def setup(self, value): self.value[1].value[0].setup(value)