An open API service indexing awesome lists of open source software.

https://github.com/andyblarblar/sec1_decode

Crate for parsing EcPrivateKey structures as defined in SEC1 section C4.
https://github.com/andyblarblar/sec1_decode

crypto der ecc pem rust sec1

Last synced: 3 months ago
JSON representation

Crate for parsing EcPrivateKey structures as defined in SEC1 section C4.

Awesome Lists containing this project

README

        

![badge](https://github.com/andyblarblar/sec1_decode/actions/workflows/rust.yml/badge.svg)

Crate for parsing EcPrivateKey structures as defined in [SEC1 section C4](https://www.secg.org/sec1-v2.pdf).
This is the default format generated by openssl for ec keys.

This crate is capable of decoding both PEM and DER encoded keys.

```rust
use sec1_decode::parse_pem;
const PEM:&str = "-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIASgox4rXoGc6ajVAjBCsjVIjbfHd8OK3m5v34ZWVBmmoAoGCCqGSM49
AwEHoUQDQgAEUfXAsSR5LH4rVdHbcK1vnYcN9I/6T7u1bl1RprSZFf89aZXL+CeG
G21XVW8IDhjU7HAXgrO1Sqj00zQtluVBTg==
-----END EC PRIVATE KEY-----";

let parsed = parse_pem(PEM.as_bytes()).unwrap();
```