Singleton object that manages library startup/shutdown.configuration. More...
#include <xmltooling/XMLToolingConfig.h>
Public Types | |
enum | XMLSecurityAlgorithmType { ALGTYPE_UNK, ALGTYPE_DIGEST, ALGTYPE_SIGN, ALGTYPE_ENCRYPT, ALGTYPE_KEYENCRYPT, ALGTYPE_KEYAGREE, ALGTYPE_AUTHNENCRYPT } |
Types of XML Security algorithms. | |
Public Member Functions | |
virtual bool | init (bool deprecationSupport=true)=0 |
Initializes library. | |
virtual void | term ()=0 |
Shuts down library. | |
virtual bool | load_library (const char *path, void *context=0)=0 |
Loads a shared/dynamic library extension. | |
virtual bool | log_config (const char *config=0)=0 |
Configure logging system. | |
virtual ParserPool & | getParser () const =0 |
Obtains a non-validating parser pool. | |
virtual ParserPool & | getValidatingParser () const =0 |
Obtains a validating parser pool. | |
virtual Mutex & | getNamedMutex (const char *name)=0 |
Returns a reference to a named mutex. | |
const KeyInfoResolver * | getKeyInfoResolver () const |
Returns the global KeyInfoResolver instance. | |
ReplayCache * | getReplayCache () const |
Returns the global ReplayCache instance. | |
const DataSealer * | getDataSealer () const |
Returns the global DataSealer instance. | |
void | setKeyInfoResolver (KeyInfoResolver *keyInfoResolver) |
Sets the global KeyInfoResolver instance. | |
void | setReplayCache (ReplayCache *replayCache) |
Sets the global ReplayCache instance. | |
void | setDataSealer (DataSealer *dataSealer) |
Sets the global DataSealer instance. | |
PathResolver * | getPathResolver () const |
Returns the global PathResolver instance. | |
TemplateEngine * | getTemplateEngine () const |
Returns the global TemplateEngine instance. | |
const URLEncoder * | getURLEncoder () const |
Returns the global URLEncoder instance. | |
void | setPathResolver (PathResolver *pathResolver) |
Sets the global PathResolver instance. | |
void | setTemplateEngine (TemplateEngine *templateEngine) |
Sets the global TemplateEngine instance. | |
void | setURLEncoder (URLEncoder *urlEncoder) |
Sets the global URLEncoder instance. | |
virtual XSECCryptoX509CRL * | X509CRL () const =0 |
Returns an X.509 CRL implementation object. | |
virtual std::pair< const char *, unsigned int > | mapXMLAlgorithmToKeyAlgorithm (const XMLCh *xmlAlgorithm) const =0 |
Maps an XML Signature/Encryption algorithm identifier to a library-specific key algorithm and size for use in resolving credentials. | |
virtual void | registerXMLAlgorithm (const XMLCh *xmlAlgorithm, const char *keyAlgorithm, unsigned int size=0, XMLSecurityAlgorithmType type=ALGTYPE_UNK)=0 |
Registers an XML Signature/Encryption algorithm identifier against a library-specific key algorithm and size for use in resolving credentials. | |
virtual bool | isXMLAlgorithmSupported (const XMLCh *xmlAlgorithm, XMLSecurityAlgorithmType type=ALGTYPE_UNK)=0 |
Checks for implementation support of a particular XML Security algorithm. | |
Static Public Member Functions | |
static XMLToolingConfig & | getConfig () |
Returns the global configuration object for the library. | |
Public Attributes | |
std::string | user_agent |
A User-Agent header to include in HTTP client requests. | |
unsigned int | clock_skew_secs |
Adjusts any clock comparisons to be more liberal/permissive by the indicated number of seconds. | |
PluginManager< StorageService, std::string, const xercesc::DOMElement * > | StorageServiceManager |
Manages factories for StorageService plugins. | |
PluginManager < CredentialResolver, std::string, const xercesc::DOMElement * > | CredentialResolverManager |
Manages factories for CredentialResolver plugins. | |
PluginManager< KeyInfoResolver, std::string, const xercesc::DOMElement * > | KeyInfoResolverManager |
Manages factories for KeyInfoResolver plugins. | |
PluginManager< PathValidator, std::string, const xercesc::DOMElement * > | PathValidatorManager |
Manages factories for PathValidator plugins. | |
PluginManager< TrustEngine, std::string, const xercesc::DOMElement * > | TrustEngineManager |
Manages factories for TrustEngine plugins. | |
PluginManager < DataSealerKeyStrategy, std::string, const xercesc::DOMElement * > | DataSealerKeyStrategyManager |
Manages factories for DataSealerKeyStrategy plugins. | |
PluginManager< SOAPTransport, std::string, SOAPTransport::Address > | SOAPTransportManager |
Manages factories for SOAPTransport plugins. | |
Protected Attributes | |
boost::scoped_ptr < KeyInfoResolver > | m_keyInfoResolver |
Global KeyInfoResolver instance. | |
boost::scoped_ptr< ReplayCache > | m_replayCache |
Global ReplayCache instance. | |
boost::scoped_ptr< DataSealer > | m_dataSealer |
boost::scoped_ptr< PathResolver > | m_pathResolver |
Global PathResolver instance. | |
boost::scoped_ptr< TemplateEngine > | m_templateEngine |
Global TemplateEngine instance. | |
boost::scoped_ptr< URLEncoder > | m_urlEncoder |
Global URLEncoder instance for use by URL-related functions. |
Singleton object that manages library startup/shutdown.configuration.
A locking interface is supplied as a convenience for code that wants to obtain a global system lock, but the actual configuration itself is not synchronized.
static XMLToolingConfig& xmltooling::XMLToolingConfig::getConfig | ( | ) | [static] |
Returns the global configuration object for the library.
const DataSealer* xmltooling::XMLToolingConfig::getDataSealer | ( | ) | const |
Returns the global DataSealer instance.
const KeyInfoResolver* xmltooling::XMLToolingConfig::getKeyInfoResolver | ( | ) | const |
Returns the global KeyInfoResolver instance.
virtual Mutex& xmltooling::XMLToolingConfig::getNamedMutex | ( | const char * | name | ) | [pure virtual] |
Returns a reference to a named mutex.
The first access to a given name will create the object.
name | name of mutex to access |
virtual ParserPool& xmltooling::XMLToolingConfig::getParser | ( | ) | const [pure virtual] |
Obtains a non-validating parser pool.
Library must be initialized first.
PathResolver* xmltooling::XMLToolingConfig::getPathResolver | ( | ) | const |
Returns the global PathResolver instance.
ReplayCache* xmltooling::XMLToolingConfig::getReplayCache | ( | ) | const |
Returns the global ReplayCache instance.
TemplateEngine* xmltooling::XMLToolingConfig::getTemplateEngine | ( | ) | const |
Returns the global TemplateEngine instance.
const URLEncoder* xmltooling::XMLToolingConfig::getURLEncoder | ( | ) | const |
Returns the global URLEncoder instance.
virtual ParserPool& xmltooling::XMLToolingConfig::getValidatingParser | ( | ) | const [pure virtual] |
Obtains a validating parser pool.
Library must be initialized first. Schema/catalog registration must be externally synchronized.
virtual bool xmltooling::XMLToolingConfig::init | ( | bool | deprecationSupport = true |
) | [pure virtual] |
Initializes library.
Each process using the library MUST call this function exactly once before using any library classes except for the LogConfig method.
deprecationSupport | true iff plugins should support any deprecated features |
virtual bool xmltooling::XMLToolingConfig::isXMLAlgorithmSupported | ( | const XMLCh * | xmlAlgorithm, | |
XMLSecurityAlgorithmType | type = ALGTYPE_UNK | |||
) | [pure virtual] |
Checks for implementation support of a particular XML Security algorithm.
xmlAlgorithm | XML Signature/Encryption algorithm identifier | |
type | type of algorithm, or ALGTYPE_UNK to ignore |
virtual bool xmltooling::XMLToolingConfig::load_library | ( | const char * | path, | |
void * | context = 0 | |||
) | [pure virtual] |
Loads a shared/dynamic library extension.
Extension libraries are managed using a pair of "C" linkage functions:
extern "C" int xmltooling_extension_init(void* context);
extern "C" void xmltooling_extension_term();
This method is internally synchronized.
path | pathname of shared library to load into process | |
context | arbitrary data to pass to library initialization hook |
virtual bool xmltooling::XMLToolingConfig::log_config | ( | const char * | config = 0 |
) | [pure virtual] |
Configure logging system.
May be called first, before initializing the library. Other calls to it must be externally synchronized.
config | either a logging configuration file, or a level from the set (DEBUG, INFO, NOTICE, WARN, ERROR, CRIT, ALERT, FATAL, EMERG) |
virtual std::pair<const char*,unsigned int> xmltooling::XMLToolingConfig::mapXMLAlgorithmToKeyAlgorithm | ( | const XMLCh * | xmlAlgorithm | ) | const [pure virtual] |
Maps an XML Signature/Encryption algorithm identifier to a library-specific key algorithm and size for use in resolving credentials.
xmlAlgorithm | XML Signature/Encryption algorithm identifier |
virtual void xmltooling::XMLToolingConfig::registerXMLAlgorithm | ( | const XMLCh * | xmlAlgorithm, | |
const char * | keyAlgorithm, | |||
unsigned int | size = 0 , |
|||
XMLSecurityAlgorithmType | type = ALGTYPE_UNK | |||
) | [pure virtual] |
Registers an XML Signature/Encryption algorithm identifier against a library-specific key algorithm and size for use in resolving credentials.
xmlAlgorithm | XML Signature/Encryption algorithm identifier | |
keyAlgorithm | a key algorithm | |
size | a key size (or 0 if the size is irrelevant) | |
type | type of algorithm, if known |
void xmltooling::XMLToolingConfig::setDataSealer | ( | DataSealer * | dataSealer | ) |
Sets the global DataSealer instance.
This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.
dataSealer | new DataSealer instance to store |
void xmltooling::XMLToolingConfig::setKeyInfoResolver | ( | KeyInfoResolver * | keyInfoResolver | ) |
Sets the global KeyInfoResolver instance.
This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.
keyInfoResolver | new KeyInfoResolver instance to store |
void xmltooling::XMLToolingConfig::setPathResolver | ( | PathResolver * | pathResolver | ) |
Sets the global PathResolver instance.
This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.
pathResolver | new PathResolver instance to store |
void xmltooling::XMLToolingConfig::setReplayCache | ( | ReplayCache * | replayCache | ) |
Sets the global ReplayCache instance.
This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.
replayCache | new ReplayCache instance to store |
void xmltooling::XMLToolingConfig::setTemplateEngine | ( | TemplateEngine * | templateEngine | ) |
Sets the global TemplateEngine instance.
This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.
templateEngine | new TemplateEngine instance to store |
void xmltooling::XMLToolingConfig::setURLEncoder | ( | URLEncoder * | urlEncoder | ) |
Sets the global URLEncoder instance.
This method must be externally synchronized with any code that uses the object. Any previously set object is destroyed.
urlEncoder | new URLEncoder instance to store |
virtual void xmltooling::XMLToolingConfig::term | ( | ) | [pure virtual] |
Shuts down library.
Each process using the library SHOULD call this function exactly once before terminating itself
boost::scoped_ptr<KeyInfoResolver> xmltooling::XMLToolingConfig::m_keyInfoResolver [protected] |
Global KeyInfoResolver instance.
boost::scoped_ptr<PathResolver> xmltooling::XMLToolingConfig::m_pathResolver [protected] |
Global PathResolver instance.
boost::scoped_ptr<ReplayCache> xmltooling::XMLToolingConfig::m_replayCache [protected] |
Global ReplayCache instance.
boost::scoped_ptr<TemplateEngine> xmltooling::XMLToolingConfig::m_templateEngine [protected] |
Global TemplateEngine instance.
boost::scoped_ptr<URLEncoder> xmltooling::XMLToolingConfig::m_urlEncoder [protected] |
Global URLEncoder instance for use by URL-related functions.
PluginManager<SOAPTransport,std::string,SOAPTransport::Address> xmltooling::XMLToolingConfig::SOAPTransportManager |
Manages factories for SOAPTransport plugins.
The factory interface takes a peer name/endpoint pair.
std::string xmltooling::XMLToolingConfig::user_agent |
A User-Agent header to include in HTTP client requests.