corda / net.corda.core.crypto / Crypto / publicKeyOnCurve

publicKeyOnCurve

@JvmStatic fun publicKeyOnCurve(signatureScheme: SignatureScheme, publicKey: PublicKey): Boolean

Check if a point's coordinates are on the expected curve to avoid certain types of ECC attacks. Point-at-infinity is not permitted as well.

Parameters

publicKey - a PublicKey, usually used to validate a signer's public key in on the Curve.

signatureScheme - a SignatureScheme object, retrieved from supported signature schemes, see Crypto.

Exceptions

IllegalArgumentException - if the requested signature scheme or the key type is not supported.

Return
true if the point lies on the curve or false if it doesn't.