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