Ejemplo n.º 1
0
    output = []
    for x in tuple(components):
        if isinstance(x, univ.ObjectIdentifier):
            output.extend(list(x))
        else:
            output.append(int(x))

    return univ.ObjectIdentifier(output)


class ChangeSubjectName(univ.Sequence):
    pass


ChangeSubjectName.componentType = namedtype.NamedTypes(
    namedtype.OptionalNamedType('subject', rfc5280.Name()),
    namedtype.OptionalNamedType('subjectAlt', rfc5280.GeneralNames()))


class AttributeValue(univ.Any):
    pass


class CMCStatus(univ.Integer):
    pass


CMCStatus.namedValues = namedval.NamedValues(
    ('success', 0), ('failed', 2), ('pending', 3), ('noSupport', 4),
    ('confirmRequired', 5), ('popRequired', 6), ('partial', 7))
Ejemplo n.º 2
0
CertTemplate.componentType = namedtype.NamedTypes(
    namedtype.OptionalNamedType(
        'version',
        rfc5280.Version().subtype(
            implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))),
    namedtype.OptionalNamedType(
        'serialNumber',
        univ.Integer().subtype(
            implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))),
    namedtype.OptionalNamedType(
        'signingAlg',
        rfc5280.AlgorithmIdentifier().subtype(
            implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))),
    namedtype.OptionalNamedType(
        'issuer',
        rfc5280.Name().subtype(implicitTag=tag.Tag(
            tag.tagClassContext, tag.tagFormatConstructed, 3))),
    namedtype.OptionalNamedType(
        'validity',
        OptionalValidity().subtype(implicitTag=tag.Tag(
            tag.tagClassContext, tag.tagFormatConstructed, 4))),
    namedtype.OptionalNamedType(
        'subject',
        rfc5280.Name().subtype(implicitTag=tag.Tag(
            tag.tagClassContext, tag.tagFormatConstructed, 5))),
    namedtype.OptionalNamedType(
        'publicKey',
        rfc5280.SubjectPublicKeyInfo().subtype(
            implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 6))),
    namedtype.OptionalNamedType(
        'issuerUID',
        rfc5280.UniqueIdentifier().subtype(
Ejemplo n.º 3
0
UnauthAttributes.componentType = Attribute()
UnauthAttributes.subtypeSpec = constraint.ValueSizeConstraint(1, MAX)

id_encryptedData = _buildOid(1, 2, 840, 113549, 1, 7, 6)


class SignatureValue(univ.OctetString):
    pass


class IssuerAndSerialNumber(univ.Sequence):
    pass


IssuerAndSerialNumber.componentType = namedtype.NamedTypes(
    namedtype.NamedType('issuer', rfc5280.Name()),
    namedtype.NamedType('serialNumber', rfc5280.CertificateSerialNumber())
)


class SubjectKeyIdentifier(univ.OctetString):
    pass


class RecipientKeyIdentifier(univ.Sequence):
    pass


RecipientKeyIdentifier.componentType = namedtype.NamedTypes(
    namedtype.NamedType('subjectKeyIdentifier', SubjectKeyIdentifier()),
    namedtype.OptionalNamedType('date', useful.GeneralizedTime()),
Ejemplo n.º 4
0
class IssuerAndSubject(univ.Sequence):
    componentType = namedtype.NamedTypes(
        namedtype.NamedType('issuer', rfc5280.Name()),
        namedtype.NamedType('subject', rfc5280.Name()))