ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/qc3trndt.htm

409 lines
13 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<!-- Begin Header Records -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Created for V5R3 by beth hagemeister 6/4/02 -->
<!-- Change history: -->
<!-- 031020 BILLINGS Review 3 updates -->
<!-- end header records -->
<title>Translate Data (QC3TRNDT, Qc3TranslateData)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="Top_Of_Page"></a>
<!--Java sync-link-->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<h2>Translate Data (QC3TRNDT, Qc3TranslateData)</h2>
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Required Parameter Group:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="top" width="10%">1
</td><td align="left" valign="top" width="60%">Data to translate
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(*)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">2
</td><td align="left" valign="top" width="60%">Length of data to translate
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Binary(4)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">3
</td><td align="left" valign="top" width="60%">Decrypt algorithm context token
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(8)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">4
</td><td align="left" valign="top" width="60%">Decrypt key context token
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(8)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">5
</td><td align="left" valign="top" width="60%">Encrypt algorithm context token
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(8)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">6
</td><td align="left" valign="top" width="60%">Encrypt key context token
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(8)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">7
</td><td align="left" valign="top" width="60%">Cryptographic service provider
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(1)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">8
</td><td align="left" valign="top" width="60%">Cryptographic device name
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Char(10)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">9
</td><td align="left" valign="top" width="60%">Translated data
</td><td align="left" valign="top" width="15%">Output
</td><td align="left" valign="top" width="15%">Char(*)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">10
</td><td align="left" valign="top" width="60%">Length of area provided for translated data
</td><td align="left" valign="top" width="15%">Input
</td><td align="left" valign="top" width="15%">Binary(4)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">11
</td><td align="left" valign="top" width="60%">Length of translated data returned
</td><td align="left" valign="top" width="15%">Output
</td><td align="left" valign="top" width="15%">Binary(4)
</td></tr>
<tr>
<td align="center" valign="top" width="10%">12
</td><td align="left" valign="top" width="60%">Error code
</td><td align="left" valign="top" width="15%">I/O
</td><td align="left" valign="top" width="15%">Char(*)
</td></tr>
</table>
<br>
&nbsp;&nbsp;Service Program Name: QC3DTATR<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The Translate Data (OPM, QC3TRNDT; ILE, Qc3TranslateData) API translates data from
encryption under one key to encryption under another key.</p>
<br>
<h3>Authorities and Locks</h3>
<dl>
<dt><strong>Required API authority</strong></dt>
<dd>*USE<br><br></dd>
<dt><strong>Required device description authority</strong></dt>
<dd>*USE<br><br></dd>
</dl>
<br>
<h3>Required Parameter Group</h3>
<dl>
<dt><strong>Data to translate</strong></dt>
<dd>INPUT; CHAR(*)
<p>The data to be decrypted and encrypted again.
</p>
</dd>
<dt><strong>Length of data to translate</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of data in the data to translate parameter.<br>
If the decrypt mode of operation is CFB 1-bit, the length must be specified in bits.
</p>
</dd>
<dt><strong>Decrypt algorithm context token</strong><br></dt>
<dd>INPUT; CHAR(8)
<p>The token for the algorithm context to use for decrypting the data.<br>
The algorithm context is created using the <a href = "qc3crtax.htm">Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API</a>.<br>
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.).
</p>
</dd>
<dt><strong>Decrypt key context token</strong></dt>
<dd>INPUT; CHAR(8)
<p>The token for the key context to use for decrypting the data.<br>
The key context is created using the <a href = "qc3crtkx.htm">Create Key Context (OPM, QC3CRTKX; ILE, Qc3CreateKeyContext) API</a>.</p>
</dd>
<dt><strong>Encrypt algorithm context token</strong><br></dt>
<dd>INPUT; CHAR(8)
<p>The token for the algorithm context to use for encrypting the data.<br>
The algorithm context is created using the <a href = "qc3crtax.htm">Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API</a>.
</p>
</dd>
<dt><strong>Encrypt key context token</strong></dt>
<dd>INPUT; CHAR(8)
<p>The token for the key context to use for encrypting the data.<br>
The key context is created using the <a href = "qc3crtkx.htm">Create Key Context (OPM, QC3CRTKX; ILE, Qc3CreateKeyContext) API</a>.</p>
</dd>
<dt><strong>Cryptographic service provider</strong></dt>
<dd>INPUT; CHAR(1)
<p>The cryptographic service provider (CSP) that will perform the translate operation.</p>
<table width="95%">
<tr>
<td align="left" valign="top" width="5%"><strong>0</strong></td>
<td align="left" valign="top" width="95%">Any CSP.<br>
The system will choose an appropriate CSP to perform the translate operation.</td>
</tr>
<tr>
<td align="left" valign="top"><strong>1</strong></td>
<td align="left" valign="top">Software CSP.<br>
The system will perform the translate operation using software. If the requested algorithms are not available in software, an error is returned.</td>
</tr>
<tr>
<td align="left" valign="top"><strong>2</strong></td>
<td align="left" valign="top">Hardware CSP.<br>
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.</td>
</tr>
</table>
</dd>
<dt><strong>Cryptographic device name</strong></dt>
<dd>INPUT; CHAR(10)
<p>The name of a cryptographic device description.<br>
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.</p>
</dd>
<dt><strong>Translated data</strong></dt>
<dd>OUTPUT; CHAR(*)
<p>The area to store the translated data.<br>
</p>
</dd>
<dt><strong>Length of area provided for translated data</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the translated data parameter.<br>
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.<br>
If the encrypt mode of operation is CFB 1-bit, this length must be specified in bits.</p>
</dd>
<dt><strong>Length of translated data returned</strong></dt>
<dd>OUTPUT; BINARY(4)
<p>The length of the translated data returned in the translated data parameter.<br>
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.<br>
If the encrypt mode of operation is CFB 1-bit, the length will be returned in bits.
</p>
</dd>
<dt><strong>Error code</strong></dt>
<dd>I/O; CHAR(*)
<p>The structure in which to return error information.<br>
For the format of the structure, see <a href="../apiref/error.htm#hdrerrcod">Error Code Parameter</a>. </p></dd>
</dl>
<br>
<h3><a name="header_9">Error Messages</a></h3>
<table width="100%">
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td valign="top" width="15%">CPF24B4 E</td>
<td valign="top" width="85%">Severe error while addressing parameter list.</td>
</tr>
<tr>
<td valign="top">CPF3C1E E</td>
<td valign="top">Required parameter &amp;1 omitted.</td>
</tr>
<tr>
<td valign="top">CPF3CF1 E</td>
<td valign="top">Error code parameter not valid.</td>
</tr>
<tr>
<td valign="top">CPF9872 E</td>
<td valign="top">Program or service program &amp;1 in library &amp;2 ended. Reason code &amp;3.</td>
</tr>
<tr>
<td valign="top">CPF9DC2 E</td>
<td valign="top">Key-encrypting algorithm context not compatible with key-encrypting key context.</td>
</tr>
<tr>
<td valign="top">CPF9DC3 E</td>
<td valign="top">Encrypted data contains invalid padding.</td>
</tr>
<tr>
<td valign="top">CPF9DC6 E</td>
<td valign="top">Algorithm not valid for encrypting or decrypting a key.</td>
</tr>
<tr>
<td valign="top">CPF9DD4 E</td>
<td valign="top">Length of clear data not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DD5 E</td>
<td valign="top">Length of input data not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DD6 E</td>
<td valign="top">Length of area provided for output data is too small.</td>
</tr>
<tr>
<td valign="top">CPF9DD7 E</td>
<td valign="top">The key-encrypting key context for the specified key is not valid or was previously destroyed.</td>
</tr>
<tr>
<td valign="top">CPF9DD8 E</td>
<td valign="top">The key-encrypting algorithm context for the specified key is not valid or was previously destroyed.</td>
</tr>
<tr>
<td valign="top">CPF9DDA E</td>
<td valign="top">Unexpected return code &amp;1.</td>
</tr>
<tr>
<td valign="top">CPF9DDB E</td>
<td valign="top">The key string or Diffie-Hellman parameter string is not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DDD E</td>
<td valign="top">The key string length is not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DE3 E</td>
<td valign="top">Mode not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DEC E</td>
<td valign="top">Cryptographic service provider not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DF0 E</td>
<td valign="top">Operation, algorithm, or mode not available on the requested CSP (cryptographic service provider).</td>
</tr>
<tr>
<td valign="top">CPF9DF1 E</td>
<td valign="top">The algorithm context token does not reference a valid algorithm context.</td>
</tr>
<tr>
<td valign="top">CPF9DF2 E</td>
<td valign="top">The algorithm context is not found or was previously destroyed.</td>
</tr>
<tr>
<td valign="top">CPF9DF3 E</td>
<td valign="top">Algorithm in algorithm context not valid for requested operation.</td>
</tr>
<tr>
<td valign="top">CPF9DF4 E</td>
<td valign="top">The key context token does not reference a valid key context.</td>
</tr>
<tr>
<td valign="top">CPF9DF5 E</td>
<td valign="top">The key context is not found or was previously destroyed.</td>
</tr>
<tr>
<td valign="top">CPF9DF7 E</td>
<td valign="top">Algorithm context not compatible with key context.</td>
</tr>
<tr>
<td valign="top">CPF9DF8 E</td>
<td valign="top">Cryptographic device name not valid.</td>
</tr>
<tr>
<td valign="top">CPF9DF9 E</td>
<td valign="top">Cryptographic device not found.</td>
</tr>
<tr>
<td valign="top">CPF9DFB E</td>
<td valign="top">Cryptographic service provider (CSP) conflicts with the key context CSP.</td>
</tr>
<tr>
<td valign="top">CPF9DFD E</td>
<td valign="top">Not authorized to device.</td>
</tr>
<tr>
<td valign="top">CPF9DFE E</td>
<td valign="top">Cryptographic device not available.</td>
</tr>
<tr>
<td valign="top">CPF9DFF E</td>
<td valign="top">Request not allowed by cryptographic attributes.</td>
</tr>
</table>
<br>
<br>
<hr>
API introduced: V5R3
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center"><td valign="middle" align="center">
<a href="#Top_Of_Page">Top</a>
| <a href="catcrypt.htm">Cryptographic Services APIs</a>
| <a href="aplist.htm">APIs by category</a>
</td></tr>
</table>
</center>
</body></html>