final class DnssecPrivateKeyConverter (View source)

Turns a DNSSEC private key into the ISC (BIND "Private-key-format") text the PowerDNS API takes. The API reads no PEM; only pdnsutil import-zone-key-pem does.

Constants

MAX_INPUT_BYTES

Far above an RSA-4096 key; refused before any parsing

private EDDSA_OIDS

RFC 8410 algorithm OIDs (DER content bytes) and their seed lengths

private ECDSA_CURVES

private RSA_ALGORITHMS

Methods

static string|DnssecKeyOutcome
toIsc(string $privateKey, string $algorithmName)

Returns the key as ISC text for the given algorithm (a DnssecAlgorithmName value), or why it cannot be used. Accepts ISC text or an unencrypted RSA, ECDSA, Ed25519 or Ed448 PEM key; nothing derived from the key is returned on refusal.

Details

static string|DnssecKeyOutcome toIsc(string $privateKey, string $algorithmName)

Returns the key as ISC text for the given algorithm (a DnssecAlgorithmName value), or why it cannot be used. Accepts ISC text or an unencrypted RSA, ECDSA, Ed25519 or Ed448 PEM key; nothing derived from the key is returned on refusal.

Parameters

string $privateKey
string $algorithmName

Return Value

string|DnssecKeyOutcome