Generate Key Record (QC3GENKR, Qc3GenKeyRecord) API


  Required Parameter Group:


 Service Program Name: QC3KRGEN

 Default Public Authority: *USE

 Threadsafe: Yes

The Generate Key Record (OPM, QC3GENKR; ILE, Qc3GenKeyRecord) API generates a random key or key pair and stores it in a keystore file.

For more information about cryptographic services keystore, see Cryptographic services key management.


Authorities and Locks

Required file authority
*OBJOPR, *READ, *ADD

Required device description authority
*USE


Required Parameter Group

Qualified keystore file name
INPUT; CHAR(20)

The keystore file where the key will be stored. The first 10 characters contain the file name. The second 10 characters contain the name of the library where the keystore file is located.
You can use the following special values for the library name.

Record label
INPUT; CHAR(32)

The label for the key record. The label will be converted from the job CCSID, or if 65535, the job default CCSID (DFTCCSID) job attribute to CCSID 1200 (Unicode UTF-16).

Key type
INPUT; BINARY(4)

The type of key.
Following are the valid values.

Key size
INPUT; BINARY(4)

The length of key to generate. For RSA keys this length is specified in bits. For all other keys it is specified in bytes.
Refer to the key type parameter for restrictions.

Public key exponent
INPUT; BINARY(4)

This parameter is valid when key type parameter specifies 50 (RSA). Otherwise, this parameter must be set to 0. To maximize performance, the public key exponent is limited to the following two values.


Disallowed function
INPUT; BINARY(4)

This parameter specifies the functions that cannot be used with this key record. The values listed below can be added together to disallow multiple functions. For example, to disallow everything but MACing, set the value to 11.


Cryptographic service provider
INPUT; CHAR(1)

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


Cryptographic device name
INPUT; CHAR(10)

The name of a cryptographic device description.
This parameter is valid when the cryptographic service provider parameter specifies 2 (hardware CSP). Otherwise, this parameter must be blanks or the pointer to this parameter set to NULL.

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: V5R4

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