[det]load_private_key(+Stream,
+Password, -PrivateKey)Load a private key PrivateKey from the given stream Stream,
using Password to decrypt the key if it is encrypted. Note
that the password is currently only supported for PEM files. DER-encoded
keys which are password protected will not load. The key must be an RSA,
EC, Ed25519 or X25519 key. DH and DSA keys are not supported, and PrivateKey
will be bound to an atom (dh_key or dsa_key) if you try and load such a
key. Otherwise
PrivateKey will be unified with private_key(KeyTerm),
where KeyTerm is one of:
- rsa/8 for RSA keys
- ec/3 for EC keys
- ed25519/1 holding the hexadecimal key pair
in PKCS#8 v2 format, suitable for ed25519_sign/4
- x25519/1 holding the hexadecimal
scalar, suitable for
curve25519_scalar_mult/3
- Extended in 10.1.12 (👉a1da5be) load_private_key/3 and load_public_key/2 support Ed25519 and X25519