z/OS Cryptographic Services System SSL Programming
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


gsk_construct_private_key()

z/OS Cryptographic Services System SSL Programming
SC14-7495-00

Constructs a private key from its component values.

Format

   #include <gskcms.h>

   gsk_status gsk_construct_private_key (
                                          gsk_private_key *          private_key_factors,
                                          pkcs_private_key_info *    private_key) 

Parameters

private_key_factors
Specifies the private key structure containing the key algorithm type and private key components.
private_key
Returns the private key.

Results

The function return value will be 0 if no error is detected. Otherwise, it will be one of the return codes listed in the gskcms.h include file. These are some possible errors:
[CMSERR_ALG_NOT_SUPPORTED]
Cryptographic algorithm is not supported.
[CMSERR_BASE_NOT_SUPPLIED]
Base not supplied.
[CMSERR_COEFFICIENT_NOT_SUPPLIED]
CRT Coefficient not supplied.
[CMSERR_EC_PARAMETERS_NOT_SUPPLIED]
EC parameters not supplied.
[CMSERR_MODULUS_NOT_SUPPLIED]
Modulus not supplied.
[CMSERR_PRIME_EXPONENT1_NOT_SUPPLIED]
First prime exponent not supplied.
[CMSERR_PRIME_EXPONENT2_NOT_SUPPLIED]
Second prime exponent not supplied.
[CMSERR_PRIME_NOT_SUPPLIED]
Prime not supplied.
[CMSERR_PRIME1_NOT_SUPPLIED]
First prime not supplied.
[CMSERR_PRIME2_NOT_SUPPLIED]
Second prime not supplied.
[CMSERR_PRIVATE_EXPONENT_NOT_SUPPLIED]
Private exponent not supplied.
[CMSERR_PRIVATE_KEY_INFO_NOT_SUPPLIED]
Private key information not supplied.
[CMSERR_PRIVATE_KEY_NOT_SUPPLIED]
Private key structure not supplied.
[CMSERR_PRIVATE_VALUE_NOT_SUPPLIED]
Private value not supplied.
[CMSERR_PUBLIC_EXPONENT_NOT_SUPPLIED]
Public exponent not supplied.
[CMSERR_STRUCTURE_TOO_SMALL]
Size specified for supplied structure is too small.
[CMSERR_SUB_PRIME_NOT_SUPPLIED]
Sub-prime not supplied.

Usage

The gsk_construct_private_key() function constructs the pkcs_private_key_info from the supplied private key components. The format of the supplied components is as stored in ICSF PKCS #11 tokens.

Before calling the function, the application must initialize the size field in private_key_factors to the size of the gsk_private_key structure. It must also prime private_key_factors with the x509_algorithm_identifier, including appropriate private key components for the private key type being constructed.

The x509_algorithm_identifier in private_key is set with the appropriate value for the private key type when returned.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014