Translate Data (QC3TRNDT, Qc3TranslateData)


  Required Parameter Group:

1 Data to translate Input Char(*)
2 Length of data to translate Input Binary(4)
3 Decrypt algorithm context token Input Char(8)
4 Decrypt key context token Input Char(8)
5 Encrypt algorithm context token Input Char(8)
6 Encrypt key context token Input Char(8)
7 Cryptographic service provider Input Char(1)
8 Cryptographic device name Input Char(10)
9 Translated data Output Char(*)
10 Length of area provided for translated data Input Binary(4)
11 Length of translated data returned Output Binary(4)
12 Error code I/O Char(*)

  Service Program Name: QC3DTATR

  Default Public Authority: *USE

  Threadsafe: Yes

The Translate Data (OPM, QC3TRNDT; ILE, Qc3TranslateData) API translates data from encryption under one key to encryption under another key.


Authorities and Locks

Required API authority
*USE

Required device description authority
*USE


Required Parameter Group

Data to translate
INPUT; CHAR(*)

The data to be decrypted and encrypted again.

Length of data to translate
INPUT; BINARY(4)

The length of data in the data to translate parameter.
If the decrypt mode of operation is CFB 1-bit, the length must be specified in bits.

Decrypt algorithm context token
INPUT; CHAR(8)

The token for the algorithm context to use for decrypting the data.
The algorithm context is created using the Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API.
On a translate operation, the system always performs final processing (e.g. padding) and resets the algorithm context to its initial state. The algorithm context can then be used to begin a new cryptographic operation (encrypt, decrypt, etc.).

Decrypt key context token
INPUT; CHAR(8)

The token for the key context to use for decrypting the data.
The key context is created using the Create Key Context (OPM, QC3CRTKX; ILE, Qc3CreateKeyContext) API.

Encrypt algorithm context token
INPUT; CHAR(8)

The token for the algorithm context to use for encrypting the data.
The algorithm context is created using the Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API.

Encrypt key context token
INPUT; CHAR(8)

The token for the key context to use for encrypting the data.
The key context is created using the Create Key Context (OPM, QC3CRTKX; ILE, Qc3CreateKeyContext) API.

Cryptographic service provider
INPUT; CHAR(1)

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

0 Any CSP.
The system will choose an appropriate CSP to perform the translate operation.
1 Software CSP.
The system will perform the translate operation using software. If the requested algorithms are not available in software, an error is returned.
2 Hardware CSP.
The system will perform the translate operation using cryptographic hardware. If the requested algorithms are not available in hardware, an error is returned. A specific cryptographic device can be specified using the cryptographic device name parameter. If the cryptographic device is not specified, the system will choose an appropriate one.
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 paramter set to NULL.

Translated data
OUTPUT; CHAR(*)

The area to store the translated data.

Length of area provided for translated data
INPUT; BINARY(4)

The length of the translated data parameter.
To ensure sufficient space, specify an area at least as large as the length of data to translate. Be sure to add any space necessary for padding.
If the encrypt mode of operation is CFB 1-bit, this length must be specified in bits.

Length of translated data returned
OUTPUT; BINARY(4)

The length of the translated data returned in the translated data parameter.
If the length of area provided for the translated data is too small, an error will be generated and no data will be returned in the translated data parameter.
If the encrypt mode of operation is CFB 1-bit, the length will be returned in bits.

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

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF3C1E E Required parameter &1 omitted.
CPF3CF1 E Error code parameter not valid.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.
CPF9DC2 E Key-encrypting algorithm context not compatible with key-encrypting key context.
CPF9DC3 E Encrypted data contains invalid padding.
CPF9DC6 E Algorithm not valid for encrypting or decrypting a key.
CPF9DD4 E Length of clear data not valid.
CPF9DD5 E Length of input data not valid.
CPF9DD6 E Length of area provided for output data is too small.
CPF9DD7 E The key-encrypting key context for the specified key is not valid or was previously destroyed.
CPF9DD8 E The key-encrypting algorithm context for the specified key is not valid or was previously destroyed.
CPF9DDA E Unexpected return code &1.
CPF9DDB E The key string or Diffie-Hellman parameter string is not valid.
CPF9DDD E The key string length is not valid.
CPF9DE3 E Mode not valid.
CPF9DEC E Cryptographic service provider not valid.
CPF9DF0 E Operation, algorithm, or mode not available on the requested CSP (cryptographic service provider).
CPF9DF1 E The algorithm context token does not reference a valid algorithm context.
CPF9DF2 E The algorithm context is not found or was previously destroyed.
CPF9DF3 E Algorithm in algorithm context not valid for requested operation.
CPF9DF4 E The key context token does not reference a valid key context.
CPF9DF5 E The key context is not found or was previously destroyed.
CPF9DF7 E Algorithm context not compatible with key context.
CPF9DF8 E Cryptographic device name not valid.
CPF9DF9 E Cryptographic device not found.
CPF9DFB E Cryptographic service provider (CSP) conflicts with the key context CSP.
CPF9DFD E Not authorized to device.
CPF9DFE E Cryptographic device not available.
CPF9DFF E Request not allowed by cryptographic attributes.



API introduced: V5R3
Top | Cryptographic Services APIs | APIs by category