Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

PK_Verifier Class Reference

#include <cryptlib.h>

Inheritance diagram for PK_Verifier:

PK_SignatureScheme PublicKeyAlgorithm AsymmetricAlgorithm Algorithm Clonable PK_SignatureSchemeBase< H, PK_Verifier, DigestVerifier > PK_VerifierWithRecovery PK_VerifierBase< H > VerifierWithRecoveryTemplate< TF, H > PK_SignatureSchemeImpl< PK_VerifierBase< H >, DS > PK_VerifierImpl< DS, H > List of all members.

Detailed Description

interface for public-key signature verifiers

Definition at line 1262 of file cryptlib.h.

Public Member Functions

virtual bool SignatureUpfrontForVerification () const
virtual HashTransformation * NewVerificationAccumulator (const byte *signature=NULL) const
 create a new HashTransformation to accumulate the message to be verified

virtual bool Verify (HashTransformation *messageAccumulator, const byte *signature=NULL) const
 check whether sig is a valid signature for messageAccumulator, and delete messageAccumulator (even in case of exception thrown)

virtual bool VerifyAndRestart (HashTransformation &messageAccumulator, const byte *signature) const=0
 check whether sig is a valid signature for messageAccumulator, and restart messageAccumulator

virtual void InitializeVerificationAccumulator (HashTransformation &messageAccumulator, const byte *signature) const
 only useful if SignatureUpfrontForVerification() == true

virtual bool VerifyMessage (const byte *message, unsigned int messageLen, const byte *signature) const
 check whether sig is a valid signature for message

virtual unsigned int SignatureLength () const=0
 signature length support by this object (as either input or output)

virtual HashTransformation * NewMessageAccumulator () const=0
 deprecated, please use PK_Signer::NewSignatureAccumulator or PK_Verifier::NewVerificationAccumulator instead

CryptoMaterial & AccessMaterial ()
 returns a reference to the crypto material used by this object

const CryptoMaterial & GetMaterial () const
 returns a const reference to the crypto material used by this object

virtual PublicKey & AccessPublicKey ()=0
virtual const PublicKey & GetPublicKey () const
void BERDecode (BufferedTransformation &bt)
 for backwards compatibility, calls AccessMaterial().Load(bt)

void DEREncode (BufferedTransformation &bt) const
 for backwards compatibility, calls GetMaterial().Save(bt)

virtual std::string AlgorithmName () const
 returns name of this algorithm, not universally implemented yet

virtual Clonable * Clone () const
 this is not implemented by most classes yet


Member Function Documentation

virtual bool PK_Verifier::SignatureUpfrontForVerification (   )  const [inline, virtual]
 

If this function returns true, you must input the signature when calling NewVerificationAccumulator(). Otherwise, you must input the signature when calling Verify().

Definition at line 1268 of file cryptlib.h.

virtual HashTransformation* PK_Verifier::NewVerificationAccumulator (  const byte *  signature = NULL  )  const [inline, virtual]
 

create a new HashTransformation to accumulate the message to be verified

Parameters:
signature is ignored if SignatureUpfrontForVerification() == false
signature may be NULL to indicate that the signature is not available yet

Definition at line 1274 of file cryptlib.h.

References PK_SignatureScheme::NewMessageAccumulator().

Referenced by VerifyMessage().

bool PK_Verifier::Verify (  HashTransformation *  messageAccumulator,
const byte *  signature = NULL
)  const [virtual]
 

check whether sig is a valid signature for messageAccumulator, and delete messageAccumulator (even in case of exception thrown)

Precondition:
messageAccumulator was obtained by calling NewVerificationAccumulator()

HashTransformation::Final() has not been called on messageAccumulator

length of signature == SignatureLength()

Parameters:
signature is ignored if SignatureUpfrontForVerification() == true

Definition at line 632 of file cryptlib.cpp.

References VerifyAndRestart().

virtual bool PK_Verifier::VerifyAndRestart (  HashTransformation &  messageAccumulator,
const byte *  signature
)  const [pure virtual]
 

check whether sig is a valid signature for messageAccumulator, and restart messageAccumulator

Note:
depending on SignatureUpfrontForVerification(), signature is either the current or the next signature
Parameters:
signature may be NULL to indicate that the next signature is not available yet

Implemented in PK_VerifierBase< H >, and VerifierWithRecoveryTemplate< TF, H >.

Referenced by Verify(), and VerifyMessage().

bool PK_Verifier::VerifyMessage (  const byte *  message,
unsigned int  messageLen,
const byte *  signature
)  const [virtual]
 

check whether sig is a valid signature for message

Precondition:
size of signature == SignatureLength()

Definition at line 638 of file cryptlib.cpp.

References NewVerificationAccumulator(), and VerifyAndRestart().


The documentation for this class was generated from the following files:
Generated on Tue Jul 8 23:35:21 2003 for Crypto++ by doxygen 1.3.2