public class TransactionSignature extends DigitalSignature
A wrapper over the signature output accompanied by signer's public key and signature metadata.
This is similar to class DigitalSignature.WithKey
, but targeted to DLT transaction (or block of transactions) signatures.
class DigitalSignature.WithKey
DigitalSignature.WithKey
OpaqueBytes.Companion
Companion
Constructor and Description |
---|
TransactionSignature(byte[] bytes,
java.security.PublicKey by,
SignatureMetadata signatureMetadata,
PartialMerkleTree partialMerkleTree)
A wrapper over the signature output accompanied by signer's public key and signature metadata.
This is similar to
class DigitalSignature.WithKey , but targeted to DLT transaction (or block of transactions) signatures. |
TransactionSignature(byte[] bytes,
java.security.PublicKey by,
SignatureMetadata signatureMetadata)
Construct a
class TransactionSignature with partialMerkleTree set to null.
This is the recommended constructor when signing over a single transaction. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.security.PublicKey |
getBy()
|
PartialMerkleTree |
getPartialMerkleTree()
required when multi-transaction signing is utilised.
|
SignatureMetadata |
getSignatureMetadata()
attached
|
int |
hashCode() |
boolean |
isValid(SecureHash txId)
Utility to simplify the act of verifying a signature. In comparison to
TransactionSignature.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. |
boolean |
verify(SecureHash txId)
Function to verify a
class SignableData object's signature.
Note that class SignableData contains the id of the transaction and extra metadata, such as DLT's platform version.
A non-null partialMerkleTree implies multi-transaction signing and the signature is over the root of this tree. |
getBytes
public TransactionSignature(byte[] bytes, java.security.PublicKey by, SignatureMetadata signatureMetadata, PartialMerkleTree partialMerkleTree)
A wrapper over the signature output accompanied by signer's public key and signature metadata.
This is similar to class DigitalSignature.WithKey
, but targeted to DLT transaction (or block of transactions) signatures.
by
- PublicKey of the signer.signatureMetadata
- attached class SignatureMetadata
for this signature.partialMerkleTree
- required when multi-transaction signing is utilised.class DigitalSignature.WithKey
public TransactionSignature(byte[] bytes, java.security.PublicKey by, SignatureMetadata signatureMetadata)
Construct a class TransactionSignature
with partialMerkleTree set to null.
This is the recommended constructor when signing over a single transaction.
class TransactionSignature
public boolean verify(SecureHash txId)
Function to verify a class SignableData
object's signature.
Note that class SignableData
contains the id of the transaction and extra metadata, such as DLT's platform version.
A non-null partialMerkleTree implies multi-transaction signing and the signature is over the root of this tree.
txId
- transaction's id (Merkle root), which along with signatureMetadata will be used to construct the class SignableData
object to be signed.class SignableData
,
class SignableData
public boolean isValid(SecureHash txId)
Utility to simplify the act of verifying a signature. In comparison to TransactionSignature.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.
TransactionSignature.verify
public boolean equals(java.lang.Object other)
public int hashCode()
public SignatureMetadata getSignatureMetadata()
attached
class SignatureMetadata
for this signature.
class SignatureMetadata
public PartialMerkleTree getPartialMerkleTree()
required when multi-transaction signing is utilised.