XML Security Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
struct xmlSecEncCtx; |
struct xmlSecEncCtx { xmlSecKeysMngrPtr keysMngr; xmlSecTransformId encryptionMethod; int ignoreType; time_t certsVerificationTime; }; |
XML Encrypiton context.
the pointer to keys manager xmlSecKeysMngr. | |
xmlSecTransformId encryptionMethod | the default encryption algorithm id. |
int ignoreType | the flag to ignore Type attribute in the <enc:EncryptedData> node |
|
Creates new encryption context.
keysMngr : | the pointer to xmlSecKeysMngr structure. |
Returns : | newly allocated xmlSecEncCtx structure or NULL if an error occurs. |
void xmlSecEncCtxDestroy ( |
Destroys the xmlSecEncCtx structure.
ctx : | the pointer to xmlSecEncCtx structure. |
int xmlSecEncryptMemory ( |
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.
ctx : | the pointer to xmlSecEncCtx structure. |
context : | the pointer to application specific data that will be passed to all callback functions. |
key : | the key to use (if NULL then the key specified in <dsig:KeyInfo> will be used). |
encNode : | the pointer to encryption template (<enc:EncryptionData> node). |
buf : | the pointer to data to encrypt. |
size : | the size of the data in buf. |
result : | the pointer where to store encryption results. |
Returns : | 0 on success or a negative value otherwise. |
int xmlSecEncryptUri ( |
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.
ctx : | the pointer to xmlSecEncCtx structure. |
context : | the pointer to application specific data that will be passed to all callback functions. |
key : | the key to use (if NULL then the key specified in <dsig:KeyInfo> will be used). |
encNode : | the pointer to encryption template (<enc:EncryptionData> node). |
uri : | the URI to data to encrypt. |
result : | the pointer where to store encryption results. |
Returns : | 0 on success or a negative value otherwise. |
int xmlSecEncryptXmlNode ( |
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.
ctx : | the pointer to xmlSecEncCtx structure. |
context : | the pointer to application specific data that will be passed to all callback functions. |
key : | the key to use (if NULL then the key specified in <dsig:KeyInfo> will be used). |
encNode : | the pointer to encryption template (<enc:EncryptionData> node). |
src : | the pointer to XML node to encrypt. |
result : | the pointer where to store encryption results. |
Returns : | 0 on success or a negative value otherwise. |
int xmlSecDecrypt ( |
Decrypts data from the <enc:EncryptionData> node.
ctx : | the pointer to xmlSecEncCtx structure. |
context : | the pointer to application specific data that will be passed to all callback functions. |
key : | the key to use (if NULL then the key specified in <dsig:KeyInfo> will be used). |
encNode : | the pointer to encryption template (<enc:EncryptionData> node). |
result : | the pointer where to store encryption results. |
Returns : | 0 on success or a negative value otherwise. |
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.
the pointer to xmlSecEncCtx structure. | |
void *context | the pointer to application specific data. |
the pointer to <enc:EncryptedData> node. | |
int encrypt | the encrypt/decrypt flag. |
the Id attribute of the <enc:EncryptedData> node. | |
the Type attribute of the <enc:EncryptedData> node. | |
the MimeType attribute of the <enc:EncryptedData> node. | |
the Encoding attribute of the <enc:EncryptedData> node. | |
xmlSecTransformId encryptionMethod | the used encryption algorithm id. |
the used encryption key. | |
the decrypted data. | |
int replaced | if set then the decrypted data were put back into the original document. |
|
Creates new xmlSecEncResult structure.
ctx : | the pointer to xmlSecEncCtx structure. |
context : | the pointer to application specific data that will be passed to all callback functions. |
encrypt : | the encrypt/decrypt flag. |
node : | the pointer to <enc:EncryptedData> node. |
Returns : | newly created xmlSecEncResult structure or NULL if an error occurs. |
void xmlSecEncResultDestroy ( |
Destroys xmlSecEncResult structure result.
result : | the pointer to xmlSecEncResult structure. |
void xmlSecEncResultDebugDump ( |
Prints the xmlSecEncResult structure result to file output.
result : | the pointer to xmlSecEncResult structure. |
output : | the pointer to destination FILE. |
|
Creates new <enc:EncryptedData> node for encryption template.
void xmlSecEncDataDestroy ( |
Destroys the <enc:EncryptedData> node encNode.
|
Adds <enc:EncryptionMethod> node with specified encryption algorithm (encMethodId) to the <enc:EncryptedData> node encNode.
|
Adds <dsig:KeyInfo> to the <enc:EncryptedData> node encNode.
|
Adds <enc:EncryptionProperties> node to the <enc:EncryptedData> node encNode.
|
Adds <enc:EncryptionProperty> node (and the parent <enc:EncryptionProperties> node if required) to the <enc:EncryptedData> node encNode.
|
Adds <enc:CipherValue> to the <enc:EncryptedData> node encNode.
|
Adds <enc:CipherReference> node with specified URI attribute uri to the <enc:EncryptedData> node encNode.
|
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.