|
keysmngr
Synopsis
xmlSecKeysMngrPtr xmlSecKeysMngrCreate (void);
void xmlSecKeysMngrDestroy (xmlSecKeysMngrPtr mngr);
xmlSecKeyPtr xmlSecKeysMngrFindKey (xmlSecKeysMngrPtr mngr,
const xmlChar *name,
xmlSecKeyInfoCtxPtr keyInfoCtx);
int xmlSecKeysMngrAdoptKeysStore (xmlSecKeysMngrPtr mngr,
xmlSecKeyStorePtr store);
xmlSecKeyStorePtr xmlSecKeysMngrGetKeysStore
(xmlSecKeysMngrPtr mngr);
int xmlSecKeysMngrAdoptDataStore (xmlSecKeysMngrPtr mngr,
xmlSecKeyDataStorePtr store);
xmlSecKeyDataStorePtr xmlSecKeysMngrGetDataStore
(xmlSecKeysMngrPtr mngr,
xmlSecKeyDataStoreId id);
xmlSecKeyPtr (*xmlSecGetKeyCallback) (xmlNodePtr keyInfoNode,
xmlSecKeyInfoCtxPtr keyInfoCtx);
struct xmlSecKeysMngr;
xmlSecKeyPtr xmlSecKeysMngrGetKey (xmlNodePtr keyInfoNode,
xmlSecKeyInfoCtxPtr keyInfoCtx);
struct xmlSecKeyStore;
xmlSecKeyStorePtr xmlSecKeyStoreCreate (xmlSecKeyStoreId id);
void xmlSecKeyStoreDestroy (xmlSecKeyStorePtr store);
xmlSecKeyPtr xmlSecKeyStoreFindKey (xmlSecKeyStorePtr store,
const xmlChar *name,
xmlSecKeyInfoCtxPtr keyInfoCtx);
#define xmlSecKeyStoreGetName (store)
#define xmlSecKeyStoreIsValid (store)
#define xmlSecKeyStoreCheckId (store, storeId)
#define xmlSecKeyStoreCheckSize (store, size)
#define xmlSecKeyStoreIdUnknown
int (*xmlSecKeyStoreInitializeMethod)
(xmlSecKeyStorePtr store);
void (*xmlSecKeyStoreFinalizeMethod) (xmlSecKeyStorePtr store);
xmlSecKeyPtr (*xmlSecKeyStoreFindKeyMethod) (xmlSecKeyStorePtr store,
const xmlChar *name,
xmlSecKeyInfoCtxPtr keyInfoCtx);
struct xmlSecKeyStoreKlass;
#define xmlSecKeyStoreKlassGetName (klass)
#define xmlSecSimpleKeysStoreId
xmlSecKeyStoreId xmlSecSimpleKeysStoreGetKlass
(void);
int xmlSecSimpleKeysStoreAdoptKey (xmlSecKeyStorePtr store,
xmlSecKeyPtr key);
int xmlSecSimpleKeysStoreLoad (xmlSecKeyStorePtr store,
const char *uri,
xmlSecKeysMngrPtr keysMngr);
int xmlSecSimpleKeysStoreSave (xmlSecKeyStorePtr store,
const char *filename,
xmlSecKeyDataType type); |
Details
xmlSecKeysMngrCreate ()
Creates new keys manager. Caller is responsible for freeing it with
xmlSecKeysMngrDestroy function.
Returns : |
the pointer to newly allocated keys manager or NULL if
an error occurs. |
xmlSecKeysMngrFindKey ()
Lookups key in the keys manager keys store. The caller is responsible
for destroying the returned key using xmlSecKeyDestroy method.
xmlSecKeysMngrAdoptKeysStore ()
Adopts keys store in the keys manager mngr.
mngr : |
the pointer to keys manager. |
store : |
the pointer to keys store. |
Returns : |
0 on success or a negative value if an error occurs. |
xmlSecKeysMngrGetKeysStore ()
Gets the keys store.
mngr : |
the pointer to keys manager. |
Returns : |
the keys store in the keys manager mngr or NULL if
there is no store or an error occurs. |
xmlSecKeysMngrAdoptDataStore ()
Adopts data store in the keys manager.
mngr : |
the pointer to keys manager. |
store : |
the pointer to data store. |
Returns : |
0 on success or a negative value if an error occurs. |
xmlSecKeysMngrGetDataStore ()
Lookups the data store of given klass id in the keys manager.
mngr : |
the pointer to keys manager. |
id : |
the desired data store klass. |
Returns : |
pointer to data store or NULL if it is not found or an error
occurs. |
xmlSecGetKeyCallback ()
Reads the <dsig:KeyInfo/> node keyInfoNode and extracts the key.
struct xmlSecKeysMngr
struct xmlSecKeysMngr {
xmlSecKeyStorePtr keysStore;
xmlSecPtrList storesList;
xmlSecGetKeyCallback getKey;
}; |
The keys manager structure.
xmlSecKeysMngrGetKey ()
Reads the <dsig:KeyInfo/> node keyInfoNode and extracts the key.
struct xmlSecKeyStore
struct xmlSecKeyStore {
xmlSecKeyStoreId id;
/* for the future */
void* reserved0;
void* reserved1;
}; |
The keys store.
xmlSecKeyStoreCreate ()
Creates new store of the specified klass klass. Caller is responsible
for freeing the returned store by calling xmlSecKeyStoreDestroy function.
id : |
the key store klass. |
Returns : |
the pointer to newly allocated keys store or NULL if an error occurs. |
xmlSecKeyStoreFindKey ()
Lookups key in the store. The caller is responsible for destroying
the returned key using xmlSecKeyDestroy method.
xmlSecKeyStoreGetName()
#define xmlSecKeyStoreGetName(store) |
Macro. Returns key store name.
xmlSecKeyStoreIsValid()
#define xmlSecKeyStoreIsValid(store) |
Macro. Returns 1 if store is not NULL and store->id is not NULL
or 0 otherwise.
xmlSecKeyStoreCheckId()
#define xmlSecKeyStoreCheckId(store, storeId) |
Macro. Returns 1 if store is valid and store's id is equal to storeId.
xmlSecKeyStoreCheckSize()
#define xmlSecKeyStoreCheckSize(store, size) |
Macro. Returns 1 if store is valid and stores's object has at least size bytes.
xmlSecKeyStoreIdUnknown
#define xmlSecKeyStoreIdUnknown ((xmlSecKeyDataStoreId)NULL) |
The "unknown" id.
xmlSecKeyStoreInitializeMethod ()
Keys store specific initialization method.
store : |
the store. |
Returns : |
0 on success or a negative value if an error occurs. |
xmlSecKeyStoreFinalizeMethod ()
Keys store specific finalization (destroy) method.
xmlSecKeyStoreFindKeyMethod ()
Keys store specific find method. The caller is responsible for destroying
the returned key using xmlSecKeyDestroy method.
store : |
the store. |
name : |
the desired key name. |
keyInfoCtx : |
the pointer to key info context. |
Returns : |
the pointer to a key or NULL if key is not found or an error occurs. |
struct xmlSecKeyStoreKlass
struct xmlSecKeyStoreKlass {
xmlSecSize klassSize;
xmlSecSize objSize;
/* data */
const xmlChar* name;
/* constructors/destructor */
xmlSecKeyStoreInitializeMethod initialize;
xmlSecKeyStoreFinalizeMethod finalize;
xmlSecKeyStoreFindKeyMethod findKey;
/* for the future */
void* reserved0;
void* reserved1;
}; |
The keys store id (klass).
xmlSecKeyStoreKlassGetName()
#define xmlSecKeyStoreKlassGetName(klass) |
Macro. Returns store klass name.
klass : |
the pointer to store klass. |
xmlSecSimpleKeysStoreId
#define xmlSecSimpleKeysStoreId xmlSecSimpleKeysStoreGetKlass() |
A simple keys store klass id.
xmlSecSimpleKeysStoreGetKlass ()
xmlSecKeyStoreId xmlSecSimpleKeysStoreGetKlass
(void); |
The simple list based keys store klass.
Returns : |
simple list based keys store klass. |
xmlSecSimpleKeysStoreAdoptKey ()
Adds key to the store.
store : |
the pointer to simple keys store. |
key : |
the pointer to key. |
Returns : |
0 on success or a negative value if an error occurs. |
xmlSecSimpleKeysStoreLoad ()
Reads keys from an XML file.
store : |
the pointer to simple keys store. |
uri : |
the filename. |
keysMngr : |
the pointer to associated keys manager. |
Returns : |
0 on success or a negative value if an error occurs. |
xmlSecSimpleKeysStoreSave ()
Writes keys from store to an XML file.
store : |
the pointer to simple keys store. |
filename : |
the filename. |
type : |
the saved keys type (public, private, ...). |
Returns : |
0 on success or a negative value if an error occurs. |
|
Aleksey Sanin
|
|