corda / net.corda.core.crypto /

Extensions for


Checks whether any of the given keys matches a leaf on the CompositeKey tree or a single PublicKey.

fun PublicKey.containsAny(otherKeys: Iterable<PublicKey>): Boolean


Return true if otherKey fulfils the requirements of this PublicKey.

fun PublicKey.isFulfilledBy(otherKey: PublicKey): Boolean

Return true if otherKeys fulfil the requirements of this PublicKey.

fun PublicKey.isFulfilledBy(otherKeys: Iterable<PublicKey>): Boolean


Utility to simplify the act of verifying a signature. In comparison to verify if the key and signature do not match it returns false rather than throwing an exception. Normally you should use the function which throws, as it avoids the risk of failing to test the result, but this is for uses such as implementations.

fun PublicKey.isValid(content: ByteArray, signature: DigitalSignature): Boolean


Return a Set of the contained leaf keys if this is a CompositeKey. Otherwise, return a Set with a single element (this PublicKey). Note that leaf keys cannot be of type CompositeKey.

val PublicKey.keys: Set<PublicKey>


Render a public key to its hash (in Base58) of its serialised form using the DL prefix.

fun PublicKey.toStringShort(): String


Utility to simplify the act of verifying a signature.

fun PublicKey.verify(content: ByteArray, signature: DigitalSignature): Boolean

Helper function to verify a signature.

fun PublicKey.verify(signatureData: ByteArray, clearData: ByteArray): Boolean