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
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)),
)