xmltooling 3.2.4
xmltooling::CredentialCriteria Class Reference

Class for specifying criteria by which a CredentialResolver should resolve credentials. More...

#include <xmltooling/security/CredentialCriteria.h>

Public Types

enum  keyinfo_extraction_t { KEYINFO_EXTRACTION_KEY = 1 , KEYINFO_EXTRACTION_KEYNAMES = 2 }
 Bitmask constants controlling the kinds of criteria set automatically based on a KeyInfo object.
 

Public Member Functions

 CredentialCriteria ()
 Default constructor.
 
virtual bool matches (const Credential &credential) const
 Determines whether the supplied Credential matches this CredentialCriteria.
 
unsigned int getUsage () const
 Get key usage criteria.
 
void setUsage (unsigned int usage)
 Set key usage criteria.
 
const char * getPeerName () const
 Get the peer name criteria.
 
void setPeerName (const char *peerName)
 Set the peer name criteria.
 
const char * getKeyAlgorithm () const
 Get the key algorithm criteria.
 
void setKeyAlgorithm (const char *keyAlgorithm)
 Set the key algorithm criteria.
 
unsigned int getKeySize () const
 Get the key size criteria.
 
void setKeySize (unsigned int keySize)
 Set the key size criteria.
 
unsigned int getMaxKeySize () const
 Get the maximum key size criteria.
 
void setMaxKeySize (unsigned int keySize)
 Set the maximum key size criteria.
 
void setXMLAlgorithm (const XMLCh *algorithm)
 Set the key algorithm and size criteria based on an XML algorithm specifier.
 
const std::set< std::string > & getKeyNames () const
 Gets key name criteria.
 
std::set< std::string > & getKeyNames ()
 Gets key name criteria.
 
virtual XSECCryptoKey * getPublicKey () const
 Returns the public key criteria.
 
void setPublicKey (XSECCryptoKey *key)
 Sets the public key criteria.
 
const xmlsignature::KeyInfo * getKeyInfo () const
 Gets the KeyInfo criteria.
 
virtual void setKeyInfo (const xmlsignature::KeyInfo *keyInfo, int extraction=0)
 Sets the KeyInfo criteria.
 
DSIGKeyInfoList * getNativeKeyInfo () const
 Gets the native KeyInfo criteria.
 
virtual void setNativeKeyInfo (DSIGKeyInfoList *keyInfo, int extraction=0)
 Sets the KeyInfo criteria.
 
void setSignature (const xmlsignature::Signature &sig, int extraction=0)
 Sets the KeyInfo criteria from an XML Signature.
 
virtual void reset ()
 Resets object to a default state.
 

Detailed Description

Class for specifying criteria by which a CredentialResolver should resolve credentials.

Member Function Documentation

◆ getKeyAlgorithm()

const char * xmltooling::CredentialCriteria::getKeyAlgorithm ( ) const

Get the key algorithm criteria.

Returns
the key algorithm

◆ getKeyInfo()

const xmlsignature::KeyInfo * xmltooling::CredentialCriteria::getKeyInfo ( ) const

Gets the KeyInfo criteria.

Returns
the KeyInfo criteria

◆ getKeyNames() [1/2]

std::set< std::string > & xmltooling::CredentialCriteria::getKeyNames ( )

Gets key name criteria.

Returns
a mutable set of key names

◆ getKeyNames() [2/2]

const std::set< std::string > & xmltooling::CredentialCriteria::getKeyNames ( ) const

Gets key name criteria.

Returns
an immutable set of key names

◆ getKeySize()

unsigned int xmltooling::CredentialCriteria::getKeySize ( ) const

Get the key size criteria.

If a a maximum size is also set, this is treated as a minimum.

Returns
the key size, or 0

◆ getMaxKeySize()

unsigned int xmltooling::CredentialCriteria::getMaxKeySize ( ) const

Get the maximum key size criteria.

Returns
the maximum key size, or 0

◆ getNativeKeyInfo()

DSIGKeyInfoList * xmltooling::CredentialCriteria::getNativeKeyInfo ( ) const

Gets the native KeyInfo criteria.

Returns
the native KeyInfo criteria

◆ getPeerName()

const char * xmltooling::CredentialCriteria::getPeerName ( ) const

Get the peer name criteria.

Returns
the peer name

◆ getPublicKey()

virtual XSECCryptoKey * xmltooling::CredentialCriteria::getPublicKey ( ) const
virtual

Returns the public key criteria.

Returns
a public key

◆ getUsage()

unsigned int xmltooling::CredentialCriteria::getUsage ( ) const

Get key usage criteria.

Returns
the usage mask

◆ matches()

virtual bool xmltooling::CredentialCriteria::matches ( const Credential & credential) const
virtual

Determines whether the supplied Credential matches this CredentialCriteria.

Parameters
credentialthe Credential to evaluate
Returns
true iff the Credential is consistent with this criteria

◆ setKeyAlgorithm()

void xmltooling::CredentialCriteria::setKeyAlgorithm ( const char * keyAlgorithm)

Set the key algorithm criteria.

Parameters
keyAlgorithmthe key algorithm to set

◆ setKeyInfo()

virtual void xmltooling::CredentialCriteria::setKeyInfo ( const xmlsignature::KeyInfo * keyInfo,
int extraction = 0 )
virtual

Sets the KeyInfo criteria.

Parameters
keyInfothe KeyInfo criteria
extractionbitmask of criteria to auto-extract from KeyInfo

◆ setKeySize()

void xmltooling::CredentialCriteria::setKeySize ( unsigned int keySize)

Set the key size criteria.

If a a maximum size is also set, this is treated as a minimum.

Parameters
keySizekey size to set

◆ setMaxKeySize()

void xmltooling::CredentialCriteria::setMaxKeySize ( unsigned int keySize)

Set the maximum key size criteria.

Parameters
keySizemaximum key size to set

◆ setNativeKeyInfo()

virtual void xmltooling::CredentialCriteria::setNativeKeyInfo ( DSIGKeyInfoList * keyInfo,
int extraction = 0 )
virtual

Sets the KeyInfo criteria.

Parameters
keyInfothe KeyInfo criteria
extractionbitmask of criteria to auto-extract from KeyInfo

◆ setPeerName()

void xmltooling::CredentialCriteria::setPeerName ( const char * peerName)

Set the peer name criteria.

Parameters
peerNamepeer name to set

◆ setPublicKey()

void xmltooling::CredentialCriteria::setPublicKey ( XSECCryptoKey * key)

Sets the public key criteria.

The lifetime of the key MUST extend for the lifetime of this object.

Parameters
keya public key

◆ setSignature()

void xmltooling::CredentialCriteria::setSignature ( const xmlsignature::Signature & sig,
int extraction = 0 )

Sets the KeyInfo criteria from an XML Signature.

Parameters
sigthe Signature containing KeyInfo criteria
extractionbitmask of criteria to auto-extract from KeyInfo

◆ setUsage()

void xmltooling::CredentialCriteria::setUsage ( unsigned int usage)

Set key usage criteria.

Parameters
usagethe usage mask to set

◆ setXMLAlgorithm()

void xmltooling::CredentialCriteria::setXMLAlgorithm ( const XMLCh * algorithm)

Set the key algorithm and size criteria based on an XML algorithm specifier.

Parameters
algorithmXML algorithm specifier

The documentation for this class was generated from the following file: