pub fn decode(input: &[u8]) -> Option<EcPrivateKey>Expand description
Decode a DER ECPrivateKey blob.
Validates:
- outer SEQUENCE with no trailing bytes;
version == 1;privateKeyis a 32-byte OCTET STRING (SM2’s curve has 256-bit scalars; oversize/undersize is malformed);- if present,
[0] parametersisnamedCurve = sm2p256v1only; - if present,
[1] publicKeyis a 65-byte uncompressed point that decodes successfully (on-curve, not identity).
Returns None for any malformed input.