Class AbstractDelegatedTransactionVerifier
java.lang.Object
org.xrpl.xrpl4j.crypto.core.signing.AbstractDelegatedTransactionVerifier
- All Implemented Interfaces:
DelegatedPublicKeyProvider
,DelegatedTransactionVerifier
public abstract class AbstractDelegatedTransactionVerifier
extends Object
implements DelegatedTransactionVerifier
An abstract implementation of
DelegatedTransactionVerifier
with common functionality that sub-classes can
utilize.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractDelegatedTransactionVerifier
(SignatureUtils signatureUtils, AddressUtils addressService) Required-args Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
ecDsaVerify
(KeyMetadata keyMetadata, UnsignedByteArray signableTransactionBytes, Signature transactionSignature) Verify a signature.protected abstract boolean
edDsaVerify
(KeyMetadata keyMetadata, UnsignedByteArray signableTransactionBytes, Signature transactionSignature) Verify a signature.<T extends Transaction>
booleanverifyMultiSigned
(Set<SignatureWithKeyMetadata> signatureWithKeyMetadataSet, T unsignedTransaction) Verify that all signers have properly signed theunsignedTransaction
.<T extends Transaction>
booleanverifyMultiSigned
(Set<SignatureWithKeyMetadata> signatureWithKeyMetadataSet, T unsignedTransaction, int minSigners) Verify thatminSigners
from the collection of public keys have supplied signatures for the given theunsignedTransaction
.<T extends Transaction>
booleanverifySingleSigned
(SignatureWithKeyMetadata signatureWithKeyMetadata, T unsignedTransaction) TransactionVerifier the supplied digital-signature to ensure that it was constructed using the private-key corresponding topublicKey
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xrpl.xrpl4j.crypto.core.signing.DelegatedPublicKeyProvider
getPublicKey
-
Constructor Details
-
AbstractDelegatedTransactionVerifier
protected AbstractDelegatedTransactionVerifier(SignatureUtils signatureUtils, AddressUtils addressService) Required-args Constructor.- Parameters:
signatureUtils
- AnSignatureUtils
for help with signing.addressService
- AnAddressUtils
.
-
-
Method Details
-
verifySingleSigned
public <T extends Transaction> boolean verifySingleSigned(SignatureWithKeyMetadata signatureWithKeyMetadata, T unsignedTransaction) Description copied from interface:DelegatedTransactionVerifier
TransactionVerifier the supplied digital-signature to ensure that it was constructed using the private-key corresponding topublicKey
.- Specified by:
verifySingleSigned
in interfaceDelegatedTransactionVerifier
- Type Parameters:
T
- ATransaction
.- Parameters:
signatureWithKeyMetadata
- ASignatureWithKeyMetadata
that contains a signature and a public key that can be used to verify the transaction signature.unsignedTransaction
- ADelegatedTransactionVerifier
that was signed.- Returns:
true
if the signature is valid and verified;false
otherwise.
-
verifyMultiSigned
public <T extends Transaction> boolean verifyMultiSigned(Set<SignatureWithKeyMetadata> signatureWithKeyMetadataSet, T unsignedTransaction) Description copied from interface:DelegatedTransactionVerifier
Verify that all signers have properly signed theunsignedTransaction
.- Specified by:
verifyMultiSigned
in interfaceDelegatedTransactionVerifier
- Type Parameters:
T
- The actual type ofTransaction
.- Parameters:
signatureWithKeyMetadataSet
- ASet
ofSignatureWithKeyMetadata
used for verification.unsignedTransaction
- TheTransaction
of typeDelegatedTransactionVerifier
that was signed.- Returns:
true
if a minimum number of signatures are valid for the supplied transaction;false
otherwise.
-
verifyMultiSigned
public <T extends Transaction> boolean verifyMultiSigned(Set<SignatureWithKeyMetadata> signatureWithKeyMetadataSet, T unsignedTransaction, int minSigners) Description copied from interface:DelegatedTransactionVerifier
Verify thatminSigners
from the collection of public keys have supplied signatures for the given theunsignedTransaction
.- Specified by:
verifyMultiSigned
in interfaceDelegatedTransactionVerifier
- Type Parameters:
T
- The actual type ofTransaction
.- Parameters:
signatureWithKeyMetadataSet
- ASet
ofSignatureWithKeyMetadata
used for verification.unsignedTransaction
- The transaction of typeDelegatedTransactionVerifier
that was signed.minSigners
- The minimum number of signatures required to form a quorum.- Returns:
true
if a minimum number of signatures are valid for the supplied transaction;false
otherwise.
-
edDsaVerify
protected abstract boolean edDsaVerify(KeyMetadata keyMetadata, UnsignedByteArray signableTransactionBytes, Signature transactionSignature) Verify a signature.- Parameters:
keyMetadata
- AKeyMetadata
.signableTransactionBytes
- AUnsignedByteArray
.transactionSignature
- ASignature
.- Returns:
true
if the signature is valid;false
otherwise.
-
ecDsaVerify
protected abstract boolean ecDsaVerify(KeyMetadata keyMetadata, UnsignedByteArray signableTransactionBytes, Signature transactionSignature) Verify a signature.- Parameters:
keyMetadata
- AKeyMetadata
.signableTransactionBytes
- AUnsignedByteArray
.transactionSignature
- ASignature
.- Returns:
true
if the signature is valid;false
otherwise.
-