Crate sec1

Source
Expand description

§RustCrypto: SEC1 Elliptic Curve Cryptography Formats

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Documentation

§About

Pure Rust implementation of SEC1: Elliptic Curve Cryptography encoding formats including ASN.1 DER-serialized private keys (also described in RFC5915) as well as the Elliptic-Curve-Point-to-Octet-String and Octet-String-to-Elliptic-Curve-Point encoding algorithms.

§Minimum Supported Rust Version

This crate requires Rust 1.65 at a minimum.

We may change the MSRV in the future, but it will be accompanied by a minor version bump.

§License

Licensed under either of:

at your option.

§Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

§serde support

When the serde feature of this crate is enabled, the EncodedPoint type receives impls of serde::Serialize and serde::Deserialize.

Additionally, when both the alloc and serde features are enabled, the serializers/deserializers will autodetect if a “human friendly” textual encoding is being used, and if so encode the points as hexadecimal.

Re-exports§

pub use crate::point::EncodedPoint;point
pub use der;der
pub use der::pem;pem
pub use pkcs8;pkcs8

Modules§

constspoint
Type aliases for many constants.
pointpoint
Support for the SEC1 Elliptic-Curve-Point-to-Octet-String and Octet-String-to-Elliptic-Curve-Point encoding algorithms.

Structs§

EcPrivateKeyder
SEC1 elliptic curve private key.

Enums§

EcParametersder
Elliptic curve parameters as described in RFC5480 Section 2.1.1:
Error
Error type
LineEndingpem
Line endings: variants of newline characters that can be used with Base64.

Constants§

ALGORITHM_OIDpkcs8
Algorithm ObjectIdentifier for elliptic curve public key cryptography (id-ecPublicKey).

Traits§

DecodeEcPrivateKeyder
Parse an EcPrivateKey from a SEC1-encoded document.
EncodeEcPrivateKeyalloc and der
Serialize a EcPrivateKey to a SEC1 encoded document.

Type Aliases§

Result
Result type with sec1 crate’s Error type.