|
keys
Synopsis
typedef xmlSecKeyUsage;
#define xmlSecKeyUsageSign
#define xmlSecKeyUsageVerify
#define xmlSecKeyUsageEncrypt
#define xmlSecKeyUsageDecrypt
#define xmlSecKeyUsageAny
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);
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,
size_t sizeBits,
xmlSecKeyDataType type);
xmlSecKeyPtr xmlSecKeyGenerateByName (const xmlChar *name,
size_t sizeBits,
xmlSecKeyDataType type);
int xmlSecKeyMatch (xmlSecKeyPtr key,
const xmlChar *name,
xmlSecKeyReqPtr keyReq);
xmlSecKeyPtr xmlSecKeyReadBinaryFile (xmlSecKeyDataId dataId,
const char *filename);
#define xmlSecKeyIsValid (key)
#define xmlSecKeyCheckId (key, keyId)
#define xmlSecKeyPtrListId
xmlSecPtrListId xmlSecKeyPtrListGetKlass (void); |
Details
xmlSecKeyUsage
typedef unsigned int xmlSecKeyUsage; |
The key usage.
xmlSecKeyUsageSign
#define xmlSecKeyUsageSign 0x0001 |
Key can be used in any way.
xmlSecKeyUsageVerify
#define xmlSecKeyUsageVerify 0x0002 |
Key for signing.
xmlSecKeyUsageEncrypt
#define xmlSecKeyUsageEncrypt 0x0004 |
Key for signature verification.
xmlSecKeyUsageDecrypt
#define xmlSecKeyUsageDecrypt 0x0008 |
An encryption key.
xmlSecKeyUsageAny
#define xmlSecKeyUsageAny 0xFFFF |
A decryption key.
struct xmlSecKeyReq
struct xmlSecKeyReq {
xmlSecKeyDataId keyId;
xmlSecKeyDataType keyType;
xmlSecKeyUsage keyUsage;
size_t keyBitsSize;
}; |
The key requirements information.
xmlSecKeyReqInitialize ()
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. |
xmlSecKeyReqFinalize ()
Cleans the key requirements object initialized with xmlSecKeyReqInitialize
function.
keyReq : |
the pointer to key requirements object. |
xmlSecKeyReqReset ()
Resets key requirements object for new key search.
keyReq : |
the pointer to key requirements object. |
xmlSecKeyReqCopy ()
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 ()
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 ()
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. |
struct xmlSecKey
struct xmlSecKey {
xmlChar* name;
xmlSecKeyDataPtr value;
xmlSecPtrListPtr dataList;
xmlSecKeyUsage usage;
/* for the future */
void* reserved0;
void* reserved1;
}; |
The key.
xmlSecKeyCreate ()
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. |
xmlSecKeyDestroy ()
Destroys the key created using xmlSecKeyCreate function.
key : |
the pointer to key. |
xmlSecKeyEmpty ()
Clears the key data.
key : |
the pointer to key. |
xmlSecKeyDuplicate ()
Creates a duplicate of the given key.
xmlSecKeyCopy ()
Copies key data from keySrc to keyDst.
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. |
xmlSecKeyGetType ()
Gets key type.
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. |
xmlSecKeyAdoptData ()
Adds data to the key. The data object will be destroyed
by key.
key : |
the pointer to key. |
data : |
the pointer to key data. |
Returns : |
0 on success or a negative value otherwise. |
xmlSecKeyDebugDump ()
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 ()
Generates new key of requested klass dataId and type.
dataId : |
the requested key klass (rsa, dsa, aes, ...). |
sizeBits : |
the new key size (in bits!). |
type : |
the new key type (session, permanent, ...). |
Returns : |
pointer to newly created key or NULL if an error occurs. |
xmlSecKeyGenerateByName ()
Generates new key of requested klass and type.
name : |
the requested key klass name (rsa, dsa, aes, ...). |
sizeBits : |
the new key size (in bits!). |
type : |
the new key type (session, permanent, ...). |
Returns : |
pointer to newly created key or NULL if an error occurs. |
xmlSecKeyMatch ()
Checks whether the key matches the given criteria.
key : |
the pointer to key. |
name : |
the pointer to key name (may be NULL). |
keyReq : |
the pointer to key requirements. |
Returns : |
1 if the key satisfies the given criteria or 0 otherwise. |
xmlSecKeyReadBinaryFile ()
xmlSecKeyPtr xmlSecKeyReadBinaryFile (xmlSecKeyDataId dataId,
const char *filename); |
Reads the key value of klass dataId from a binary file filename.
dataId : |
the key value data klass. |
filename : |
the key binary filename. |
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.
key : |
the pointer to key. |
xmlSecKeyCheckId()
#define xmlSecKeyCheckId(key, keyId) |
Macro. Returns 1 if key is valid and key's id is equal to keyId.
xmlSecKeyPtrListId
#define xmlSecKeyPtrListId xmlSecKeyPtrListGetKlass() |
The keys list klass.
xmlSecKeyPtrListGetKlass ()
xmlSecPtrListId xmlSecKeyPtrListGetKlass (void); |
The keys list klass.
|
Aleksey Sanin
|
|