X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Fasn1schemas%2Fprvkey.py;h=6b9c493418eb27d2426192b83cdf0ccaaebb3bfd;hp=60da749ab064ef5470334f217d4eba7d238b8fca;hb=69854a17b5ed9e7970acf34af1f478d8b27ef21e;hpb=8b136ad8da7da37736cf838e80024eeffe43722a diff --git a/pygost/asn1schemas/prvkey.py b/pygost/asn1schemas/prvkey.py index 60da749..6b9c493 100644 --- a/pygost/asn1schemas/prvkey.py +++ b/pygost/asn1schemas/prvkey.py @@ -23,6 +23,8 @@ from pyderasn import ObjectIdentifier from pyderasn import OctetString from pyderasn import Sequence from pyderasn import tag_ctxc +from pyderasn import tag_ctxp +from pyderasn import SetOf from pygost.asn1schemas.oids import id_tc26_gost3410_2012_256 from pygost.asn1schemas.oids import id_tc26_gost3410_2012_512 @@ -65,9 +67,34 @@ class PrivateKey(OctetString): pass +class AttributeValue(Any): + pass + + +class AttributeValues(SetOf): + schema = AttributeValue() + + +class Attribute(Sequence): + schema = ( + ("attrType", ObjectIdentifier()), + ("attrValues", AttributeValues()), + ) + + +class Attributes(SetOf): + schema = Attribute() + + +class PublicKey(BitString): + pass + + class PrivateKeyInfo(Sequence): schema = ( ("version", Integer(0)), ("privateKeyAlgorithm", PrivateKeyAlgorithmIdentifier()), ("privateKey", PrivateKey()), + ("attributes", Attributes(impl=tag_ctxc(0), optional=True)), + ("publicKey", PublicKey(impl=tag_ctxp(1), optional=True)), )