Krikri::PluginHelpers::Pkey
The operations openssl_privatekey (and any future key-material plugin) needs, expressed against EVP_PKEY handles:
generate - EVP_PKEY keygen for RSA/DSA/ECC/Ed25519/Ed448/
X25519/X448 (DSA gets its parameters generated
in the same keygen pass, as openssl genpkey
does)
serialize_pem - PEM output: PKCS#8, traditional PKCS#1
(RSA/DSA/EC), or PKCS#8 for the Edwards types
that have no traditional encoding; optionally
encrypted with AES-256-CBC (the "auto" cipher,
which is the only cipher the Ansible module's
cryptography backend accepts)
pkcs8_der - unencrypted DER PrivateKeyInfo (the source of
format: raw's bare key bytes)
load - parse PEM/DER key material back into a handle,
with the given passphrase (nil on any failure -
wrong passphrase, not a key at all, ...)
info - key type NID, size in bits and (for EC keys) the
curve's OpenSSL short name
public_der - SubjectPublicKeyInfo DER, the fingerprint input
Constants
Instance methods
EVP_PKEY* the caller owns (free_pkey) or nil on any failure.
Parses PEM key material back into an EVP_PKEY handle the caller owns, decrypting with passphrase when the key is encrypted. nil on any failure (wrong passphrase, not key material, truncated PEM).
cryptography-semantics private-key load: on failure the returned LoadFailure.message is byte-for-byte what the Ansible module puts in fail_json (verified against community.crypto 3.1.1 + the libcrypto the target ships). On success the caller owns the returned EVP_PKEY (free_pkey).
Parses PEM public key material (SubjectPublicKeyInfo) back into an EVP_PKEY handle the caller owns; nil on any failure.
Unencrypted DER PrivateKeyInfo - format: raw slices the bare key
bytes off its tail (the Edwards/montgomery key is the last field).
SubjectPublicKeyInfo DER - the input the Ansible module hashes for
its fingerprint result.
SubjectPublicKeyInfo PEM of pkey's public half - the bytes the
Ansible module writes for format: PEM.