RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

Context Functions

This section lists the functions that facilitate public key contexts.

Functions

int R_CDECL R_PKEY_CTX_new (R_LIB_CTX *lib_ctx, R_RES_FLAG flag, R_PKEY_TYPE pkeytype, R_PKEY_CTX **pkey_ctx)
 Creates a new R_PKEY_CTX structure. More...

int R_CDECL R_PKEY_CTX_free (R_PKEY_CTX *ctx)
 Removes all allocated memory for the R_PKEY_CTX structure ctx. More...

int R_CDECL R_PKEY_CTX_get_info (R_PKEY_CTX *pkey_ctx, int id, void *param)
 Retrieves information identified by the identifier id from an R_PKEY_CTX. More...

int R_CDECL R_PKEY_CTX_set_info (R_PKEY_CTX *pkey_ctx, int id, void *param)
 Sets information identified by the identifier id against an R_PKEY_CTX. More...

R_LIB_CTX* R_CDECL R_PKEY_CTX_get_LIB_CTX (R_PKEY_CTX *ctx)
 Returns the R_LIB_CTX for the R_PKEY_CTX structure ctx. More...


Function Documentation

int R_CDECL R_PKEY_CTX_free R_PKEY_CTX   ctx ;
 

Removes all allocated memory for the R_PKEY_CTX structure ctx.

Parameters:
ctx [In] The public key context.
Returns:
R_ERROR_NONE indicates success.
See Identifiers for valid values.
See also:
R_PKEY_CTX_new().
Samples:
cert_smpl.c, cm_env_sm.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_sm.c, cm_sign_strm.c, evpkey2rpkey.c, frombuf.c, ocsp_req_create.c, p7ssl_client.c, p7ssl_server.c, pkey.c, r_asym.c, r_asym_buf.c, r_asym_items.c, r_gnrt.c, r_sign.c, rcert2sslcert.c, req.c, req_smpl.c, reqgen.c, ss_cert_smpl.c, and sslcert2rcert.c.

int R_CDECL R_PKEY_CTX_get_info R_PKEY_CTX   pkey_ctx,
int    id,
void *    param
;
 

Retrieves information identified by the identifier id from an R_PKEY_CTX.

Parameters:
pkey_ctx [In] The R_PKEY context reference.
id [In] The identifier describing the information to retrieve.
See Context Information Identifiers for valid values.
param [Out] The data to retrieve from pkey_ctx.
Returns:
R_ERROR_NONE indicates success.
See Identifiers for valid values.
See also:
R_PKEY_CTX_new(), R_PKEY_CTX_free() and R_PKEY_CTX_set_info().

R_LIB_CTX* R_CDECL R_PKEY_CTX_get_LIB_CTX R_PKEY_CTX   ctx ;
 

Returns the R_LIB_CTX for the R_PKEY_CTX structure ctx. The R_LIB_CTX structure is the library context which is used to access common state and logic.

Parameters:
ctx [In] The public key context.
Returns:
The library context of the R_PKEY_CTX structure.
NULL indicates error.

int R_CDECL R_PKEY_CTX_new R_LIB_CTX   lib_ctx,
R_RES_FLAG    flag,
R_PKEY_TYPE    pkeytype,
R_PKEY_CTX **    ctx
;
 

Creates a new R_PKEY_CTX structure.

Parameters:
lib_ctx [In] The library context from which to create the public key context.
ctx [Out] The created public key context.
pkeytype [In] The key type. One of:
  • R_PKEY_TYPE_RSA.
  • R_PKEY_TYPE_DSA.
  • R_PKEY_TYPE_DSAPARAMS.
  • flag [Out] The creation flag.
    Only R_RES_FLAG_DEF is supported.
    Returns:
    R_ERROR_NONE indicates success.
    See Identifiers for valid values.
    See also:
    R_PKEY_CTX_free().
    Samples:
    cert_smpl.c, cm_env_sm.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_sm.c, cm_sign_strm.c, evpkey2rpkey.c, frombuf.c, ocsp_req_create.c, p7ssl_client.c, p7ssl_server.c, pkey.c, r_asym.c, r_asym_buf.c, r_asym_items.c, r_gnrt.c, r_sign.c, rcert2sslcert.c, req.c, req_smpl.c, reqgen.c, ss_cert_smpl.c, and sslcert2rcert.c.

    int R_CDECL R_PKEY_CTX_set_info R_PKEY_CTX   pkey_ctx,
    int    id,
    void *    param
    ;
     

    Sets information identified by the identifier id against an R_PKEY_CTX.

    Parameters:
    pkey_ctx [In] The R_PKEY context reference.
    id [In] The identifier describing the information to set.
    See Context Information Identifiers for valid values.
    param [In] The data to set against pkey_ctx.
    Returns:
    R_ERROR_NONE indicates success.
    See Identifiers for valid values.
    note.gif
    The flag R_PKEY_FL_BY_REFERENCE is cleared from the R_PKEY_CTX when a call to set data is made with the R_PKEY_CTX_INFO_ID_DATA identifier.
    If data is set against the R_PKEY_CTX using R_PKEY_CTX_INFO_ID_DATA, and data has been previously set, the flags set against R_PKEY_CTX will be checked for R_PKEY_FL_BY_REFERENCE.
    If this flag is not set the data is deallocated via a call to Free().
    If the data is not to be de-allocated on reset, the flag R_PKEY_FL_BY_REFERENCE should be set against R_PKEY_CTX using the identifier R_PKEY_CTX_INFO_ID_FLAG after the data is set with R_PKEY_CTX_INFO_ID_DATA.
    See also:
    R_PKEY_CTX_new(), R_PKEY_CTX_free() and R_PKEY_CTX_get_info().


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