fun decodePrivateKey(encodedKey: ByteArray): PrivateKey
Decode a PKCS8 encoded key to its PrivateKey object.
encodedKey
- a PKCS8 encoded private key.
IllegalArgumentException
- on not supported scheme or if the given key specification
is inappropriate for this key factory to produce a private key.
fun decodePrivateKey(encodedKey: ByteArray, schemeCodeName: String): PrivateKey
Decode a PKCS8 encoded key to its PrivateKey object based on the input scheme code name. This will be used by Kryo deserialisation.
encodedKey
- a PKCS8 encoded private key.
schemeCodeName
- a String that should match a key in supportedSignatureSchemes map (e.g. ECDSA_SECP256K1_SHA256).
IllegalArgumentException
- on not supported scheme or if the given key specification
is inappropriate for this key factory to produce a private key.