Extract Public Key (QC3EXTPB, Qc3ExtractPublicKey) API


  Required Parameter Group:


 Service Program Name: QC3PBEXT

 Default Public Authority: *USE

 Threadsafe: Yes

The Extract Public Key (OPM, QC3EXTPB; ILE, Qc3ExtractPublicKey) API extracts a public key from a BER encoded PKCS #8 string or from a key record containing a public or private PKA key.


Authorities and Locks

Required file authority
*OBJOPR, *READ


Required Parameter Group

Key string
INPUT; CHAR(*)

A BER encoded PKCS #8 string, or a formatted structure identifying a key record in keystore. The exact format of the key string is specified in the key string format parameter.

Length of key string
INPUT; BINARY(4)

Length of the key string specified in the key string parameter.

Key string format
INPUT; CHAR(1)

Format of the key string parameter.
Following are the valid values.

Key form
INPUT; CHAR(1)

An indicator specifying if the key string parameter is in encrypted form.


Key-encrypting key
INPUT; CHAR(*)

The key under which the key string parameter is encrypted

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 8-byte key context token to use for decrypting the key string parameter.

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


Disallowed function
INPUT; BINARY(4)

This parameter specifies the functions that are not allowed to be used with this key. This value was XOR'd into the master key when this key was encrypted and therefore must be used when decrypting the key string. The values listed below can be added together to disallow multiple functions. For example, to disallow everything but MACing, set the value to 11.


Master key ID
The master key to use for decrypting the key string parameter. The master key IDs are


Master key KVV
The master key verification value. The master key version with a KVV that matches this value will be used to decrypt the key. If this value is null, the current version of the master key will be used.

Reserved
Must be null (binary 0s).

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 decrypting the key string parameter.

Public key
OUTPUT; CHAR(*)

The area to store the public key. This parameter will contain the extracted public key in BER encoded X.509 SubjectPublicKeyInfo format.

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

The length of the public key parameter.

Length of public key returned
OUTPUT; BINARY(4)

The length of the extracted public key returned in the public key parameter.
If the length of area provided for the public key is too small, an error will be generated and no data will be returned in the public key 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: V5R4

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