pkcs1DigestInfoPrefix

fnubyte[] pkcs1DigestInfoPrefix(Hash hash)

Returns the DER DigestInfo prefix for a PKCS#1 v1.5 signature.

The prefix encodes the hash algorithm OID (RFC 8017, section 9.2, note 1), so it is keyed on the exact hash implementation: two 32-byte digests from different algorithms (e.g. SHA-256 and SHA3-256) carry different prefixes, and algorithms without a registered DigestInfo (SHA-3, BLAKE2, MD5, ...) are rejected.

Parameters

hashThe hash implementation that produced the digest.

Returns

The DER-encoded DigestInfo header for hash, or null when the

algorithm has no PKCS#1 v1.5 DigestInfo definition.