corda / net.corda.core.crypto / TransactionSignature

TransactionSignature

class TransactionSignature : DigitalSignature

A wrapper over the signature output accompanied by signer's public key and signature metadata. This is similar to DigitalSignature.WithKey, but targeted to DLT transaction signatures.

Constructors

<init>

TransactionSignature(bytes: ByteArray, by: PublicKey, signatureMetadata: SignatureMetadata)

A wrapper over the signature output accompanied by signer's public key and signature metadata. This is similar to DigitalSignature.WithKey, but targeted to DLT transaction signatures.

Properties

by

val by: PublicKey

signatureMetadata

val signatureMetadata: SignatureMetadata

Functions

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

isValid

fun isValid(txId: SecureHash): Boolean

Utility to simplify the act of verifying a signature. In comparison to verify doesn't throw an exception, making it more suitable where a boolean is required, but normally you should use the function which throws, as it avoids the risk of failing to test the result.

verify

fun verify(txId: SecureHash): Boolean

Function to verify a SignableData object's signature. Note that SignableData contains the id of the transaction and extra metadata, such as DLT's platform version.

Extension Functions

deserialize

fun <T : Any> ByteSequence.deserialize(serializationFactory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = serializationFactory.defaultContext): T

Convenience extension method for deserializing a ByteSequence, utilising the defaults.

sha256

fun OpaqueBytes.sha256(): SHA256

Compute the SHA-256 hash for the contents of the OpaqueBytes.