RSA Security logo

RSA BSAFE Cert-C
API Reference

certcryp.h File Reference

This file defines the Cert-C crypto interface.

#include "service.h"

Go to the source code of this file.

Functions

int C_GetChooser (CERTC_CTX ctx, B_ALGORITHM_CHOOSER *chooser)
 Returns the Crypto-C algorithm chooser that Cert-C manages. More...

int C_GetRandomObject (CERTC_CTX ctx, B_ALGORITHM_OBJ *randomObj)
 Returns an initialized random object. More...

int C_CopyPrivateKey (B_KEY_OBJ newKey, B_KEY_OBJ oldKey)
 Duplicates an RSA BSAFE Crypto-C private-key object. More...


Function Documentation

int C_CopyPrivateKey B_KEY_OBJ    newKey,
B_KEY_OBJ    oldKey
;
 

Duplicates an RSA BSAFE Crypto-C private-key object.
Note: You must provide a private-key type that Cert-C supports, such as an RSA or DSA private key.

Parameters:
newKey This is both an input and an output parameter. As an input parameter, it contains a key object that was created using Crypto-C's B_CreateKeyObject, but not initialized by calling Crypto-C's B_SetKeyInfo or B_GenerateKeyPair functions. For a detailed description of these Crypto-C functions, see the Crypto-C Reference Manual.
C_CopyPrivateKey() initializes the key with a copy of the information contained in oldKey. As an output parameter, it contains a copy of that information.
oldKey This input parameter contains an initialized private-key object.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int C_GetChooser CERTC_CTX    ctx,
B_ALGORITHM_CHOOSER *    chooser
;
 

Returns the Crypto-C algorithm chooser that Cert-C manages. The algorithm chooser contains the bindings between high-level algorithm information types, such as one that signs with MD5 and RSA, and low-level algorithm methods, such as MD5 digest operations and RSA private-key operations. The algorithm chooser also binds in cryptographic hardware so that high-level operations can use it. On some Intel platforms, this includes a hardware RNG. On some Microsoft platforms (for example, Windows NT and Windows 95/98 with Internet Explorer 4.01 or later), this includes the ability to use keys and certificates that reside in the Microsoft CryptoAPI subsystem.

Note: The fields returned from this function are read-only. You do not need to create any objects or items before calling this function. Do not call any functions that modify these fields. Do not call any C_Destroy*() functions on these fields.

Parameters:
ctx This input parameter contains the Cert-C context handle.
chooser This output parameter points to an initialized Crypto-C algorithm chooser.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int C_GetRandomObject CERTC_CTX    ctx,
B_ALGORITHM_OBJ *    randomObj
;
 

Returns an initialized random object. The application can call the Crypto-C B_GenerateRandomBytes function immediately after initializing a random object. For a detailed description of B_GenerateRandomBytes, see the Crypto-C documentation.

Note: Do not destroy the random object. If you destroy the random object, Cert-C will unregister the cryptographic service provider. Cert-C will destroy the random object when you unregister the cryptographic service provider.

Parameters:
ctx This input parameter is the Cert-C context from which the random object is extracted.
randomObj This output parameter points to the Crypto-C random object for this context.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.



RSA BSAFE® Cert-C 2.7 API Reference