Synopsis
enum                xmlEncCtxMode;
#define             XMLSEC_ENC_RETURN_REPLACED_NODE
struct              xmlSecEncCtx;
xmlSecEncCtxPtr     xmlSecEncCtxCreate                  (xmlSecKeysMngrPtr keysMngr);
void                xmlSecEncCtxDestroy                 (xmlSecEncCtxPtr encCtx);
int                 xmlSecEncCtxInitialize              (xmlSecEncCtxPtr encCtx,
                                                         xmlSecKeysMngrPtr keysMngr);
void                xmlSecEncCtxFinalize                (xmlSecEncCtxPtr encCtx);
int                 xmlSecEncCtxCopyUserPref            (xmlSecEncCtxPtr dst,
                                                         xmlSecEncCtxPtr src);
void                xmlSecEncCtxReset                   (xmlSecEncCtxPtr encCtx);
int                 xmlSecEncCtxBinaryEncrypt           (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr tmpl,
                                                         const xmlSecByte *data,
                                                         xmlSecSize dataSize);
int                 xmlSecEncCtxXmlEncrypt              (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr tmpl,
                                                         xmlNodePtr node);
int                 xmlSecEncCtxUriEncrypt              (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr tmpl,
                                                         const xmlChar *uri);
int                 xmlSecEncCtxDecrypt                 (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr node);
xmlSecBufferPtr     xmlSecEncCtxDecryptToBuffer         (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr node);
void                xmlSecEncCtxDebugDump               (xmlSecEncCtxPtr encCtx,
                                                         FILE *output);
void                xmlSecEncCtxDebugXmlDump            (xmlSecEncCtxPtr encCtx,
                                                         FILE *output);
 
Details
enum xmlEncCtxMode
typedef enum {
    xmlEncCtxModeEncryptedData = 0,
    xmlEncCtxModeEncryptedKey
} xmlEncCtxMode;
The xmlSecEncCtx mode.
 
XMLSEC_ENC_RETURN_REPLACED_NODE
#define XMLSEC_ENC_RETURN_REPLACED_NODE			0x00000001
If this flag is set, then the replaced node will be returned in the replacedNodeList
 
struct xmlSecEncCtx
struct xmlSecEncCtx {
    /* these data user can set before performing the operation */
    void*			userData;
    unsigned int		flags;
    unsigned int		flags2;    
    xmlEncCtxMode		mode;
    xmlSecKeyInfoCtx		keyInfoReadCtx;
    xmlSecKeyInfoCtx		keyInfoWriteCtx;
    xmlSecTransformCtx		transformCtx;
    xmlSecTransformId		defEncMethodId;
    /* these data are returned */
    xmlSecKeyPtr		encKey;
    xmlSecTransformOperation	operation;
    xmlSecBufferPtr		result;
    int				resultBase64Encoded;
    int				resultReplaced;
    xmlSecTransformPtr		encMethod;
		
    /* attributes from EncryptedData or EncryptedKey */    
    xmlChar*			id;
    xmlChar*			type;
    xmlChar*			mimeType;
    xmlChar*			encoding;
    xmlChar*			recipient;
    xmlChar*			carriedKeyName;
    /* these are internal data, nobody should change that except us */
    xmlNodePtr			encDataNode;
    xmlNodePtr			encMethodNode;
    xmlNodePtr			keyInfoNode;
    xmlNodePtr			cipherValueNode;
        
    xmlNodePtr			replacedNodeList; /* the pointer to the replaced node */
    void*			reserved1;	  /* reserved for future */
};
XML Encrypiton context.
 
xmlSecEncCtxFinalize ()
void                xmlSecEncCtxFinalize                (xmlSecEncCtxPtr encCtx);
Cleans up encCtx object.
 
xmlSecEncCtxCopyUserPref ()
int                 xmlSecEncCtxCopyUserPref            (xmlSecEncCtxPtr dst,
                                                         xmlSecEncCtxPtr src);
Copies user preference from src context to dst.
| dst: | 		the pointer to destination context. | 
| src: | 		the pointer to source context. | 
| Returns : |  0 on success or a negative value if an error occurs. | 
 
xmlSecEncCtxReset ()
void                xmlSecEncCtxReset                   (xmlSecEncCtxPtr encCtx);
Resets encCtx object, user settings are not touched.
 
xmlSecEncCtxBinaryEncrypt ()
int                 xmlSecEncCtxBinaryEncrypt           (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr tmpl,
                                                         const xmlSecByte *data,
                                                         xmlSecSize dataSize);
Encrypts data according to template tmpl.
 
xmlSecEncCtxXmlEncrypt ()
int                 xmlSecEncCtxXmlEncrypt              (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr tmpl,
                                                         xmlNodePtr node);
Encrypts node according to template tmpl. If requested, node is replaced
with result <enc:EncryptedData/> node.
 
xmlSecEncCtxUriEncrypt ()
int                 xmlSecEncCtxUriEncrypt              (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr tmpl,
                                                         const xmlChar *uri);
Encrypts data from uri according to template tmpl.
 
xmlSecEncCtxDecrypt ()
int                 xmlSecEncCtxDecrypt                 (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr node);
Decrypts node and if necessary replaces node with decrypted data.
 
xmlSecEncCtxDecryptToBuffer ()
xmlSecBufferPtr     xmlSecEncCtxDecryptToBuffer         (xmlSecEncCtxPtr encCtx,
                                                         xmlNodePtr node);
Decrypts node data to the encCtx buffer.
 
xmlSecEncCtxDebugDump ()
void                xmlSecEncCtxDebugDump               (xmlSecEncCtxPtr encCtx,
                                                         FILE *output);
Prints the debug information about encCtx to output.
 
xmlSecEncCtxDebugXmlDump ()
void                xmlSecEncCtxDebugXmlDump            (xmlSecEncCtxPtr encCtx,
                                                         FILE *output);
Prints the debug information about encCtx to output in XML format.