XML Security Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# keyinfo.h

## Name

keyinfo.h -- The <dsig:KeyInfo> element manipulation functions.

## Synopsis

    xmlSecKeyPtr xmlSecKeyInfoNodeRead          (xmlNodePtr keyInfoNode,
                                                 xmlSecKeysMngrPtr keysMngr,
                                                 void *context,
                                                 xmlSecKeyId keyId,
                                                 xmlSecKeyType keyType,
                                                 xmlSecKeyUsage keyUsage,
                                                 time_t certsVerificationTime);
    int         xmlSecKeyInfoNodeWrite          (xmlNodePtr keyInfoNode,
                                                 xmlSecKeysMngrPtr keysMngr,
                                                 void *context,
                                                 xmlSecKeyPtr key,
                                                 xmlSecKeyType type);
    xmlNodePtr  xmlSecKeyInfoAddKeyName         (xmlNodePtr keyInfoNode);
    xmlNodePtr  xmlSecKeyInfoAddKeyValue        (xmlNodePtr keyInfoNode);
    xmlNodePtr  xmlSecKeyInfoAddX509Data        (xmlNodePtr keyInfoNode);
    xmlNodePtr  xmlSecKeyInfoAddRetrievalMethod (xmlNodePtr keyInfoNode,
                                                 const xmlChar *uri,
                                                 const xmlChar *type);
    xmlNodePtr  xmlSecRetrievalMethodAddTransform
                                                (xmlNodePtr retrMethod,
                                                 xmlSecTransformId transform);
    xmlNodePtr  xmlSecKeyInfoAddEncryptedKey    (xmlNodePtr keyInfoNode,
                                                 const xmlChar *id,
                                                 const xmlChar *type,
                                                 const xmlChar *recipient);

## Description

## Details

### xmlSecKeyInfoNodeRead ()

    xmlSecKeyPtr xmlSecKeyInfoNodeRead          (xmlNodePtr keyInfoNode,
                                                 xmlSecKeysMngrPtr keysMngr,
                                                 void *context,
                                                 xmlSecKeyId keyId,
                                                 xmlSecKeyType keyType,
                                                 xmlSecKeyUsage keyUsage,
                                                 time_t certsVerificationTime);

Parses the <dsig:KeyInfo> element and extracts the key (with required id, type and usage).

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
`keysMngr` : | the pointer to xmlSecKeysMngr struvture.
`context` : | the pointer to application specific data that will be passed to all callback functions.
`keyId` : | the required key id or NULL.
`keyType` : | the required key type (may be "any").
`keyUsage` : | the desired key usage.
`certsVerificationTime` : |
Returns : | the pointer to extracted key or NULL if an error occurs or required key is not found.

### xmlSecKeyInfoNodeWrite ()

    int         xmlSecKeyInfoNodeWrite          (xmlNodePtr keyInfoNode,
                                                 xmlSecKeysMngrPtr keysMngr,
                                                 void *context,
                                                 xmlSecKeyPtr key,
                                                 xmlSecKeyType type);

Writes the key into the <dsig:KeyInfo> template `keyInfoNode`.

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
`keysMngr` : | the pointer to xmlSecKeysMngr struvture.
`context` : | the pointer to application specific data that will be passed to all callback functions.
`key` : | the pointer to the xmlSecKey structure.
`type` : | the key type (public/private).
Returns : | 0 on success or -1 if an error occurs.

### xmlSecKeyInfoAddKeyName ()

    xmlNodePtr  xmlSecKeyInfoAddKeyName         (xmlNodePtr keyInfoNode);

Adds <dsig:KeyName> node to the <dsig:KeyInfo> node `keyInfoNode`.

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
Returns : | the pointer to the newly created <dsig:KeyName> node or NULL if an error occurs.

### xmlSecKeyInfoAddKeyValue ()

    xmlNodePtr  xmlSecKeyInfoAddKeyValue        (xmlNodePtr keyInfoNode);

Adds <dsig:KeyValue> node to the <dsig:KeyInfo> node `keyInfoNode`.

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
Returns : | the pointer to the newly created <dsig:KeyValue> node or NULL if an error occurs.

### xmlSecKeyInfoAddX509Data ()

    xmlNodePtr  xmlSecKeyInfoAddX509Data        (xmlNodePtr keyInfoNode);

Adds <dsig:X509Data> node to the <dsig:KeyInfo> node `keyInfoNode`.

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
Returns : | the pointer to the newly created <dsig:X509Data> node or NULL if an error occurs.

### xmlSecKeyInfoAddRetrievalMethod ()

    xmlNodePtr  xmlSecKeyInfoAddRetrievalMethod (xmlNodePtr keyInfoNode,
                                                 const xmlChar *uri,
                                                 const xmlChar *type);

Adds <dsig:RetrievalMethod> node to the <dsig:KeyInfo> node `keyInfoNode`.

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
`uri` : | the URI attribute (optional).
`type` : | the Type attribute(optional).
Returns : | the pointer to the newly created <dsig:RetrievalMethod> node or NULL if an error occurs.

### xmlSecRetrievalMethodAddTransform ()

    xmlNodePtr  xmlSecRetrievalMethodAddTransform
                                                (xmlNodePtr retrMethod,
                                                 xmlSecTransformId transform);

Adds <dsig:Transform> node (and the parent <dsig:Transforms> node if required) to the <dsig:RetrievalMethod> node `retrMethod`.

`retrMethod` : | the pointer to <dsig:RetrievalMethod> node.
`transform` : | the transform id.
Returns : | the pointer to the newly created <dsig:dsig:Transforms> node or NULL if an error occurs.

### xmlSecKeyInfoAddEncryptedKey ()

    xmlNodePtr  xmlSecKeyInfoAddEncryptedKey    (xmlNodePtr keyInfoNode,
                                                 const xmlChar *id,
                                                 const xmlChar *type,
                                                 const xmlChar *recipient);

Adds <enc:EncryptedKey> node with given attributes to the <dsig:KeyInfo> node `keyInfoNode`.

`keyInfoNode` : | the pointer to <dsig:KeyInfo> node.
`id` : | the Id attribute (optional).
`type` : | the Type attribute (optional).
`recipient` : | the Recipient attribute (optional).
Returns : | the pointer to the newly created <enc:EncryptedKey> node or NULL if an error occurs.

<<< Previous Page | Home | Up | Next Page >>>
debug.h | keys.h