XML Security Library

LibXML2
LibXSLT
OpenSSL

keys

Name

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              (const xmlChar *klass,
                                             const xmlChar *name,
                                             size_t sizeBits,
                                             xmlSecKeyDataType type);
int         xmlSecKeyMatch                  (xmlSecKeyPtr key,
                                             const xmlChar *name,
                                             xmlSecKeyReqPtr keyReq);
#define     xmlSecKeyIsValid                (key)
#define     xmlSecKeyCheckId                (key, keyId)
#define     xmlSecKeyPtrListId
xmlSecPtrListId xmlSecKeyPtrListGetKlass    (void);

Description

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.

xmlSecKeyDataId keyId the desired key value klass.
xmlSecKeyDataType keyType the desired key type.
xmlSecKeyUsage keyUsage the desired key usage.
size_t keyBitsSize the desired key size (in bits!).


xmlSecKeyReqInitialize ()

int         xmlSecKeyReqInitialize          (xmlSecKeyReqPtr keyReq);

keyReq :  
Returns :  


xmlSecKeyReqFinalize ()

void        xmlSecKeyReqFinalize            (xmlSecKeyReqPtr keyReq);

keyReq :  


xmlSecKeyReqReset ()

void        xmlSecKeyReqReset               (xmlSecKeyReqPtr keyReq);

keyReq :  


xmlSecKeyReqCopy ()

int         xmlSecKeyReqCopy                (xmlSecKeyReqPtr dst,
                                             xmlSecKeyReqPtr src);

dst :  
src :  
Returns :  


xmlSecKeyReqMatchKey ()

int         xmlSecKeyReqMatchKey            (xmlSecKeyReqPtr keyReq,
                                             xmlSecKeyPtr key);

keyReq :  
key :  
Returns :  


xmlSecKeyReqMatchKeyValue ()

int         xmlSecKeyReqMatchKeyValue       (xmlSecKeyReqPtr keyReq,
                                             xmlSecKeyDataPtr value);

keyReq :  
value :  
Returns :  


struct xmlSecKey

struct xmlSecKey {
    xmlChar*				name;
    xmlSecKeyDataPtr			value;
    xmlSecPtrListPtr			dataList;
    xmlSecKeyUsage			usage;
    
    /* for the future */
    void*				reserved0;
    void*				reserved1;
};

The key.

xmlChar *name the key name.
xmlSecKeyDataPtr value the key value.
xmlSecPtrListPtr dataList the key data list.
xmlSecKeyUsage usage the key usage.
void *reserved0 reserved for future.
void *reserved1 reserved for future.


xmlSecKeyCreate ()

xmlSecKeyPtr xmlSecKeyCreate                (void);

Creates new key of the specified type id.

Returns : the pointer to newly allocated xmlSecKey structure or NULL if an error occurs.


xmlSecKeyDestroy ()

void        xmlSecKeyDestroy                (xmlSecKeyPtr key);

Destroys the key and frees all allocated memory.

key : the pointer to the xmlSecKey structure.


xmlSecKeyEmpty ()

void        xmlSecKeyEmpty                  (xmlSecKeyPtr key);

key :  


xmlSecKeyDuplicate ()

xmlSecKeyPtr xmlSecKeyDuplicate             (xmlSecKeyPtr key);

Creates a duplicate of the given key.

key : the pointer to the xmlSecKey structure.
Returns : the pointer to newly allocated xmlSecKey structure or NULL if an error occurs.


xmlSecKeyCopy ()

int         xmlSecKeyCopy                   (xmlSecKeyPtr keyDst,
                                             xmlSecKeyPtr keySrc);

keyDst :  
keySrc :  
Returns :  


xmlSecKeyGetName ()

const xmlChar* xmlSecKeyGetName             (xmlSecKeyPtr key);

key :  
Returns :  


xmlSecKeySetName ()

int         xmlSecKeySetName                (xmlSecKeyPtr key,
                                             const xmlChar *name);

key :  
name :  
Returns :  


xmlSecKeyGetType ()

xmlSecKeyDataType xmlSecKeyGetType          (xmlSecKeyPtr key);

key :  
Returns :  


xmlSecKeyGetValue ()

xmlSecKeyDataPtr xmlSecKeyGetValue          (xmlSecKeyPtr key);

key :  
Returns :  


xmlSecKeySetValue ()

int         xmlSecKeySetValue               (xmlSecKeyPtr key,
                                             xmlSecKeyDataPtr value);

key :  
value :  
Returns :  


xmlSecKeyGetData ()

xmlSecKeyDataPtr xmlSecKeyGetData           (xmlSecKeyPtr key,
                                             xmlSecKeyDataId dataId);

key :  
dataId :  
Returns :  


xmlSecKeyEnsureData ()

xmlSecKeyDataPtr xmlSecKeyEnsureData        (xmlSecKeyPtr key,
                                             xmlSecKeyDataId dataId);

key :  
dataId :  
Returns :  


xmlSecKeyAdoptData ()

int         xmlSecKeyAdoptData              (xmlSecKeyPtr key,
                                             xmlSecKeyDataPtr data);

key :  
data :  
Returns :  


xmlSecKeyDebugDump ()

void        xmlSecKeyDebugDump              (xmlSecKeyPtr key,
                                             FILE *output);

Prints the information about the key to the output.

key : the pointer to the xmlSecKey structure.
output : the destination FILE pointer.


xmlSecKeyDebugXmlDump ()

void        xmlSecKeyDebugXmlDump           (xmlSecKeyPtr key,
                                             FILE *output);

Prints the information about the key to the output in XML format.

key : the pointer to the xmlSecKey structure.
output : the destination FILE pointer.


xmlSecKeyGenerate ()

xmlSecKeyPtr xmlSecKeyGenerate              (const xmlChar *klass,
                                             const xmlChar *name,
                                             size_t sizeBits,
                                             xmlSecKeyDataType type);

klass :  
name :  
sizeBits :  
type :  
Returns :  


xmlSecKeyMatch ()

int         xmlSecKeyMatch                  (xmlSecKeyPtr key,
                                             const xmlChar *name,
                                             xmlSecKeyReqPtr keyReq);

Checks whether the key matches the given criteria (key name is equal to name, key id is equal to id, key type is type).

key : the pointer to the xmlSecKey structure.
name : the pointer to key name (may be NULL).
keyReq :  
Returns : 1 if the key satisfies the given criteria or 0 otherwise.


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.

key : the pointer to key.
keyId : the key Id.


xmlSecKeyPtrListId

#define xmlSecKeyPtrListId	xmlSecKeyPtrListGetKlass()

The keys list klass.


xmlSecKeyPtrListGetKlass ()

xmlSecPtrListId xmlSecKeyPtrListGetKlass    (void);

Returns :  



Aleksey Sanin