]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/asn1schemas/prvkey.py
Draft update PKCS#12 test vectors
[pygost.git] / pygost / asn1schemas / prvkey.py
index 60da749ab064ef5470334f217d4eba7d238b8fca..6b9c493418eb27d2426192b83cdf0ccaaebb3bfd 100644 (file)
@@ -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)),
     )