xmlenc.h

Name

xmlenc.h -- The XML Encrypiton standard implementation.

Synopsis



struct      xmlSecEncCtx;
xmlSecEncCtxPtr xmlSecEncCtxCreate          (xmlSecKeysMngrPtr keysMngr);
void        xmlSecEncCtxDestroy             (xmlSecEncCtxPtr ctx);
int         xmlSecEncryptMemory             (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             unsigned char *buf,
                                             size_t size,
                                             xmlSecEncResultPtr *result);
int         xmlSecEncryptUri                (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             const char *uri,
                                             xmlSecEncResultPtr *result);
int         xmlSecEncryptXmlNode            (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             xmlNodePtr src,
                                             xmlSecEncResultPtr *result);
int         xmlSecDecrypt                   (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             xmlSecEncResultPtr *result);
struct      xmlSecEncResult;
xmlSecEncResultPtr xmlSecEncResultCreate    (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             int encrypt,
                                             xmlNodePtr node);
void        xmlSecEncResultDestroy          (xmlSecEncResultPtr result);
void        xmlSecEncResultDebugDump        (xmlSecEncResultPtr result,
                                             FILE *output);
xmlNodePtr  xmlSecEncDataCreate             (const xmlChar *id,
                                             const xmlChar *type,
                                             const xmlChar *mimeType,
                                             const xmlChar *encoding);
void        xmlSecEncDataDestroy            (xmlNodePtr encNode);
xmlNodePtr  xmlSecEncDataAddEncMethod       (xmlNodePtr encNode,
                                             xmlSecTransformId encMethod);
xmlNodePtr  xmlSecEncDataAddKeyInfo         (xmlNodePtr encNode);
xmlNodePtr  xmlSecEncDataAddEncProperties   (xmlNodePtr encNode,
                                             const xmlChar *id);
xmlNodePtr  xmlSecEncDataAddEncProperty     (xmlNodePtr encNode,
                                             const xmlChar *id,
                                             const xmlChar *target);
xmlNodePtr  xmlSecEncDataAddCipherValue     (xmlNodePtr encNode);
xmlNodePtr  xmlSecEncDataAddCipherReference (xmlNodePtr encNode,
                                             const xmlChar *uri);
xmlNodePtr  xmlSecCipherReferenceAddTransform
                                            (xmlNodePtr encNode,
                                             xmlSecTransformId transform);

Description

Details

struct xmlSecEncCtx

struct xmlSecEncCtx {
    xmlSecKeysMngrPtr		keysMngr;
    xmlSecTransformId		encryptionMethod;
    int				ignoreType;
};

XML Encrypiton context.


xmlSecEncCtxCreate ()

xmlSecEncCtxPtr xmlSecEncCtxCreate          (xmlSecKeysMngrPtr keysMngr);

Creates new encryption context.


xmlSecEncCtxDestroy ()

void        xmlSecEncCtxDestroy             (xmlSecEncCtxPtr ctx);

Destroys the xmlSecEncCtx structure.


xmlSecEncryptMemory ()

int         xmlSecEncryptMemory             (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             unsigned char *buf,
                                             size_t size,
                                             xmlSecEncResultPtr *result);

Encrypts binary data from the buf according to the template in the <enc:EncryptionData> node. After the encrytion the result XML is in the encNode node.


xmlSecEncryptUri ()

int         xmlSecEncryptUri                (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             const char *uri,
                                             xmlSecEncResultPtr *result);

Encrypts binary data from the uri according to the template in the <enc:EncryptionData> node. After the encrytion the result XML is in the encNode node.


xmlSecEncryptXmlNode ()

int         xmlSecEncryptXmlNode            (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             xmlNodePtr src,
                                             xmlSecEncResultPtr *result);

Encrypts XML data from the encNode according to the template in the <enc:EncryptionData> node. After the encrytion the result XML is in the src node.


xmlSecDecrypt ()

int         xmlSecDecrypt                   (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             xmlSecKeyPtr key,
                                             xmlNodePtr encNode,
                                             xmlSecEncResultPtr *result);

Decrypts data from the <enc:EncryptionData> node.


struct xmlSecEncResult

struct xmlSecEncResult {
    xmlSecEncCtxPtr		ctx;
    void			*context;
    xmlNodePtr			self;
    int				encrypt;
    xmlChar			*id;
    xmlChar			*type;
    xmlChar			*mimeType;
    xmlChar			*encoding;
    xmlSecTransformId		encryptionMethod;
    xmlSecKeyPtr		key;
    xmlBufferPtr		buffer;
    int				replaced;
};

The XML Encrypiton results.


xmlSecEncResultCreate ()

xmlSecEncResultPtr xmlSecEncResultCreate    (xmlSecEncCtxPtr ctx,
                                             void *context,
                                             int encrypt,
                                             xmlNodePtr node);

Creates new xmlSecEncResult structure.


xmlSecEncResultDestroy ()

void        xmlSecEncResultDestroy          (xmlSecEncResultPtr result);

Destroys xmlSecEncResult structure result.


xmlSecEncResultDebugDump ()

void        xmlSecEncResultDebugDump        (xmlSecEncResultPtr result,
                                             FILE *output);

Prints the xmlSecEncResult structure result to file output.


xmlSecEncDataCreate ()

xmlNodePtr  xmlSecEncDataCreate             (const xmlChar *id,
                                             const xmlChar *type,
                                             const xmlChar *mimeType,
                                             const xmlChar *encoding);

Creates new <enc:EncryptedData> node for encryption template.


xmlSecEncDataDestroy ()

void        xmlSecEncDataDestroy            (xmlNodePtr encNode);

Destroys the <enc:EncryptedData> node encNode.


xmlSecEncDataAddEncMethod ()

xmlNodePtr  xmlSecEncDataAddEncMethod       (xmlNodePtr encNode,
                                             xmlSecTransformId encMethod);

Adds <enc:EncryptionMethod> node with specified encryption algorithm (encMethodId) to the <enc:EncryptedData> node encNode.


xmlSecEncDataAddKeyInfo ()

xmlNodePtr  xmlSecEncDataAddKeyInfo         (xmlNodePtr encNode);

Adds <dsig:KeyInfo> to the <enc:EncryptedData> node encNode.


xmlSecEncDataAddEncProperties ()

xmlNodePtr  xmlSecEncDataAddEncProperties   (xmlNodePtr encNode,
                                             const xmlChar *id);

Adds <enc:EncryptionProperties> node to the <enc:EncryptedData> node encNode.


xmlSecEncDataAddEncProperty ()

xmlNodePtr  xmlSecEncDataAddEncProperty     (xmlNodePtr encNode,
                                             const xmlChar *id,
                                             const xmlChar *target);

Adds <enc:EncryptionProperty> node (and the parent <enc:EncryptionProperties> node if required) to the <enc:EncryptedData> node encNode.


xmlSecEncDataAddCipherValue ()

xmlNodePtr  xmlSecEncDataAddCipherValue     (xmlNodePtr encNode);

Adds <enc:CipherValue> to the <enc:EncryptedData> node encNode.


xmlSecEncDataAddCipherReference ()

xmlNodePtr  xmlSecEncDataAddCipherReference (xmlNodePtr encNode,
                                             const xmlChar *uri);

Adds <enc:CipherReference> node with specified URI attribute uri to the <enc:EncryptedData> node encNode.


xmlSecCipherReferenceAddTransform ()

xmlNodePtr  xmlSecCipherReferenceAddTransform
                                            (xmlNodePtr encNode,
                                             xmlSecTransformId transform);

Adds <dsig:Transform> node (and the parent <dsig:Transforms> node) with specified transform methods transform to the <enc:CipherReference> child node of the <enc:EncryptedData> node encNode.