# Encryption
[Rampart Utilities]

## Functions
AXIS2_EXTERN axis2_status_t | rampart_enc_encrypt_message (const axutil_env_t *env, axis2_msg_ctx_t *msg_ctx, rampart_context_t *rampart_context, axiom_soap_envelope_t *soap_envelope, axiom_node_t *sec_node)
AXIS2_EXTERN axis2_status_t | rampart_enc_dk_encrypt_message (const axutil_env_t *env, axis2_msg_ctx_t *msg_ctx, rampart_context_t *rampart_context, axiom_soap_envelope_t *soap_envelope, axiom_node_t *sec_node)
AXIS2_EXTERN axis2_status_t | rampart_enc_add_key_info (const axutil_env_t *env, axis2_msg_ctx_t *msg_ctx, rampart_context_t *rampart_context, axiom_soap_envelope_t *soap_envelope, axiom_node_t *sec_node)
AXIS2_EXTERN axis2_status_t | rampart_enc_encrypt_signature (const axutil_env_t *env, axis2_msg_ctx_t *msg_ctx, rampart_context_t *rampart_context, axiom_soap_envelope_t *soap_envelope, axiom_node_t *sec_node)
AXIS2_EXTERN axis2_status_t | rampart_enc_encrypt_session_key (const axutil_env_t *env, oxs_key_t *session_key, axis2_msg_ctx_t *msg_ctx, rampart_context_t *rampart_context, axiom_node_t *sec_node, axutil_array_list_t *id_list)

## Function Documentation

AXIS2_EXTERN axis2_status_t rampart_enc_add_key_info | ( | const axutil_env_t * | env,
|  | axis2_msg_ctx_t * | msg_ctx,
|  | rampart_context_t * | rampart_context,
|  | axiom_soap_envelope_t * | soap_envelope,
|  | axiom_node_t * | sec_node |
| ) |  |  |

Parameters:

  | env | pointer to environment struct
  | msg_ctx | message context
  | soap_envelope | the SOAP envelope
  | sec_node | The security element

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_enc_dk_encrypt_message | ( | const axutil_env_t * | env,
|  | axis2_msg_ctx_t * | msg_ctx,
|  | rampart_context_t * | rampart_context,
|  | axiom_soap_envelope_t * | soap_envelope,
|  | axiom_node_t * | sec_node |
| ) |  |  |

Encrypt the message using derived keys. Uses symmetric encryption

Parameters:

  | env | pointer to environment struct
  | msg_ctx | message context
  | rampart_context | rampart context
  | soap_envelope | the SOAP envelope
  | sec_node | The security element

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_enc_encrypt_message | ( | const axutil_env_t * | env,
|  | axis2_msg_ctx_t * | msg_ctx,
|  | rampart_context_t * | rampart_context,
|  | axiom_soap_envelope_t * | soap_envelope,
|  | axiom_node_t * | sec_node |
| ) |  |  |

Parameters:

  | env | pointer to environment struct
  | msg_ctx | message context
  | soap_envelope | the SOAP envelope
  | sec_node | The security element

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_enc_encrypt_session_key | ( | const axutil_env_t * | env,
|  | oxs_key_t * | session_key,
|  | axis2_msg_ctx_t * | msg_ctx,
|  | rampart_context_t * | rampart_context,
|  | axiom_node_t * | sec_node,
|  | axutil_array_list_t * | id_list |
| ) |  |  |

Encrypts the session key using assymmetric encription

Parameters:

  | env | pointer to environment struct
  | session_key | the session key to be encrypted
  | msg_ctx | message context
  | rampart_context | the rampart context
  | sec_node | The security element

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_enc_encrypt_signature | ( | const axutil_env_t * | env,
|  | axis2_msg_ctx_t * | msg_ctx,
|  | rampart_context_t * | rampart_context,
|  | axiom_soap_envelope_t * | soap_envelope,
|  | axiom_node_t * | sec_node |
| ) |  |  |

Parameters:

  | env | pointer to environment struct
  | msg_ctx | message context
  | soap_envelope | the SOAP envelope
  | sec_node | The security element

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE