xmltooling::BasicX509Credential Class Reference

Wraps an X.509-based Credential by storing key/cert objects inside. More...

#include <xmltooling/security/BasicX509Credential.h>

Inheritance diagram for xmltooling::BasicX509Credential:

xmltooling::X509Credential xmltooling::Credential List of all members.

Public Member Functions

unsigned int getUsage () const
 Get credential usage types.
const char * getAlgorithm () const
 Returns an algorithm identifier for the Credential.
unsigned int getKeySize () const
 Returns the size of the key.
XSECCryptoKey * getPrivateKey () const
 Returns a secret or private key to use for signing or decryption operations.
XSECCryptoKey * getPublicKey () const
 Returns a secret or public key to use for verification or encryption operations.
const std::set< std::string > & getKeyNames () const
 Returns names representing the Credential.
xmlsignature::KeyInfogetKeyInfo (bool compact=false) const
 Returns a ds:KeyInfo object representing the Credential for use in communicating with other entities.
const std::vector< XSECCryptoX509 * > & getEntityCertificateChain () const
 Gets an immutable collection of certificates in the entity's trust chain.
XSECCryptoX509CRLgetCRL () const
const std::vector< XSECCryptoX509CRL * > & getCRLs () const
 Gets an immutable collection of all CRLs associated with the credential.
const char * getSubjectName () const
 Gets the subject name of the first certificate in the chain.
const char * getIssuerName () const
 Gets the issuer name of the first certificate in the chain.
const char * getSerialNumber () const
 Gets the serial number of the first certificate in the chain.
void extract ()
 Extracts properties like issuer and subject from the first certificate in the chain.

Protected Member Functions

 BasicX509Credential (bool ownCerts)
 Constructor.
 BasicX509Credential (XSECCryptoKey *key, const std::vector< XSECCryptoX509 * > &certs, XSECCryptoX509CRL *crl=NULL)
 Constructor.
 BasicX509Credential (XSECCryptoKey *key, const std::vector< XSECCryptoX509 * > &certs, const std::vector< XSECCryptoX509CRL * > &crls)
 Constructor.
void initKeyInfo (unsigned int types=0)
 Initializes (or reinitializes) a ds:KeyInfo to represent the Credential.

Protected Attributes

XSECCryptoKey * m_key
 The private/secret key/keypair.
std::set< std::string > m_keyNames
 Key names (derived from credential, KeyInfo, or both).
std::string m_subjectName
 Subject DN.
std::string m_issuerName
 Issuer DN.
std::string m_serial
 Serial number.
std::vector< XSECCryptoX509 * > m_xseccerts
 The X.509 certificate chain.
bool m_ownCerts
 Indicates whether to destroy certificates.
std::vector< XSECCryptoX509CRL * > m_crls
 The X.509 CRLs.
xmlsignature::KeyInfom_keyInfo
 The KeyInfo object representing the information.
xmlsignature::KeyInfom_compactKeyInfo
 The KeyInfo object representing the information in compact form.

Detailed Description

Wraps an X.509-based Credential by storing key/cert objects inside.


Constructor & Destructor Documentation

xmltooling::BasicX509Credential::BasicX509Credential ( bool  ownCerts  )  [inline, protected]

Constructor.

Parameters:
ownCerts true iff any certificates subsequently stored should be freed by destructor

xmltooling::BasicX509Credential::BasicX509Credential ( XSECCryptoKey *  key,
const std::vector< XSECCryptoX509 * > &  certs,
XSECCryptoX509CRL crl = NULL 
) [inline, protected]

Constructor.

Parameters:
key key pair or secret key
certs array of X.509 certificates, the first entry being the entity certificate
crl optional CRL

xmltooling::BasicX509Credential::BasicX509Credential ( XSECCryptoKey *  key,
const std::vector< XSECCryptoX509 * > &  certs,
const std::vector< XSECCryptoX509CRL * > &  crls 
) [inline, protected]

Constructor.

Parameters:
key key pair or secret key
certs array of X.509 certificates, the first entry being the entity certificate
crls array of X.509 CRLs


Member Function Documentation

const char* xmltooling::BasicX509Credential::getAlgorithm (  )  const [virtual]

Returns an algorithm identifier for the Credential.

Returns:
the Credential algorithm, or NULL if indeterminate

Implements xmltooling::Credential.

XSECCryptoX509CRL* xmltooling::BasicX509Credential::getCRL (  )  const [inline, virtual]

Deprecated:
Gets a CRL associated with the credential.

Returns:
CRL associated with the credential

Implements xmltooling::X509Credential.

const std::vector<XSECCryptoX509CRL*>& xmltooling::BasicX509Credential::getCRLs (  )  const [inline, virtual]

Gets an immutable collection of all CRLs associated with the credential.

Returns:
CRLs associated with the credential

Implements xmltooling::X509Credential.

const std::vector<XSECCryptoX509*>& xmltooling::BasicX509Credential::getEntityCertificateChain (  )  const [inline, virtual]

Gets an immutable collection of certificates in the entity's trust chain.

The entity certificate is contained within this list. No specific ordering of the certificates is guaranteed.

Returns:
a certificate chain

Implements xmltooling::X509Credential.

const char* xmltooling::BasicX509Credential::getIssuerName (  )  const [inline, virtual]

Gets the issuer name of the first certificate in the chain.

Returns:
the Issuer DN

Implements xmltooling::X509Credential.

xmlsignature::KeyInfo* xmltooling::BasicX509Credential::getKeyInfo ( bool  compact = false  )  const [inline, virtual]

Returns a ds:KeyInfo object representing the Credential for use in communicating with other entities.

Parameters:
compact true iff the communication medium is such that only compact forms should be included
Returns:
a KeyInfo object, which must be freed by the caller

Implements xmltooling::Credential.

const std::set<std::string>& xmltooling::BasicX509Credential::getKeyNames (  )  const [inline, virtual]

Returns names representing the Credential.

Names should be unique in the context of the comparisons against CredentialCriteria that deployments expect to see.

Returns:
a sorted set of names

Implements xmltooling::Credential.

unsigned int xmltooling::BasicX509Credential::getKeySize (  )  const [virtual]

Returns the size of the key.

Returns:
the key size, or 0 if indeterminate

Implements xmltooling::Credential.

XSECCryptoKey* xmltooling::BasicX509Credential::getPrivateKey (  )  const [inline, virtual]

Returns a secret or private key to use for signing or decryption operations.

Returns:
a secret or private key

Implements xmltooling::Credential.

XSECCryptoKey* xmltooling::BasicX509Credential::getPublicKey (  )  const [inline, virtual]

Returns a secret or public key to use for verification or encryption operations.

Returns:
a secret or public key

Implements xmltooling::Credential.

const char* xmltooling::BasicX509Credential::getSerialNumber (  )  const [inline, virtual]

Gets the serial number of the first certificate in the chain.

Returns:
the serial number

Implements xmltooling::X509Credential.

const char* xmltooling::BasicX509Credential::getSubjectName (  )  const [inline, virtual]

Gets the subject name of the first certificate in the chain.

Returns:
the Subject DN

Implements xmltooling::X509Credential.

unsigned int xmltooling::BasicX509Credential::getUsage (  )  const [inline, virtual]

Get credential usage types.

Returns:
the usage bitmask

Implements xmltooling::Credential.

void xmltooling::BasicX509Credential::initKeyInfo ( unsigned int  types = 0  )  [protected]

Initializes (or reinitializes) a ds:KeyInfo to represent the Credential.

Parameters:
types the kinds of KeyInfo content to include


The documentation for this class was generated from the following file:
Generated on Mon Oct 19 14:18:34 2009 for xmltooling by  doxygen 1.4.7