aboutsummaryrefslogtreecommitdiff
path: root/pyasn1_modules/rfc5208.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyasn1_modules/rfc5208.py')
-rw-r--r--pyasn1_modules/rfc5208.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/pyasn1_modules/rfc5208.py b/pyasn1_modules/rfc5208.py
index 3484150..6b7c3ba 100644
--- a/pyasn1_modules/rfc5208.py
+++ b/pyasn1_modules/rfc5208.py
@@ -11,15 +11,21 @@
#
# Sample captures could be obtained with "openssl pkcs8 -topk8" command
#
-from pyasn1.type import tag, namedtype, namedval, univ, constraint
from pyasn1_modules.rfc2459 import *
from pyasn1_modules import rfc2251
-class KeyEncryptionAlgorithms(AlgorithmIdentifier): pass
-class PrivateKeyAlgorithms(AlgorithmIdentifier): pass
+class KeyEncryptionAlgorithms(AlgorithmIdentifier):
+ pass
+
+
+class PrivateKeyAlgorithms(AlgorithmIdentifier):
+ pass
+
+
+class EncryptedData(univ.OctetString):
+ pass
-class EncryptedData(univ.OctetString): pass
class EncryptedPrivateKeyInfo(univ.Sequence):
componentType = namedtype.NamedTypes(
@@ -27,18 +33,24 @@ class EncryptedPrivateKeyInfo(univ.Sequence):
namedtype.NamedType('encryptedData', EncryptedData())
)
-class PrivateKey(univ.OctetString): pass
+
+class PrivateKey(univ.OctetString):
+ pass
+
class Attributes(univ.SetOf):
componentType = rfc2251.Attribute()
+
class Version(univ.Integer):
- namedValues = namedval.NamedValues(('v1', 0), ('v2', 1))
+ namedValues = namedval.NamedValues(('v1', 0), ('v2', 1))
+
class PrivateKeyInfo(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('version', Version()),
namedtype.NamedType('privateKeyAlgorithm', AlgorithmIdentifier()),
namedtype.NamedType('privateKey', PrivateKey()),
- namedtype.OptionalNamedType('attributes', Attributes().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
+ namedtype.OptionalNamedType('attributes', Attributes().subtype(
+ implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
)