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

240 lines
7.5 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/19/02 -->
<!-- Change history: -->
<!-- 031021 BILLINGS Review 3 updates -->
<!-- end header records -->
<title>Generate Diffie-Hellman parameters (QC3GENDP, Qc3GenDHParms)</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>Generate Diffie-Hellman Parameters (QC3GENDP, Qc3GenDHParms)</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%">Key size
</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%">2
</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%">3
</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%">4
</td><td align="left" valign="top" width="60%">D-H parms
</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%">5
</td><td align="left" valign="top" width="60%">Length of area provided for D-H parms
</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%">6
</td><td align="left" valign="top" width="60%">Length of D-H parms 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%">7
</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: QC3DH<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>Diffie-Hellman (D-H) is a public key algorithm used for producing a shared secret key.
It is described in RFC 2631 and Public Key Cryptography Standard (PKCS) #3.
The output from the Generate Diffie-Hellman Parameters (OPM, QC3GENDH; ILE, Qc3GenDHParms)
API is used in generating a D-H key pair
(<a href="qc3gendk.htm">Generate Diffie-Hellman Key Pair (OPM, QC3GENDK; ILE, Qc3GenDHKeyPair) API</a>).
These parameters are not secret and must be given to the party (or parties) with whom a secret key will
be shared. Alternatively, the D-H parameters may be supplied by another party.</p>
<p>Information on cryptographic standards can be found in the <a href=
"qc3crtax.htm">Create Algorithm Context (OPM, QC3CRTAX; ILE,
Qc3CreateAlgorithmContext)</a> API documentation.</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>Key size</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the modulus in bits.<br>
The key size must be a multiple of 64 with a minimum size of 512 and a maximum size of 1024.
</p>
</dd>
<dt><strong>Cryptographic service provider</strong></dt>
<dd>INPUT; CHAR(1)
<p>The cryptographic service provider (CSP) that will perform the D-H operation.</p>
<table width="95%">
<tr>
<td align="left" valign="top" width="5%"><strong>1</strong></td>
<td align="left" valign="top" width="95%">Software CSP.<br>
The system will perform the D-H operation using software.</td>
</tr>
</table>
</dd>
<dt><strong>Cryptographic device name</strong></dt>
<dd>INPUT; CHAR(10)
<p>This parameter must be set to blanks or the pointer to this parameter set to NULL.</p>
</dd>
<dt><strong>D-H parms</strong></dt>
<dd>OUTPUT; CHAR(*)
<p>The area to store the D-H parameters.<br>
The generated D-H parameters will be returned in BER encoded PKCS #3 format. For specifications of this format, refer to RSA Security Inc. Public-Key Cryptography Standards. The D-H parameters are used in generating a Diffie-Hellman key pair and must be given to the party with whom the secret key will be shared. The generated parameters are not sensitive and need not be kept secret. </p>
</dd>
<dt><strong>Length of area provided for D-H parms</strong></dt>
<dd>INPUT; BINARY(4)
<p>The length of the D-H parms parameter.<br>
The maximum length needed (with a key size of 1024) is 288 bytes.</p>
</dd>
<dt><strong>Length of D-H parms returned</strong></dt>
<dd>OUTPUT; BINARY(4)
<p>The length of the generated D-H parameters returned in the D-H parms parameter.<br>
If the length of area provided is too small, an error will be generated and no data will be returned in the D-H parms parameter.</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>Error Messages</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">CPF9DD6 E</td>
<td valign="top">Length of area provided for output data is too small.</td>
</tr>
<tr>
<td valign="top">CPF9DDA E</td>
<td valign="top">Unexpected return code &amp;1.</td>
</tr>
<tr>
<td valign="top">CPF9DEA E</td>
<td valign="top">Key size 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">CPF9DF8 E</td>
<td valign="top">Cryptographic device name not valid.</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="sec1.htm">Other APIs in this part</a>
| <a href="aplist.htm">APIs by category</a>
</td></tr>
</table>
</center>
</body></html>