# OpenSSL Cipher Context
[OpenSSL wrapper]

## Typedefs
typedef struct openssl_cipher_ctx_t | openssl_cipher_ctx_t
## Functions
axis2_status_t | openssl_cipher_ctx_free (openssl_cipher_ctx_t *ctx, const axutil_env_t *env)
const EVP_CIPHER * | openssl_cipher_ctx_get_cipher (openssl_cipher_ctx_t *ctx, const axutil_env_t *env)
oxs_key_t * | openssl_cipher_ctx_get_key (openssl_cipher_ctx_t *ctx, const axutil_env_t *env)
axis2_char_t * | openssl_cipher_ctx_get_iv (openssl_cipher_ctx_t *ctx, const axutil_env_t *env)
axis2_char_t * | openssl_cipher_ctx_get_pad (openssl_cipher_ctx_t *ctx, const axutil_env_t *env)
axis2_status_t | openssl_cipher_ctx_set_cipher (openssl_cipher_ctx_t *ctx, const axutil_env_t *env, const EVP_CIPHER *)
axis2_status_t | openssl_cipher_ctx_set_key (openssl_cipher_ctx_t *ctx, const axutil_env_t *env, oxs_key_t *key)
axis2_status_t | openssl_cipher_ctx_set_iv (openssl_cipher_ctx_t *ctx, const axutil_env_t *env, axis2_char_t *iv)
axis2_status_t | openssl_cipher_ctx_set_pad (openssl_cipher_ctx_t *ctx, const axutil_env_t *env, axis2_char_t *pad)
AXIS2_EXTERN openssl_cipher_ctx_t * | openssl_cipher_ctx_create (const axutil_env_t *env)

## Typedef Documentation

typedef struct openssl_cipher_ctx_t openssl_cipher_ctx_t

Type name for struct openssl_cipher_ctx

## Function Documentation

AXIS2_EXTERN openssl_cipher_ctx_t* openssl_cipher_ctx_create | ( | const axutil_env_t * | env | ) |

Create a new cipher context. All the fields carry NULL values at the begining.

Parameters:

  | env | pointer to environment struct

Returns:
  Fresh Cipher Context

axis2_status_t openssl_cipher_ctx_free | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Free function

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

const EVP_CIPHER* openssl_cipher_ctx_get_cipher | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Given the ctx return the CIPHER

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct

Returns:
  RVP_CIPHER the cipher

axis2_char_t* openssl_cipher_ctx_get_iv | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Given the ctx return iv

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct

Returns:
  iv

oxs_key_t* openssl_cipher_ctx_get_key | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Given the ctx return key

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct

Returns:
  key

axis2_char_t* openssl_cipher_ctx_get_pad | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Given the ctx return the padding

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct

Returns:
  padding

axis2_status_t openssl_cipher_ctx_set_cipher | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | const EVP_CIPHER * |  |
| ) |  |  |

Set the Cipher for the cipher context.

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct
  | EVP_CIPHER | The pointer for the Cipher to be set in the cipher context

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

axis2_status_t openssl_cipher_ctx_set_iv | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | axis2_char_t * | iv |
| ) |  |  |

Set the Initial Value for the cipher context.

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct
  | iv | The Initial Value to be set in the cipher context

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

axis2_status_t openssl_cipher_ctx_set_key | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | oxs_key_t * | key |
| ) |  |  |

Set the Key for the cipher context.

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct
  | key | The key to be set in the cipher context

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

axis2_status_t openssl_cipher_ctx_set_pad | ( | openssl_cipher_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | axis2_char_t * | pad |
| ) |  |  |

Set the pad for the cipher context.

Parameters:

  | ctx | to the openssl cipher ctx struct
  | env | pointer to environment struct
  | pad | the pad to be set in the cipher context

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE