Skip to main content

Module ecdsa

Module ecdsa 

Source
Expand description

DER encoding and decoding of ECDSA signatures.

TLS and X.509 carry ECDSA signatures as the ASN.1 ECDSA-Sig-Value structure:

ECDSA-Sig-Value ::= SEQUENCE {
    r  INTEGER,
    s  INTEGER
}

The curve implementations in this crate operate on the fixed-width r || s form instead ([u8; 64] for P-256, [u8; 96] for P-384). These helpers convert between the two.

Enums§

EcdsaError
Errors returned while converting ECDSA signatures to or from DER.

Functions§

decode_p256_signature_der
Decodes an ECDSA-Sig-Value DER structure into a fixed-width P-256 r || s signature.
decode_p384_signature_der
Decodes an ECDSA-Sig-Value DER structure into a fixed-width P-384 r || s signature.
decode_signature_der
Decodes an ECDSA-Sig-Value DER structure into raw_out.
encode_signature_der
Encodes the ECDSA values r and s (each big-endian, optionally with leading zero bytes) as an ECDSA-Sig-Value DER structure.