corda / net.corda.core.crypto / Crypto / findSignatureScheme

findSignatureScheme

@JvmStatic fun findSignatureScheme(algorithm: AlgorithmIdentifier): SignatureScheme @JvmStatic fun findSignatureScheme(schemeNumberID: Int): SignatureScheme

Find SignatureScheme by platform specific schemeNumberID.

@JvmStatic fun findSignatureScheme(schemeCodeName: String): SignatureScheme

Factory pattern to retrieve the corresponding SignatureScheme based on SignatureScheme.schemeCodeName. This function is usually called by key generators and verify signature functions. In case the input is not a key in the supportedSignatureSchemes map, null will be returned.

Parameters

schemeCodeName - a String that should match a supported signature scheme code name (e.g. ECDSA_SECP256K1_SHA256), see Crypto.

Exceptions

IllegalArgumentException - if the requested signature scheme is not supported.

Return
a currently supported SignatureScheme.

@JvmStatic fun findSignatureScheme(key: PublicKey): SignatureScheme
@JvmStatic fun findSignatureScheme(key: PrivateKey): SignatureScheme

Retrieve the corresponding SignatureScheme based on the type of the input Key. This function is usually called when requiring to verify signatures and the signing schemes must be defined. For the supported signature schemes see Crypto.

Parameters

key - either private or public.

Exceptions

IllegalArgumentException - if the requested key type is not supported.

Return
a currently supported SignatureScheme.