Signature Class Reference

#include <pk.h>

Collaboration diagram for Signature:

Collaboration graph

Detailed Description

Data type used for digital signature operations.


Public Member Functions

Destructor
virtual ~Signature ()
 Destructor.
Object Reuse and Initialization
void clear ()
 Clear this object.
int init (const Key &k)
 Initialize this object based on a specified key.
int load (const str &x, int isRaw=0)
 Load a raw binary or ASN.1 DER-encoded signature into this object.
Predicates
bool isRSA () const
 Predicate used to test whether this object contains an RSA signature.
Conversions
template<class T>
to () const
 Convert this object into an object of type T.
str toraw () const
 Convert this object into a str containing a raw signature.
asn toasn1 () const
 Convert this object into a ASN.1 DER-encoded str object.


Member Function Documentation

void clear ( void   )  [inline]

Clear this object.

Remarks:
Internal signature components are zeroized.

int init ( const Key k  ) 

Initialize this object based on a specified key.

Parameters:
k a key whose parameters are inspected and used to initialize this object.
Returns:
0

bool isRSA (  )  const [inline]

Predicate used to test whether this object contains an RSA signature.

Returns:
true, if this is an RSA signature
0, otherwise

int load ( const str x,
int  isRaw = 0 
)

Load a raw binary or ASN.1 DER-encoded signature into this object.

Parameters:
x ASN.1 DER-encoded signature or binary raw signature
isRaw 0 if x is ASN.1 encoded
1 if you know x is RAW (function will try RAW anyway, if ASN.1 decoding fails)
Returns:
0 (success)
1, if the signature cannot be loaded
CDK_INVALID_SIGNATURE, if the signature was successfully parsed but doesn't validate against this object's public key.

T to (  )  const

Convert this object into an object of type T.

Returns:
a class T representation of the signature (typically a binary string)

asn toasn1 (  )  const

Convert this object into a ASN.1 DER-encoded str object.

Returns:
a str containing an ASN.1 DER-encoded signature

str toraw (  )  const

Convert this object into a str containing a raw signature.

Returns:
a str containing a raw signature


The documentation for this class was generated from the following file:
ISC Cryptographic Development Kit - User's Guide
ISC website
Questions? E-mail ISC technical support
Copyright© 2002-2006 Information Security Corp. All rights reserved.