toSupportedPublicKey

fun toSupportedPublicKey(key: <Error class: unknown class>): PublicKey

Convert a public key to a supported implementation.

Return

a supported implementation of the input public key.

Parameters

key

a public key.

Throws

on not supported scheme or if the given key specification is inappropriate for a supported key factory to produce a private key.


Convert a public key to a supported implementation. This can be used to convert a SUN's EC key to an BC key. This method is usually required to retrieve a key (via its corresponding cert) from JKS keystores that by default return SUN implementations.

Return

a supported implementation of the input public key.

Parameters

key

a public key.

Throws

on not supported scheme or if the given key specification is inappropriate for a supported key factory to produce a private key.