public class SignedTransaction implements NamedByHash
SignedTransaction wraps a serialized WireTransaction. It contains one or more signatures, each one for
a public key 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 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 class WireTransaction
Merkle tree root. Thus adding or removing a signature does not change it.
class WireTransaction
Constructor and Description |
---|
SignedTransaction(SerializedBytes<net.corda.core.transactions.WireTransaction> txBits,
java.util.List<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigs,
SecureHash id)
SignedTransaction wraps a serialized WireTransaction. It contains one or more signatures, each one for
a public key 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 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
class WireTransaction Merkle tree root. Thus adding or removing a signature does not change it. |
Modifier and Type | Method and Description |
---|---|
void |
checkSignaturesAreValid()
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 verifySignatures instead.
|
SerializedBytes<net.corda.core.transactions.WireTransaction> |
component1() |
java.util.List<net.corda.core.crypto.DigitalSignature.WithKey> |
component2() |
SecureHash |
component3() |
SignedTransaction |
copy(SerializedBytes<net.corda.core.transactions.WireTransaction> txBits,
java.util.List<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigs,
SecureHash id)
SignedTransaction wraps a serialized WireTransaction. It contains one or more signatures, each one for
a public key 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 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
class WireTransaction Merkle tree root. Thus adding or removing a signature does not change it. |
boolean |
equals(java.lang.Object p) |
SecureHash |
getId() |
java.util.List<net.corda.core.crypto.DigitalSignature.WithKey> |
getSigs() |
WireTransaction |
getTx()
Lazily calculated access to the deserialised/hashed transaction data.
|
SerializedBytes<net.corda.core.transactions.WireTransaction> |
getTxBits() |
int |
hashCode() |
SignedTransaction |
plus(DigitalSignature.WithKey sig)
Alias for
SignedTransaction.withAdditionalSignature to let you use Kotlin operator overloading. |
SignedTransaction |
plus(java.util.Collection<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigList)
Alias for withAdditionalSignatures to let you use Kotlin operator overloading.
|
LedgerTransaction |
toLedgerTransaction(ServiceHub services)
Calls verifySignatures to check all required signatures are present, and then calls
WireTransaction.toLedgerTransaction with the passed in interface ServiceHub to resolve the dependencies,
returning an unverified LedgerTransaction. |
java.lang.String |
toString() |
WireTransaction |
verifySignatures(net.corda.core.crypto.CompositeKey allowedToBeMissing)
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 contained transactions BaseTransaction.mustSign property.
|
SignedTransaction |
withAdditionalSignature(DigitalSignature.WithKey sig)
Returns the same transaction but with an additional (unchecked) signature.
|
SignedTransaction |
withAdditionalSignatures(java.lang.Iterable<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigList)
Returns the same transaction but with an additional (unchecked) signatures.
|
getId
public SignedTransaction(SerializedBytes<net.corda.core.transactions.WireTransaction> txBits, java.util.List<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigs, SecureHash id)
SignedTransaction wraps a serialized WireTransaction. It contains one or more signatures, each one for
a public key 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 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 class WireTransaction
Merkle tree root. Thus adding or removing a signature does not change it.
class WireTransaction
public WireTransaction getTx()
Lazily calculated access to the deserialised/hashed transaction data.
public WireTransaction verifySignatures(net.corda.core.crypto.CompositeKey allowedToBeMissing)
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 contained transactions BaseTransaction.mustSign property.
Normally you would not provide any keys to this function, but if you're in the process of building a partial transaction and you want to access the contents before you've signed it, you can specify your own keys here to bypass that check.
public void checkSignaturesAreValid()
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 verifySignatures instead.
public SignedTransaction withAdditionalSignature(DigitalSignature.WithKey sig)
Returns the same transaction but with an additional (unchecked) signature.
public SignedTransaction withAdditionalSignatures(java.lang.Iterable<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigList)
Returns the same transaction but with an additional (unchecked) signatures.
public SignedTransaction plus(DigitalSignature.WithKey sig)
Alias for SignedTransaction.withAdditionalSignature
to let you use Kotlin operator overloading.
public SignedTransaction plus(java.util.Collection<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigList)
Alias for withAdditionalSignatures to let you use Kotlin operator overloading.
public LedgerTransaction toLedgerTransaction(ServiceHub services)
Calls verifySignatures to check all required signatures are present, and then calls
WireTransaction.toLedgerTransaction
with the passed in interface ServiceHub
to resolve the dependencies,
returning an unverified LedgerTransaction.
WireTransaction.toLedgerTransaction
,
interface ServiceHub
public SerializedBytes<net.corda.core.transactions.WireTransaction> getTxBits()
public java.util.List<net.corda.core.crypto.DigitalSignature.WithKey> getSigs()
public SecureHash getId()
public SerializedBytes<net.corda.core.transactions.WireTransaction> component1()
public java.util.List<net.corda.core.crypto.DigitalSignature.WithKey> component2()
public SecureHash component3()
public SignedTransaction copy(SerializedBytes<net.corda.core.transactions.WireTransaction> txBits, java.util.List<? extends net.corda.core.crypto.DigitalSignature.WithKey> sigs, SecureHash id)
SignedTransaction wraps a serialized WireTransaction. It contains one or more signatures, each one for
a public key 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 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 class WireTransaction
Merkle tree root. Thus adding or removing a signature does not change it.
class WireTransaction
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)