]> Cypherpunks.ru repositories - pygost.git/blobdiff - pygost/asn1schemas/prvkey.py
Fix small lint errors
[pygost.git] / pygost / asn1schemas / prvkey.py
index 67e6fb1b3852d00a7123617fb3061a87b4593a04..fc9da6d6e6c6890fa8b56da86df561e9cebbfed0 100644 (file)
@@ -1,6 +1,6 @@
 # coding: utf-8
 # PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2020 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2021 Sergey Matveev <stargrave@stargrave.org>
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,9 @@ from pyderasn import Null
 from pyderasn import ObjectIdentifier
 from pyderasn import OctetString
 from pyderasn import Sequence
+from pyderasn import SetOf
 from pyderasn import tag_ctxc
+from pyderasn import tag_ctxp
 
 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)),
     )