Functions
xmlSecKeyUseWithInitialize ()
int
xmlSecKeyUseWithInitialize (xmlSecKeyUseWithPtr keyUseWith
);
Initializes keyUseWith
object.
Returns
0 on success or a negative value if an error occurs.
xmlSecKeyUseWithFinalize ()
void
xmlSecKeyUseWithFinalize (xmlSecKeyUseWithPtr keyUseWith
);
Finalizes keyUseWith
object.
xmlSecKeyUseWithReset ()
void
xmlSecKeyUseWithReset (xmlSecKeyUseWithPtr keyUseWith
);
Resets the keyUseWith
to its state after initialization.
xmlSecKeyUseWithCopy ()
int
xmlSecKeyUseWithCopy (xmlSecKeyUseWithPtr dst
,
xmlSecKeyUseWithPtr src
);
Copies information from dst
to src
.
Returns
0 on success or a negative value if an error occurs.
xmlSecKeyUseWithCreate ()
xmlSecKeyUseWithPtr
xmlSecKeyUseWithCreate (const xmlChar *application
,
const xmlChar *identifier
);
Creates new xmlSecKeyUseWith object. The caller is responsible for destroying
returned object with xmlSecKeyUseWithDestroy
function.
Returns
pointer to newly created object or NULL if an error occurs.
xmlSecKeyUseWithDuplicate ()
xmlSecKeyUseWithPtr
xmlSecKeyUseWithDuplicate (xmlSecKeyUseWithPtr keyUseWith
);
Duplicates keyUseWith
object. The caller is responsible for destroying
returned object with xmlSecKeyUseWithDestroy
function.
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.
xmlSecKeyUseWithSet ()
int
xmlSecKeyUseWithSet (xmlSecKeyUseWithPtr keyUseWith
,
const xmlChar *application
,
const xmlChar *identifier
);
Sets application
and identifier
in the keyUseWith
.
Returns
0 on success or a negative value if an error occurs.
xmlSecKeyUseWithDebugDump ()
void
xmlSecKeyUseWithDebugDump (xmlSecKeyUseWithPtr keyUseWith
,
FILE *output
);
Prints xmlSecKeyUseWith debug information to a file output
.
xmlSecKeyUseWithDebugXmlDump ()
void
xmlSecKeyUseWithDebugXmlDump (xmlSecKeyUseWithPtr keyUseWith
,
FILE *output
);
Prints xmlSecKeyUseWith debug information to a file output
in XML format.
xmlSecKeyUseWithPtrListGetKlass ()
xmlSecPtrListId
xmlSecKeyUseWithPtrListGetKlass (void
);
The key data list klass.
Returns
pointer to the key data list klass.
xmlSecKeyReqInitialize ()
int
xmlSecKeyReqInitialize (xmlSecKeyReqPtr keyReq
);
Initialize key requirements object. Caller is responsible for
cleaning it with xmlSecKeyReqFinalize function.
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.
xmlSecKeyReqCopy ()
int
xmlSecKeyReqCopy (xmlSecKeyReqPtr dst
,
xmlSecKeyReqPtr src
);
Copies key requirements from src
object to dst
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
.
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
.
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
.
xmlSecKeyReqDebugXmlDump ()
void
xmlSecKeyReqDebugXmlDump (xmlSecKeyReqPtr keyReq
,
FILE *output
);
Prints debug information about keyReq
into output
in XML format.
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.
xmlSecKeyDuplicate ()
xmlSecKeyPtr
xmlSecKeyDuplicate (xmlSecKeyPtr key
);
Creates a duplicate of the given key
.
Returns
the pointer to newly allocated xmlSecKey structure
or NULL if an error occurs.
xmlSecKeyCopy ()
int
xmlSecKeyCopy (xmlSecKeyPtr keyDst
,
xmlSecKeyPtr keySrc
);
Copies key data from keySrc
to keyDst
.
Returns
0 on success or a negative value if an error occurs.
xmlSecKeySetName ()
int
xmlSecKeySetName (xmlSecKeyPtr key
,
const xmlChar *name
);
Sets key name (see also xmlSecKeyGetName function).
Returns
0 on success or a negative value if an error occurs.
xmlSecKeyEnsureData ()
xmlSecKeyDataPtr
xmlSecKeyEnsureData (xmlSecKeyPtr key
,
xmlSecKeyDataId dataId
);
If necessary, creates key data of dataId
klass and adds to key
.
Returns
pointer to key data or NULL if an error occurs.
xmlSecKeyAdoptData ()
int
xmlSecKeyAdoptData (xmlSecKeyPtr key
,
xmlSecKeyDataPtr data
);
Adds data
to the key
. The data
object will be destroyed
by key
.
Returns
0 on success or a negative value otherwise.
xmlSecKeyDebugDump ()
void
xmlSecKeyDebugDump (xmlSecKeyPtr key
,
FILE *output
);
Prints the information about the key
to the output
.
xmlSecKeyDebugXmlDump ()
void
xmlSecKeyDebugXmlDump (xmlSecKeyPtr key
,
FILE *output
);
Prints the information about the key
to the output
in XML format.
xmlSecKeyGenerate ()
xmlSecKeyPtr
xmlSecKeyGenerate (xmlSecKeyDataId dataId
,
xmlSecSize sizeBits
,
xmlSecKeyDataType type
);
Generates new key of requested klass dataId
and type
.
Returns
pointer to newly created key or NULL if an error occurs.
xmlSecKeyGenerateByName ()
xmlSecKeyPtr
xmlSecKeyGenerateByName (const xmlChar *name
,
xmlSecSize sizeBits
,
xmlSecKeyDataType type
);
Generates new key of requested klass
and type
.
Returns
pointer to newly created key or NULL if an error occurs.
xmlSecKeyMatch ()
int
xmlSecKeyMatch (xmlSecKeyPtr key
,
const xmlChar *name
,
xmlSecKeyReqPtr keyReq
);
Checks whether the key
matches the given criteria.
Returns
1 if the key satisfies the given criteria or 0 otherwise.
xmlSecKeyReadBuffer ()
xmlSecKeyPtr
xmlSecKeyReadBuffer (xmlSecKeyDataId dataId
,
xmlSecBuffer *buffer
);
Reads the key value of klass dataId
from a buffer.
Returns
pointer to newly created key or NULL if an error occurs.
xmlSecKeyReadBinaryFile ()
xmlSecKeyPtr
xmlSecKeyReadBinaryFile (xmlSecKeyDataId dataId
,
const char *filename
);
Reads the key value of klass dataId
from a binary file filename
.
Returns
pointer to newly created key or NULL if an error occurs.
xmlSecKeyReadMemory ()
xmlSecKeyPtr
xmlSecKeyReadMemory (xmlSecKeyDataId dataId
,
const xmlSecByte *data
,
xmlSecSize dataSize
);
Reads the key value of klass dataId
from a memory block data
.
Returns
pointer to newly created key or NULL if an error occurs.
xmlSecKeyIsValid()
#define xmlSecKeyIsValid(key)
Macro. Returns 1 if key
is not NULL and key->id
is not NULL
or 0 otherwise.
xmlSecKeyCheckId()
#define xmlSecKeyCheckId(key, keyId)
Macro. Returns 1 if key
is valid and key
's id is equal to keyId
.
xmlSecKeyPtrListGetKlass ()
xmlSecPtrListId
xmlSecKeyPtrListGetKlass (void
);
The keys list klass.
Types and Values
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.
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.
struct xmlSecKeyReq
struct xmlSecKeyReq {
xmlSecKeyDataId keyId;
xmlSecKeyDataType keyType;
xmlSecKeyUsage keyUsage;
xmlSecSize keyBitsSize;
xmlSecPtrList keyUseWithList;
void* reserved1;
void* reserved2;
};
The key requirements information.
struct xmlSecKey
struct xmlSecKey {
xmlChar* name;
xmlSecKeyDataPtr value;
xmlSecPtrListPtr dataList;
xmlSecKeyUsage usage;
time_t notValidBefore;
time_t notValidAfter;
};
The key.
xmlSecKeyPtrListId
#define xmlSecKeyPtrListId xmlSecKeyPtrListGetKlass()
The keys list klass.