Russ Housley | 61b5149 | 2019-05-31 01:23:02 -0400 | [diff] [blame] | 1 | # This file is being contributed to pyasn1-modules software. |
| 2 | # |
| 3 | # Created by Russ Housley with assistance from asn1ate v.0.6.0. |
| 4 | # |
| 5 | # Copyright (c) 2019, Vigil Security, LLC |
| 6 | # License: http://snmplabs.com/pyasn1/license.html |
| 7 | # |
| 8 | # Elliptic Curve Private Key |
| 9 | # |
| 10 | # ASN.1 source from: |
| 11 | # https://www.rfc-editor.org/rfc/rfc5915.txt |
| 12 | |
| 13 | from pyasn1.type import namedtype |
| 14 | from pyasn1.type import namedval |
| 15 | from pyasn1.type import tag |
| 16 | from pyasn1.type import univ |
| 17 | |
| 18 | from pyasn1_modules import rfc5480 |
| 19 | |
| 20 | |
| 21 | class ECPrivateKey(univ.Sequence): |
| 22 | pass |
| 23 | |
| 24 | ECPrivateKey.componentType = namedtype.NamedTypes( |
| 25 | namedtype.NamedType('version', univ.Integer( |
| 26 | namedValues=namedval.NamedValues(('ecPrivkeyVer1', 1)))), |
| 27 | namedtype.NamedType('privateKey', univ.OctetString()), |
| 28 | namedtype.OptionalNamedType('parameters', rfc5480.ECParameters().subtype( |
| 29 | explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 0))), |
| 30 | namedtype.OptionalNamedType('publicKey', univ.BitString().subtype( |
| 31 | explicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))) |
| 32 | ) |