# Token Builder
[Rampart Utilities]

## Enumerations
enum | rampart_token_build_pattern_t { RTBP_UNKNOWN = 0, RTBP_EMBEDDED, RTBP_KEY_IDENTIFIER, RTBP_X509DATA_ISSUER_SERIAL, RTBP_X509DATA_X509CERTIFICATE, RTBP_THUMBPRINT }
## Functions
AXIS2_EXTERN axis2_status_t | rampart_token_build_security_token_reference (const axutil_env_t *env, axiom_node_t *parent, oxs_x509_cert_t *cert, rampart_token_build_pattern_t pattern)
AXIS2_EXTERN axis2_status_t | rampart_token_build_embedded (const axutil_env_t *env, axiom_node_t *parent, oxs_x509_cert_t *cert)
AXIS2_EXTERN axis2_status_t | rampart_token_build_key_identifier (const axutil_env_t *env, axiom_node_t *parent, oxs_x509_cert_t *cert)
AXIS2_EXTERN axis2_status_t | rampart_token_build_x509_data_x509_certificate (const axutil_env_t *env, axiom_node_t *parent, oxs_x509_cert_t *cert)
AXIS2_EXTERN axis2_status_t | rampart_token_build_x509_data_issuer_serial (const axutil_env_t *env, axiom_node_t *parent, oxs_x509_cert_t *cert)
AXIS2_EXTERN axis2_status_t | rampart_token_build_thumbprint_reference (const axutil_env_t *env, axiom_node_t *parent, oxs_x509_cert_t *cert)

## Function Documentation

AXIS2_EXTERN axis2_status_t rampart_token_build_embedded | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | oxs_x509_cert_t * | cert |
| ) |  |  |

Build an Embedded token with data available in the certificate. <SecurityTokenReference> <Embedded> <BinarySecurityToken>UYISDjsdaousdWEqswOIUsd</BinarySecurityToken> </Embedded> </SecurityTokenReference>

Parameters:

  | env | pointer to environment struct
  | parent | The parent node
  | cert | The X509 certificate

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_token_build_key_identifier | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | oxs_x509_cert_t * | cert |
| ) |  |  |

Build a KeyIndentifer token with data available in the certificate. <SecurityTokenReference> <KeyIdentifier>WEqswOIUsd</KeyIdentifier> </SecurityTokenReference>

Parameters:

  | env | pointer to environment struct
  | parent | The parent node
  | cert | The X509 certificate

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_token_build_security_token_reference | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | oxs_x509_cert_t * | cert,
|  | rampart_token_build_pattern_t | pattern |
| ) |  |  |

Build a SecurityTokenReference element according to the pattern specified in . The token will be attached to the node and relavent data will be extracted from certificate . Note that this method will internally call other token building methods specified in this header depending on the .

Parameters:

  | env | pointer to environment struct
  | parent | The parent node
  | cert | The X509 certificate
  | pattern | The build pattern

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_token_build_thumbprint_reference | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | oxs_x509_cert_t * | cert |
| ) |  |  |

Build a Thumbprint Reference of the certificate. <wsse:SecurityTokenReference> <wsse:KeyIdentifier EncodingType="..." ValueType="...# ThumbprintSHA1">bg6I8267h0TUcPYvYE0D6k6+UJQ=</wsse:KeyIdentifier> </wsse:SecurityTokenReference>

Parameters:

  | env | pointer to environment struct
  | parent | The parent node
  | cert | The X509 certificate

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE

AXIS2_EXTERN axis2_status_t rampart_token_build_x509_data_issuer_serial | ( | const axutil_env_t * | env,
|  | axiom_node_t * | parent,
|  | oxs_x509_cert_t * | cert |
| ) |  |  |

Build an X509IssuerSerial token with data available in the certificate. <SecurityTokenReference> <x509Data> <X509IssuerSerial> <X509IssuerName>C=US, O=VeriSign, Inc.,</X509IssuerName> <X509SerialNumber>93243297328</X509SerialNumber> </X509IssuerSerial> </x509Data> </SecurityTokenReference>

Parameters:

  | env | pointer to environment struct
  | parent | The parent node
  | cert | The X509 certificate

Returns:
  AXIS2_SUCCESS on success, else AXIS2_FAILURE