X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=pygost%2Fasn1schemas%2Fx509.py;h=f434fbb84d61e4f77b513119ed10f095c13a43f2;hb=0a222bc1e121d463351d0c259a403c3e8d331e60;hp=29a0a601eb285cc25a07dd6f0c1b171d202e372e;hpb=5008cf14ea046aa2e20dde93b9843fcf8f3e2e3e;p=pygost.git diff --git a/pygost/asn1schemas/x509.py b/pygost/asn1schemas/x509.py index 29a0a60..f434fbb 100644 --- a/pygost/asn1schemas/x509.py +++ b/pygost/asn1schemas/x509.py @@ -215,23 +215,48 @@ class CertificateList(Sequence): class GeneralName(Choice): schema = ( - # ('otherName', AnotherName(impl=tag_ctxc(0))), - # ('rfc822Name', IA5String(impl=tag_ctxp(1))), - ('dNSName', IA5String(impl=tag_ctxp(2))), - # ('x400Address', ORAddress(impl=tag_ctxp(3))), - # ('x400Address', OctetString(impl=tag_ctxp(3))), - # ('directoryName', Name(expl=tag_ctxc(4))), - # ('ediPartyName', EDIPartyName(impl=tag_ctxc(5))), - # ('uniformResourceIdentifier', IA5String(impl=tag_ctxp(6))), - # ('iPAddress', OctetString(impl=tag_ctxp(7))), - # ('registeredID', ObjectIdentifier(impl=tag_ctxp(8))), + # ("otherName", AnotherName(impl=tag_ctxc(0))), + # ("rfc822Name", IA5String(impl=tag_ctxp(1))), + ("dNSName", IA5String(impl=tag_ctxp(2))), + # ("x400Address", ORAddress(impl=tag_ctxp(3))), + # ("x400Address", OctetString(impl=tag_ctxp(3))), + # ("directoryName", Name(expl=tag_ctxc(4))), + # ("ediPartyName", EDIPartyName(impl=tag_ctxc(5))), + # ("uniformResourceIdentifier", IA5String(impl=tag_ctxp(6))), + # ("iPAddress", OctetString(impl=tag_ctxp(7))), + # ("registeredID", ObjectIdentifier(impl=tag_ctxp(8))), ) class GeneralNames(SequenceOf): schema = GeneralName() - bounds = (1, float('+inf')) + bounds = (1, float("+inf")) class SubjectAltName(GeneralNames): pass + + +class AuthorityKeyIdentifier(Sequence): + schema = ( + ("keyIdentifier", KeyIdentifier(impl=tag_ctxp(0), optional=True)), + # ("authorityCertIssuer", GeneralNames(impl=tag_ctxc(1), optional=True)), + # ( + # "authorityCertSerialNumber", + # CertificateSerialNumber(impl=tag_ctxp(2), optional=True), + # ), + ) + + +class KeyUsage(BitString): + schema = ( + ("digitalSignature", 0), + ("nonRepudiation", 1), + ("keyEncipherment", 2), + ("dataEncipherment", 3), + ("keyAgreement", 4), + ("keyCertSign", 5), + ("cRLSign", 6), + ("encipherOnly", 7), + ("decipherOnly", 8), + )