dhIntegerTlv

private fnubyte[] dhIntegerTlv(BigInt value)

Wraps a non-negative DH parameter in a complete DER INTEGER TLV.

DH key structures embed INTEGERs inside carrier types: the SPKI subjectPublicKey BIT STRING wraps DHPublicKey ::= INTEGER and the PKCS#8 privateKey OCTET STRING wraps DHPrivateKey ::= INTEGER (PKCS#3, RFC 3279 section 2.3.3). Those payloads must carry the full tag-and-length TLV, not bare content bytes.

Parameters

valueThe value to encode (must be non-negative).

Returns

The DER INTEGER TLV bytes.