ElipticCurvePemPublicKeyReader 1.0.1

Parses PEM format Eliptic Curver Public keys

There is a newer version of this package available.
See the version list below for details.
Install-Package ElipticCurvePemPublicKeyReader -Version 1.0.1
dotnet add package ElipticCurvePemPublicKeyReader --version 1.0.1
<PackageReference Include="ElipticCurvePemPublicKeyReader" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ElipticCurvePemPublicKeyReader --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Eliptic Curve PEM Reader

Parses PEM format Eliptic Curver Public keys

Tonelli-Shanks algorithm code from
https://rosettacode.org/wiki/Tonelli-Shanks_algorithm#C.23

https://tools.ietf.org/html/rfc548
<pre><code>
PublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
PublicKey BIT STRING
}

AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
</code></pre>

secp256r1 example

<pre><code>
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvV35p9glAuGf0
Z5k+OxTXgFNU4II+2yOw43dFf8AkEgMcfGt+FRlSmGYW1Zkwi
o2jDXqmB5WbGw0JB+4QRMkyg==
-----END PUBLIC KEY-----

30 (SubjectPublicKeyInfo ASN-1 SEQUENCE)
59 (payload length 0x59 89)
30(ASN-1 SEQUENCE)
13 (AlgorithmIdentifier payload length 0x13 19)
06 (ASN-1 OCTET STRING)
07 ( Algorithm payload Oid length 0x07 7 always ECC/id-ecPubliKey)
2A 86 48 CE 3D 02 01 (1.2.840.10045.2.1)
06 (ASN-1 OCTET STRING)
08 (EC Curve payload length 0x08 8)
2A 86 48 CE 3D 03 01 07 (secp256r1 1.2.840.10045.3.1.7)
03 (ASN-1 BIT STRING)
42 (EC Public key payload length 0x42 66 (unused(1) + uncompressed(1) + (2 x 32)))
00 (unused BITS)
04 (Uncompressed Key) (02 Compressed Y==odd) (03 Compressed Y==even)
BD 5D F9 A7 D8 25 02 E1
9F D1 9E 64 F8 EC 53 5E
01 4D 53 82 08 FB 6C 8E
C3 8D DD 15 FF 00 90 48 (EcPoint.X 32 bits)
0C 71 F1 AD F8 54 65 4A
61 98 5B 56 64 C2 2A 36
8C 35 EA 98 1E 56 6C 6C
34 24 1F B8 41 13 24 CA (EcPoint.Y 32 bits)
</code></pre>

Eliptic Curve PEM Reader

Parses PEM format Eliptic Curver Public keys

Tonelli-Shanks algorithm code from
https://rosettacode.org/wiki/Tonelli-Shanks_algorithm#C.23

https://tools.ietf.org/html/rfc548
<pre><code>
PublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
PublicKey BIT STRING
}

AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL
}
</code></pre>

secp256r1 example

<pre><code>
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvV35p9glAuGf0
Z5k+OxTXgFNU4II+2yOw43dFf8AkEgMcfGt+FRlSmGYW1Zkwi
o2jDXqmB5WbGw0JB+4QRMkyg==
-----END PUBLIC KEY-----

30 (SubjectPublicKeyInfo ASN-1 SEQUENCE)
59 (payload length 0x59 89)
30(ASN-1 SEQUENCE)
13 (AlgorithmIdentifier payload length 0x13 19)
06 (ASN-1 OCTET STRING)
07 ( Algorithm payload Oid length 0x07 7 always ECC/id-ecPubliKey)
2A 86 48 CE 3D 02 01 (1.2.840.10045.2.1)
06 (ASN-1 OCTET STRING)
08 (EC Curve payload length 0x08 8)
2A 86 48 CE 3D 03 01 07 (secp256r1 1.2.840.10045.3.1.7)
03 (ASN-1 BIT STRING)
42 (EC Public key payload length 0x42 66 (unused(1) + uncompressed(1) + (2 x 32)))
00 (unused BITS)
04 (Uncompressed Key) (02 Compressed Y==odd) (03 Compressed Y==even)
BD 5D F9 A7 D8 25 02 E1
9F D1 9E 64 F8 EC 53 5E
01 4D 53 82 08 FB 6C 8E
C3 8D DD 15 FF 00 90 48 (EcPoint.X 32 bits)
0C 71 F1 AD F8 54 65 4A
61 98 5B 56 64 C2 2A 36
8C 35 EA 98 1E 56 6C 6C
34 24 1F B8 41 13 24 CA (EcPoint.Y 32 bits)
</code></pre>

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.4 102 7/11/2020
1.0.1 142 3/13/2020
1.0.0-beta 108 3/12/2020