corda / net.corda.core.transactions / TransactionWithSignatures

TransactionWithSignatures

@DoNotImplement interface TransactionWithSignatures : NamedByHash

An interface for transactions containing signatures, with logic for signature verification.

Properties

requiredSigningKeys

abstract val requiredSigningKeys: Set<PublicKey>

Specifies all the public keys that require signatures for the transaction to be valid.

sigs

abstract val sigs: List<TransactionSignature>

List of signatures on this transaction.

Inherited Properties

id

abstract val id: SecureHash

Functions

checkSignaturesAreValid

open fun checkSignaturesAreValid(): Unit

Mathematically validates the signatures that are present on this transaction. This does not imply that the signatures are by the right keys, or that there are sufficient signatures, just that they aren't corrupt. If you use this function directly you'll need to do the other checks yourself. Probably you want verifyRequiredSignatures instead.

getKeyDescriptions

abstract fun getKeyDescriptions(keys: Set<PublicKey>): List<String>

Get a human readable description of where signatures are required from, and are missing, to assist in debugging the underlying cause.

getMissingSigners

open fun getMissingSigners(): Set<PublicKey>

Return the PublicKeys for which we still need signatures.

verifyRequiredSignatures

open fun verifyRequiredSignatures(): Unit

Verifies the signatures on this transaction and throws if any are missing. In this context, "verifying" means checking they are valid signatures and that their public keys are in the requiredSigningKeys set.

verifySignaturesExcept

open fun verifySignaturesExcept(vararg allowedToBeMissing: PublicKey): Unit
open fun verifySignaturesExcept(allowedToBeMissing: Collection<PublicKey>): Unit

Verifies the signatures on this transaction and throws if any are missing which aren't passed as parameters. In this context, "verifying" means checking they are valid signatures and that their public keys are in the requiredSigningKeys set.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.

Inheritors

ContractUpgradeLedgerTransaction

class ContractUpgradeLedgerTransaction : FullTransaction, TransactionWithSignatures

A contract upgrade transaction with fully resolved inputs and signatures. Contract upgrade transactions are separate to regular transactions because their validation logic is specialised; the original contract by definition cannot be aware of the upgraded contract (it was written after the original contract was developed), so its validation logic cannot succeed. Instead alternative verification logic is used which verifies that the outputs correspond to the inputs after upgrading.

NotaryChangeLedgerTransaction

class NotaryChangeLedgerTransaction : FullTransaction, TransactionWithSignatures

A notary change transaction with fully resolved inputs and signatures. In contrast with a regular transaction, signatures are checked against the signers specified by input states' participants fields, so full resolution is needed for signature verification.

SignedTransaction

data class SignedTransaction : TransactionWithSignatures

SignedTransaction wraps a serialized WireTransaction. It contains one or more signatures, each one for a public key (including composite keys) that is mentioned inside a transaction command. SignedTransaction is the top level transaction type and the type most frequently passed around the network and stored. The identity of a transaction is the hash of Merkle root of a WireTransaction, therefore if you are storing data keyed by WT hash be aware that multiple different STs may map to the same key (and they could be different in important ways, like validity!). The signatures on a SignedTransaction might be invalid or missing: the type does not imply validity. A transaction ID should be the hash of the WireTransaction Merkle tree root. Thus adding or removing a signature does not change it.