Synopsis
typedef xmlSecKeyUsage;
#define xmlSecKeyUsageSign
#define xmlSecKeyUsageVerify
#define xmlSecKeyUsageEncrypt
#define xmlSecKeyUsageDecrypt
#define xmlSecKeyUsageKeyExchange
#define xmlSecKeyUsageAny
int xmlSecKeyUseWithInitialize (xmlSecKeyUseWithPtr keyUseWith);
void xmlSecKeyUseWithFinalize (xmlSecKeyUseWithPtr keyUseWith);
void xmlSecKeyUseWithReset (xmlSecKeyUseWithPtr keyUseWith);
int xmlSecKeyUseWithCopy (xmlSecKeyUseWithPtr dst,
xmlSecKeyUseWithPtr src);
xmlSecKeyUseWithPtr xmlSecKeyUseWithCreate (const xmlChar *application,
const xmlChar *identifier);
xmlSecKeyUseWithPtr xmlSecKeyUseWithDuplicate (xmlSecKeyUseWithPtr keyUseWith);
void xmlSecKeyUseWithDestroy (xmlSecKeyUseWithPtr keyUseWith);
int xmlSecKeyUseWithSet (xmlSecKeyUseWithPtr keyUseWith,
const xmlChar *application,
const xmlChar *identifier);
void xmlSecKeyUseWithDebugDump (xmlSecKeyUseWithPtr keyUseWith,
FILE *output);
void xmlSecKeyUseWithDebugXmlDump (xmlSecKeyUseWithPtr keyUseWith,
FILE *output);
struct xmlSecKeyUseWith;
#define xmlSecKeyUseWithPtrListId
xmlSecPtrListId xmlSecKeyUseWithPtrListGetKlass (void);
struct xmlSecKeyReq;
int xmlSecKeyReqInitialize (xmlSecKeyReqPtr keyReq);
void xmlSecKeyReqFinalize (xmlSecKeyReqPtr keyReq);
void xmlSecKeyReqReset (xmlSecKeyReqPtr keyReq);
int xmlSecKeyReqCopy (xmlSecKeyReqPtr dst,
xmlSecKeyReqPtr src);
int xmlSecKeyReqMatchKey (xmlSecKeyReqPtr keyReq,
xmlSecKeyPtr key);
int xmlSecKeyReqMatchKeyValue (xmlSecKeyReqPtr keyReq,
xmlSecKeyDataPtr value);
void xmlSecKeyReqDebugDump (xmlSecKeyReqPtr keyReq,
FILE *output);
void xmlSecKeyReqDebugXmlDump (xmlSecKeyReqPtr keyReq,
FILE *output);
struct xmlSecKey;
xmlSecKeyPtr xmlSecKeyCreate (void);
void xmlSecKeyDestroy (xmlSecKeyPtr key);
void xmlSecKeyEmpty (xmlSecKeyPtr key);
xmlSecKeyPtr xmlSecKeyDuplicate (xmlSecKeyPtr key);
int xmlSecKeyCopy (xmlSecKeyPtr keyDst,
xmlSecKeyPtr keySrc);
const xmlChar* xmlSecKeyGetName (xmlSecKeyPtr key);
int xmlSecKeySetName (xmlSecKeyPtr key,
const xmlChar *name);
xmlSecKeyDataType xmlSecKeyGetType (xmlSecKeyPtr key);
xmlSecKeyDataPtr xmlSecKeyGetValue (xmlSecKeyPtr key);
int xmlSecKeySetValue (xmlSecKeyPtr key,
xmlSecKeyDataPtr value);
xmlSecKeyDataPtr xmlSecKeyGetData (xmlSecKeyPtr key,
xmlSecKeyDataId dataId);
xmlSecKeyDataPtr xmlSecKeyEnsureData (xmlSecKeyPtr key,
xmlSecKeyDataId dataId);
int xmlSecKeyAdoptData (xmlSecKeyPtr key,
xmlSecKeyDataPtr data);
void xmlSecKeyDebugDump (xmlSecKeyPtr key,
FILE *output);
void xmlSecKeyDebugXmlDump (xmlSecKeyPtr key,
FILE *output);
xmlSecKeyPtr xmlSecKeyGenerate (xmlSecKeyDataId dataId,
xmlSecSize sizeBits,
xmlSecKeyDataType type);
xmlSecKeyPtr xmlSecKeyGenerateByName (const xmlChar *name,
xmlSecSize sizeBits,
xmlSecKeyDataType type);
int xmlSecKeyMatch (xmlSecKeyPtr key,
const xmlChar *name,
xmlSecKeyReqPtr keyReq);
xmlSecKeyPtr xmlSecKeyReadBuffer (xmlSecKeyDataId dataId,
xmlSecBuffer *buffer);
xmlSecKeyPtr xmlSecKeyReadBinaryFile (xmlSecKeyDataId dataId,
const char *filename);
xmlSecKeyPtr xmlSecKeyReadMemory (xmlSecKeyDataId dataId,
const xmlSecByte *data,
xmlSecSize dataSize);
#define xmlSecKeyIsValid (key)
#define xmlSecKeyCheckId (key, keyId)
#define xmlSecKeyPtrListId
xmlSecPtrListId xmlSecKeyPtrListGetKlass (void);
Details
xmlSecKeyUsage
typedef unsigned int xmlSecKeyUsage;
The key usage.
xmlSecKeyUsageSign
#define xmlSecKeyUsageSign 0x00000001
Key can be used in any way.
xmlSecKeyUsageVerify
#define xmlSecKeyUsageVerify 0x00000002
Key for signing.
xmlSecKeyUsageEncrypt
#define xmlSecKeyUsageEncrypt 0x00000004
Key for signature verification.
xmlSecKeyUsageDecrypt
#define xmlSecKeyUsageDecrypt 0x00000008
An encryption key.
xmlSecKeyUsageKeyExchange
#define xmlSecKeyUsageKeyExchange 0x00000010
The key is used for key exchange.
xmlSecKeyUsageAny
#define xmlSecKeyUsageAny 0xFFFFFFFF
A decryption key.
xmlSecKeyUseWithInitialize ()
int xmlSecKeyUseWithInitialize (xmlSecKeyUseWithPtr keyUseWith);
Initializes keyUseWith object.
keyUseWith : |
the pointer to information about key application/user. |
| Returns : |
0 on success or a negative value if an error occurs. |
xmlSecKeyUseWithFinalize ()
void xmlSecKeyUseWithFinalize (xmlSecKeyUseWithPtr keyUseWith);
Finalizes keyUseWith object.
keyUseWith : |
the pointer to information about key application/user. |
xmlSecKeyUseWithReset ()
void xmlSecKeyUseWithReset (xmlSecKeyUseWithPtr keyUseWith);
Resets the keyUseWith to its state after initialization.
keyUseWith : |
the pointer to information about key application/user. |
xmlSecKeyUseWithCreate ()
xmlSecKeyUseWithPtr xmlSecKeyUseWithCreate (const xmlChar *application,
const xmlChar *identifier);
Creates new xmlSecKeyUseWith object. The caller is responsible for destroying
returned object with xmlSecKeyUseWithDestroy function.
xmlSecKeyUseWithDuplicate ()
xmlSecKeyUseWithPtr xmlSecKeyUseWithDuplicate (xmlSecKeyUseWithPtr keyUseWith);
Duplicates keyUseWith object. The caller is responsible for destroying
returned object with xmlSecKeyUseWithDestroy function.
keyUseWith : |
the pointer to information about key application/user. |
| Returns : |
pointer to newly created object or NULL if an error occurs. |
xmlSecKeyUseWithDestroy ()
void xmlSecKeyUseWithDestroy (xmlSecKeyUseWithPtr keyUseWith);
Destroys keyUseWith created with xmlSecKeyUseWithCreate or xmlSecKeyUseWithDuplicate
functions.
keyUseWith : |
the pointer to information about key application/user. |
xmlSecKeyUseWithSet ()
int xmlSecKeyUseWithSet (xmlSecKeyUseWithPtr keyUseWith,
const xmlChar *application,
const xmlChar *identifier);
Sets application and identifier in the keyUseWith.
xmlSecKeyUseWithDebugDump ()
void xmlSecKeyUseWithDebugDump (xmlSecKeyUseWithPtr keyUseWith,
FILE *output);
Prints xmlSecKeyUseWith debug information to a file output.
keyUseWith : |
the pointer to information about key application/user. |
output : |
the pointer to output FILE. |
xmlSecKeyUseWithDebugXmlDump ()
void xmlSecKeyUseWithDebugXmlDump (xmlSecKeyUseWithPtr keyUseWith,
FILE *output);
Prints xmlSecKeyUseWith debug information to a file output in XML format.
keyUseWith : |
the pointer to information about key application/user. |
output : |
the pointer to output FILE. |
struct xmlSecKeyUseWith
struct xmlSecKeyUseWith {
xmlChar* application;
xmlChar* identifier;
void* reserved1;
void* reserved2;
};
Information about application and user of the key.
xmlSecKeyUseWithPtrListId
#define xmlSecKeyUseWithPtrListId xmlSecKeyUseWithPtrListGetKlass()
The keys list klass.
xmlSecKeyUseWithPtrListGetKlass ()
xmlSecPtrListId xmlSecKeyUseWithPtrListGetKlass (void);
The key data list klass.
| Returns : |
pointer to the key data list klass. |
struct xmlSecKeyReq
struct xmlSecKeyReq {
xmlSecKeyDataId keyId;
xmlSecKeyDataType keyType;
xmlSecKeyUsage keyUsage;
xmlSecSize keyBitsSize;
xmlSecPtrList keyUseWithList;
void* reserved1;
void* reserved2;
};
The key requirements information.
xmlSecKeyReqInitialize ()
int xmlSecKeyReqInitialize (xmlSecKeyReqPtr keyReq);
Initialize key requirements object. Caller is responsible for
cleaning it with xmlSecKeyReqFinalize function.
keyReq : |
the pointer to key requirements object. |
| Returns : |
0 on success or a negative value if an error occurs. |
xmlSecKeyReqReset ()
void xmlSecKeyReqReset (xmlSecKeyReqPtr keyReq);
Resets key requirements object for new key search.
keyReq : |
the pointer to key requirements object. |
xmlSecKeyReqCopy ()
int xmlSecKeyReqCopy (xmlSecKeyReqPtr dst,
xmlSecKeyReqPtr src);
Copies key requirements from src object to dst object.
dst : |
the pointer to destination object. |
src : |
the pointer to source object. |
| Returns : |
0 on success and a negative value if an error occurs. |
xmlSecKeyReqMatchKey ()
int xmlSecKeyReqMatchKey (xmlSecKeyReqPtr keyReq,
xmlSecKeyPtr key);
Checks whether key matches key requirements keyReq.
keyReq : |
the pointer to key requirements object. |
key : |
the pointer to key. |
| Returns : |
1 if key matches requirements, 0 if not and a negative value
if an error occurs. |
xmlSecKeyReqMatchKeyValue ()
int xmlSecKeyReqMatchKeyValue (xmlSecKeyReqPtr keyReq,
xmlSecKeyDataPtr value);
Checks whether keyValue matches key requirements keyReq.
keyReq : |
the pointer to key requirements. |
value : |
the pointer to key value. |
| Returns : |
1 if key value matches requirements, 0 if not and a negative value
if an error occurs. |
xmlSecKeyReqDebugDump ()
void xmlSecKeyReqDebugDump (xmlSecKeyReqPtr keyReq,
FILE *output);
Prints debug information about keyReq into output.
keyReq : |
the pointer to key requirements object. |
output : |
the pointer to output FILE. |
xmlSecKeyReqDebugXmlDump ()
void xmlSecKeyReqDebugXmlDump (xmlSecKeyReqPtr keyReq,
FILE *output);
Prints debug information about keyReq into output in XML format.
keyReq : |
the pointer to key requirements object. |
output : |
the pointer to output FILE. |
struct xmlSecKey
struct xmlSecKey {
xmlChar* name;
xmlSecKeyDataPtr value;
xmlSecPtrListPtr dataList;
xmlSecKeyUsage usage;
time_t notValidBefore;
time_t notValidAfter;
};
The key.
xmlSecKeyCreate ()
xmlSecKeyPtr xmlSecKeyCreate (void);
Allocates and initializes new key. Caller is responsible for
freeing returned object with xmlSecKeyDestroy function.
| Returns : |
the pointer to newly allocated xmlSecKey structure
or NULL if an error occurs. |
xmlSecKeyEmpty ()
void xmlSecKeyEmpty (xmlSecKeyPtr key);
Clears the key data.
key : |
the pointer to key. |
xmlSecKeyDuplicate ()
xmlSecKeyPtr xmlSecKeyDuplicate (xmlSecKeyPtr key);
Creates a duplicate of the given key.
xmlSecKeySetName ()
int xmlSecKeySetName (xmlSecKeyPtr key,
const xmlChar *name);
Sets key name (see also xmlSecKeyGetName function).
key : |
the pointer to key. |
name : |
the new key name. |
| Returns : |
0 on success or a negative value if an error occurs. |
xmlSecKeyGetData ()
xmlSecKeyDataPtr xmlSecKeyGetData (xmlSecKeyPtr key,
xmlSecKeyDataId dataId);
Gets key's data.
xmlSecKeyEnsureData ()
xmlSecKeyDataPtr xmlSecKeyEnsureData (xmlSecKeyPtr key,
xmlSecKeyDataId dataId);
If necessary, creates key data of dataId klass and adds to key.
key : |
the pointer to key. |
dataId : |
the requested data klass. |
| Returns : |
pointer to key data or NULL if an error occurs. |