Generate PKA Key Pair (QC3GENPK, Qc3GenPKAKeyPair) API


  Required Parameter Group:


  Service Program Name: QC3KEYGN

  Default Public Authority: *USE

  Threadsafe: Yes

The Generate PKA Key Pair (OPM, QC3GENPK; ILE, Qc3GenPKAKeyPair) API generates a random PKA key pair that can be used with the PKA cipher algorithm RSA.

Information on cryptographic standards can be found in Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API.


Authorities and Locks

Required device description authority
*USE


Required Parameter Group

Key type
INPUT; BINARY(4)

The type of key.

Following are the valid values.
Key size
INPUT; BINARY(4)

The modulus length in bits.
The key size must be an even number in the range 512 - 4096.

Public key exponent
INPUT; BINARY(4)

To maximize performance, the public key exponent is limited to the following two values.


Key format
INPUT; CHAR(1)

The format in which to return the key.
Following are the valid values.


Key form
INPUT; CHAR(1)

The form in which to return the private key string.


Key-encrypting key
INPUT; CHAR(*)

For key form 0 (clear), this parameter must be set to blanks or the pointer to this parameter set to NULL.

For key form 1 (encrypted), this parameter specifies the key context token to use to encrypt the private key string.

For key form 2 (encrypted with a master key), this parameter has the following structure:



Master key ID
The master key IDs are
Reserved
Must be null (binary 0s).

Disallowed function
INPUT; BINARY(4)

This parameter specifies the functions that cannot be used with this key. The values listed below can be added together to disallow multiple functions. For example, to disallow everything but encryption, set the value to 14. This value should be saved along with the encrypted private key string because it will be required when the encrypted private key string is used on an API.


Master key KVV
The key verification value of the master key that was used to encrypt the key is returned in this field. This value should be saved along with the encrypted key value. When the encrypted key value is used on an API and the KVV is supplied, the API will be able to determine which version of the master key should be used to decrypt the key. This field must be null (binary 0s) on input.

Key-encrypting algorithm
INPUT; CHAR(8)

For key form 0 (clear) and 2 (encrypted with a master key), this parameter must be set to blanks or the pointer to this parameter set to NULL.

For key form 1 (encrypted), this parameter specifies the algorithm context token to use for encrypting the private key string.

Cryptographic service provider
INPUT; CHAR(1)

The cryptographic service provider (CSP) that will perform the key generate operation.


Cryptographic device name
INPUT; CHAR(10)

This parameter must be set to blanks or the pointer to this parameter set to NULL.

Private key string
OUTPUT; CHAR(*)

The area to store the generated private key string or the pointer to this parameter set to NULL.

Length of area provided for the private key string
INPUT; BINARY(4)

The length of the private key string parameter. At most, the generated private key string will be 2400 bytes.

Length of private key string returned
OUTPUT; BINARY(4)

The length of the generated private key string returned in the private key string parameter.
If the length of area provided is too small, an error will be generated and no data will be returned in the private key string parameter.

Public key string
OUTPUT; CHAR(*)

The area to store the public key string.

Length of area provided for the public key string
INPUT; BINARY(4)

The length of the public key string parameter. At most, the public key string will be 512 bytes.

Length of public key string returned
OUTPUT; BINARY(4)

The length of the public key string returned in the public key string parameter.
If the length of area provided is too small, an error will be generated and no data will be returned in the public key string parameter.

Error code
I/O; CHAR(*)

The structure in which to return error information.
For the format of the structure, see Error code parameter.


Error Messages




API introduced: V5R3

[ Back to top | Cryptographic Services APIs | APIs by category ]