Package org.xrpl.xrpl4j.crypto.signing
Class AbstractTransactionVerifier
java.lang.Object
org.xrpl.xrpl4j.crypto.signing.AbstractTransactionVerifier
- All Implemented Interfaces:
TransactionVerifier
An abstract implementation of
TransactionVerifier.-
Constructor Summary
ConstructorsConstructorDescriptionAbstractTransactionVerifier(SignatureUtils signatureUtils) Required-args Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanecDsaVerify(PublicKey publicKey, UnsignedByteArray transactionBytes, Signature signature) Verify a signature.protected abstract booleanedDsaVerify(PublicKey publicKey, UnsignedByteArray transactionBytes, Signature signature) Verify a signature.<T extends Transaction>
booleanVerify the supplied digital-signature to ensure that it was constructed using the private-key corresponding tosignerPublicKey.<T extends Transaction>
booleanverifyMultiSigned(Set<Signer> signerSet, T unsignedTransaction, int minSigners) Verify thatminSignersfrom the collection of public keys have supplied signatures for a given signed transaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xrpl.xrpl4j.crypto.signing.TransactionVerifier
verifyMultiSigned
-
Constructor Details
-
AbstractTransactionVerifier
Required-args Constructor.- Parameters:
signatureUtils- ASignatureUtils.
-
-
Method Details
-
verify
Description copied from interface:TransactionVerifierVerify the supplied digital-signature to ensure that it was constructed using the private-key corresponding tosignerPublicKey.- Specified by:
verifyin interfaceTransactionVerifier- Type Parameters:
T- The actual type ofTransaction.- Parameters:
signer- ASignerused for verification.unsignedTransaction- TheTransactionof typeTransactionVerifierthat was signed.- Returns:
trueif the signature is valid and verified;falseotherwise.
-
verifyMultiSigned
public <T extends Transaction> boolean verifyMultiSigned(Set<Signer> signerSet, T unsignedTransaction, int minSigners) Description copied from interface:TransactionVerifierVerify thatminSignersfrom the collection of public keys have supplied signatures for a given signed transaction.- Specified by:
verifyMultiSignedin interfaceTransactionVerifier- Type Parameters:
T- The actual type ofTransaction.- Parameters:
signerSet- ASetofSignerobjects used for verification.unsignedTransaction- The transaction of typeTransactionVerifierthat was signed.minSigners- The minimum number of signatures required to form a quorum.- Returns:
trueif a minimum number of signatures are valid for the supplied transaction;falseotherwise.
-
edDsaVerify
protected abstract boolean edDsaVerify(PublicKey publicKey, UnsignedByteArray transactionBytes, Signature signature) Verify a signature.- Parameters:
publicKey- ThePublicKeyused to verify the signed transaction.transactionBytes- AnUnsignedByteArraycontaining the bytes of the transaction that was signed.signature- ASignatureover the transaction.- Returns:
trueif the signature is valid;falseotherwise.
-
ecDsaVerify
protected abstract boolean ecDsaVerify(PublicKey publicKey, UnsignedByteArray transactionBytes, Signature signature) Verify a signature.- Parameters:
publicKey- APublicKey.transactionBytes- AnUnsignedByteArraycontaining the bytes of the transaction that was signed.signature- ASignatureover the transaction.- Returns:
trueif the signature is valid;falseotherwise.
-