RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

Data Encoding Format Functions

This section outlines the functions that facilitate data encoding formats.

Functions

int R_CDECL R_FORMAT_from_string (char *str, R_FORMAT *format)
 Converts the string str into a format identifier which is then returned. More...

int R_CDECL R_FORMAT_to_string (R_FORMAT format, unsigned int max_str_len, char *str)
 Returns the string for the format identifier type. More...


Function Documentation

int R_CDECL R_FORMAT_from_string char *    str,
R_FORMAT   format
;
 

Converts the string str into a format identifier which is then returned. This function is used for interpreting user input.

Parameters:
str [In] The format identifier string. One of:
  • "BIN"/"bin".
  • "DER"/"der".
  • "TEXT"/"text".
  • "TXT"/"txt".
  • "HEX"/"hex".
  • "BASE64"/"base64".
  • "CODE_BIN"/"code_bin".
  • "CODE_FIELDS"/"code_fields".
  • "CODE_HEX"/"code_hex".
  • format [Out] The format identifier.
    See Data Encoding Formats for valid values.
    Returns:
    R_ERROR_NONE indicates success.
    See Identifiers for valid values.
    note.gif
    Distinguished Encoding Rules (DER) encoding is binary encoding.
    See also:
    R_FORMAT_to_string().
    Samples:
    cert.c, cm_env.c, cm_env_strm.c, cm_env_strm_membio.c, cm_open.c, cm_open_strm.c, cm_open_strm_cb.c, cm_open_strm_membio.c, cm_sign.c, cm_sign_dgst.c, cm_sign_strm.c, ext.c, req.c, reqgen.c, s_crl_check.c, s_crl_verify.c, store.c, and vfy_bc.c.

    int R_CDECL R_FORMAT_to_string R_FORMAT    format,
    unsigned int    max_str_len,
    char *    str
    ;
     

    Returns the string for the format identifier type. This function is used to create a human readable form of the format.

    Parameters:
    format [In] The format identifier.
    See Data Encoding Formats for valid values.
    max_str_len [In] The maximum length of the string.
    str [Out] The format string. One of:
  • "BIN".
  • "TEXT".
  • "HEX".
  • "BASE64".
  • "CODE_BIN".
  • "CODE_FIELDS".
  • "CODE_HEX".
  • Returns:
    R_ERROR_NONE indicates success.
    See Identifiers for valid values.
    See also:
    R_FORMAT_from_string().


    Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 072-001001-2100-001-000 - 2.1