Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: third_party/google-endpoints/pyasn1_modules/rfc5208.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #
2 # PKCS#8 syntax
3 #
4 # ASN.1 source from:
5 # http://tools.ietf.org/html/rfc5208
6 #
7 # Sample captures could be obtained with "openssl pkcs8 -topk8" command
8 #
9 from pyasn1.type import tag, namedtype, namedval, univ, constraint
10 from pyasn1_modules.rfc2459 import *
11 from pyasn1_modules import rfc2251
12
13 class KeyEncryptionAlgorithms(AlgorithmIdentifier): pass
14
15 class PrivateKeyAlgorithms(AlgorithmIdentifier): pass
16
17 class EncryptedData(univ.OctetString): pass
18
19 class EncryptedPrivateKeyInfo(univ.Sequence):
20 componentType = namedtype.NamedTypes(
21 namedtype.NamedType('encryptionAlgorithm', AlgorithmIdentifier()),
22 namedtype.NamedType('encryptedData', EncryptedData())
23 )
24
25 class PrivateKey(univ.OctetString): pass
26
27 class Attributes(univ.SetOf):
28 componentType = rfc2251.Attribute()
29
30 class Version(univ.Integer):
31 namedValues = namedval.NamedValues(('v1', 0), ('v2', 1))
32
33 class PrivateKeyInfo(univ.Sequence):
34 componentType = namedtype.NamedTypes(
35 namedtype.NamedType('version', Version()),
36 namedtype.NamedType('privateKeyAlgorithm', AlgorithmIdentifier()),
37 namedtype.NamedType('privateKey', PrivateKey()),
38 namedtype.OptionalNamedType('attributes', Attributes().subtype(implicitT ag=tag.Tag(tag.tagClassContext, tag.tagFormatConstructed, 0)))
39 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698