Decodes an ECDSA-Sig-Value, returning r/s as fixed 32-byte
unsigned big-endian scalars (any DER sign-byte padding stripped, any
short encoding zero-padded back out) — the shape IECDSASignature
expects.
OPTIONAL, NON-STANDARD: wraps a raw BLS12-381 private key scalar in a
PKCS8-shaped PrivateKeyInfo, reusing the real IC algorithm OID pair
so it at least round-trips against decodeBls12381PrivateKeyPkcs8 and
carries a meaningful algorithm identifier. No implementation of ours
or anyone else's (including DFINITY) produces or expects this for
private keys — use encodeBls12381PrivateKeyRaw unless you
specifically need an ASN.1 container for internal storage/interop.
Not ASN.1 — a validated pass-through for a raw BLS12-381 private key
scalar (32 bytes). This is the format every real BLS12-381 consumer
actually uses; there is no DER/PKCS8 standard to conform to here.
SubjectPublicKeyInfo for a BLS12-381 G2 public key, matching the
exact DER shape DFINITY/Internet Computer uses for root/subnet keys:
SEQUENCE { SEQUENCE { OID id-ic-bls12-381, OID curve }, BIT STRING(point) }.
point is normally the 96-byte compressed G2 point, but any length
is accepted since the wrapper itself doesn't fix one.
PKCS8 PrivateKeyInfo for Ed25519. The "privateKey" OCTET STRING
contains the DER of a further OCTET STRING wrapping the raw 32-byte
seed (RFC 8410's "CurvePrivateKey").
Wraps a secp256k1 private key in a PKCS8 "PrivateKeyInfo".
The curve OID lives in the AlgorithmIdentifier; the nested SEC1
structure omits it (matching common OpenSSL / RFC 5915 output).
Wraps a secp256r1 private key in a PKCS8 "PrivateKeyInfo".
The curve OID lives in the AlgorithmIdentifier; the nested SEC1
structure omits it (matching common OpenSSL / RFC 5915 output).