# Asymmetric Context
[OMXMLSecurity]

## Typedefs
typedef struct oxs_asym_ctx_t | oxs_asym_ctx_t
## Enumerations
enum | oxs_asym_ctx_format_t { OXS_ASYM_CTX_FORMAT_UNKNOWN = 0, OXS_ASYM_CTX_FORMAT_PEM, OXS_ASYM_CTX_FORMAT_PKCS12 }
enum | oxs_asym_ctx_operation_t { OXS_ASYM_CTX_OPERATION_PUB_ENCRYPT = 0, OXS_ASYM_CTX_OPERATION_PRV_DECRYPT, OXS_ASYM_CTX_OPERATION_PUB_DECRYPT, OXS_ASYM_CTX_OPERATION_PRV_ENCRYPT }
## Functions
AXIS2_EXTERN oxs_asym_ctx_t * | oxs_asym_ctx_create (const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | oxs_asym_ctx_free (oxs_asym_ctx_t *ctx, const axutil_env_t *env)
AXIS2_EXTERN axis2_char_t * | oxs_asym_ctx_get_algorithm (const oxs_asym_ctx_t *ctx, const axutil_env_t *env)
AXIS2_EXTERN axis2_char_t * | oxs_asym_ctx_get_st_ref_pattern (const oxs_asym_ctx_t *ctx, const axutil_env_t *env)
AXIS2_EXTERN oxs_asym_ctx_operation_t | oxs_asym_ctx_get_operation (const oxs_asym_ctx_t *ctx, const axutil_env_t *env)
AXIS2_EXTERN openssl_pkey_t * | oxs_asym_ctx_get_private_key (const oxs_asym_ctx_t *ctx, const axutil_env_t *env)
AXIS2_EXTERN oxs_x509_cert_t * | oxs_asym_ctx_get_certificate (const oxs_asym_ctx_t *ctx, const axutil_env_t *env)
AXIS2_EXTERN axis2_status_t | oxs_asym_ctx_set_algorithm (oxs_asym_ctx_t *ctx, const axutil_env_t *env, axis2_char_t *algorithm)
AXIS2_EXTERN axis2_status_t | oxs_asym_ctx_set_st_ref_pattern (oxs_asym_ctx_t *ctx, const axutil_env_t *env, axis2_char_t *st_ref_pattern)
AXIS2_EXTERN axis2_status_t | oxs_asym_ctx_set_operation (oxs_asym_ctx_t *ctx, const axutil_env_t *env, oxs_asym_ctx_operation_t operation)
AXIS2_EXTERN axis2_status_t | oxs_asym_ctx_set_certificate (oxs_asym_ctx_t *ctx, const axutil_env_t *env, oxs_x509_cert_t *certificate)
AXIS2_EXTERN axis2_status_t | oxs_asym_ctx_set_private_key (oxs_asym_ctx_t *asym_ctx, const axutil_env_t *env, openssl_pkey_t *private_key)

## Function Documentation

AXIS2_EXTERN axis2_status_t oxs_asym_ctx_free | ( | oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Free function for the asymmetric context struct pointer to the OMXMLSec asymmetric context struct pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_char_t* oxs_asym_ctx_get_algorithm | ( | const oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the algorithm used to encrypt pointer to the OMXMLSec asymmetric context struct pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN oxs_x509_cert_t* oxs_asym_ctx_get_certificate | ( | const oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the x509 crtificate used. pointer to the OMXMLSec asymmetric context struct pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN oxs_asym_ctx_operation_t oxs_asym_ctx_get_operation | ( | const oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the operation. For ex: Public Key encrypt, Private Key Decrypt pointer to the OMXMLSec asymmetric context struct pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN openssl_pkey_t* oxs_asym_ctx_get_private_key | ( | const oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the private key used pointer to the OMXMLSec asymmetric context struct pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_char_t* oxs_asym_ctx_get_st_ref_pattern | ( | const oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env |
| ) |  |  |

Get the SecurityTokenReference pattern. For ex: IssuerSerial pointer to the OMXMLSec asymmetric context struct pointer to environment struct

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t oxs_asym_ctx_set_algorithm | ( | oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | axis2_char_t * | algorithm |
| ) |  |  |

Sets the algorithm used to encrypt pointer to the OMXMLSec asymmetric context struct pointer to environment struct used to encrypt

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t oxs_asym_ctx_set_certificate | ( | oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | oxs_x509_cert_t * | certificate |
| ) |  |  |

Sets the x509 crtificate used. pointer to the OMXMLSec asymmetric context struct pointer to environment struct the x509 crtificate used.

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t oxs_asym_ctx_set_operation | ( | oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | oxs_asym_ctx_operation_t | operation |
| ) |  |  |

Sets the operation. For ex: Public Key encrypt, Private Key Decrypt pointer to the OMXMLSec asymmetric context struct pointer to environment struct the operation. For ex: Public Key encrypt, Private Key Decrypt

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t oxs_asym_ctx_set_private_key | ( | oxs_asym_ctx_t * | asym_ctx,
|  | const axutil_env_t * | env,
|  | openssl_pkey_t * | private_key |
| ) |  |  |

Sets private key used pointer to the OMXMLSec asymmetric context struct pointer to environment struct private key used

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t oxs_asym_ctx_set_st_ref_pattern | ( | oxs_asym_ctx_t * | ctx,
|  | const axutil_env_t * | env,
|  | axis2_char_t * | st_ref_pattern |
| ) |  |  |

Set the SecurityTokenReference pattern. For ex: IssuerSerial pointer to the OMXMLSec asymmetric context struct pointer to environment struct SecurityTokenReference pattern. For ex: IssuerSerial

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE