225 lines
11 KiB
HTML
225 lines
11 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="Example: ILE RPG program for initializing a key store for your Cryptographic Coprocessor" />
|
|
<meta name="abstract" content="Change this program example to suit your needs for initializing a key store for your Cryptographic Coprocessor." />
|
|
<meta name="description" content="Change this program example to suit your needs for initializing a key store for your Cryptographic Coprocessor." />
|
|
<meta name="DC.Relation" scheme="URI" content="rzajcinitialstore.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="inzpkeystrpg" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- 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. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Example: ILE RPG program for initializing a key store for your Cryptographic
|
|
Coprocessor</title>
|
|
</head>
|
|
<body id="inzpkeystrpg"><a name="inzpkeystrpg"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: ILE RPG program for initializing a key store for your Cryptographic
|
|
Coprocessor</h1>
|
|
<div><p>Change this program example to suit your needs for initializing
|
|
a key store for your Cryptographic Coprocessor. </p>
|
|
<div class="section"><div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm#codedisclaimer">Code license and disclaimer information</a> for
|
|
important legal information.<p>If you choose to use this program example,
|
|
change it to suit your specific needs. For security reasons, IBM<sup>®</sup> recommends
|
|
that you individualize these program examples rather than using the default
|
|
values provided.</p>
|
|
</div>
|
|
</div>
|
|
<div class="example"> <pre> D*************************************************************
|
|
D* INZPKAST
|
|
D*
|
|
D* Create key store files for PKA keys.
|
|
D*
|
|
D*
|
|
D* COPYRIGHT 5769-SS1 (C) IBM CORP. 2000, 2000
|
|
D*
|
|
D* This material contains programming source code for your
|
|
D* consideration. These example has not been thoroughly
|
|
D* tested under all conditions. IBM, therefore, cannot
|
|
D* guarantee or imply reliability, serviceability, or function
|
|
D* of these programs. All programs contained herein are
|
|
D* provided to you "AS IS". THE IMPLIED WARRANTIES OF
|
|
D* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
D* ARE EXPRESSLY DISCLAIMED. IBM provides no program services for
|
|
D* these programs and files.
|
|
D*
|
|
D*
|
|
D* Note: Input format is more fully described in Chapter 2 of
|
|
D* IBM CCA Basic Services Reference and Guide
|
|
D* (SC31-8609) publication.
|
|
D*
|
|
D* Parameters: None
|
|
D*
|
|
D* Example:
|
|
D* CALL PGM(INZPKEYST) ('QGPL/PKAKEYS')
|
|
D*
|
|
D* Use these commands to compile this program on the system:
|
|
D* CRTRPGMOD MODULE(INZPKAST) SRCFILE(SAMPLE)
|
|
D* CRTPGM PGM(INZPKEYST) MODULE(INZPKEYST)
|
|
D* BNDSRVPGM(QCCA/CSNBKSI)
|
|
D*
|
|
D* Note: Authority to the CSNBKSI service program in the
|
|
D* QCCA library is assumed.
|
|
D*
|
|
D* The Common Cryptographic Architecture (CCA) verbs used are
|
|
D* Key_Store_Initialize (CSNBKSI)
|
|
D*
|
|
D**************************************************************
|
|
D*------------------------------------------------
|
|
D* Declare variables for CCA SAPI calls
|
|
D*------------------------------------------------
|
|
D* ** Return code
|
|
DRETURNCODE S 9B 0
|
|
D* ** Reason code
|
|
DREASONCODE S 9B 0
|
|
D* ** Exit data length
|
|
DEXITDATALEN S 9B 0
|
|
D* ** Exit data
|
|
DEXITDATA S 4
|
|
D* ** Rule array count
|
|
DRULEARRAYCNT S 9B 0
|
|
D* ** Rule array
|
|
DRULEARRAY S 16
|
|
D* ** File name length
|
|
DFILENAMELEN S 9B 0
|
|
D* ** File name
|
|
DFILENAME S 21
|
|
D* ** Description length
|
|
DDESCRIPLEN S 9B 0
|
|
D* ** Description
|
|
DDESCRIP S 16
|
|
D* ** Master key part
|
|
DMASTERKEY S 24
|
|
D*
|
|
D**********************************************************
|
|
D* Prototype for Key_Store_Initialize (CSNBKSI)
|
|
D**********************************************************
|
|
DCSNBKSI PR
|
|
DRETCODE 9B 0
|
|
DRSNCODE 9B 0
|
|
DEXTDTALEN 9B 0
|
|
DEXTDTA 4
|
|
DRARRAYCT 9B 0
|
|
DRARRAY 16
|
|
DFILENMLN 9B 0
|
|
DFILENM 21
|
|
DDSCPLN 9B 0
|
|
DDSCRP 16
|
|
DMSTRKY 24
|
|
D*
|
|
D*-------------------------------------------------------------
|
|
D* ** Declares for sending messages to the
|
|
D* ** job log using the QMHSNDPM API
|
|
D*-------------------------------------------------------------
|
|
DMSG S 75 DIM(2) CTDATA PERRCD(1)
|
|
DMSGLENGTH S 9B 0 INZ(75)
|
|
D DS
|
|
DMSGTEXT 1 75
|
|
DFAILRETC 41 44
|
|
DFAILRSNC 46 49
|
|
DMESSAGEID S 7 INZ(' ')
|
|
DMESSAGEFILE S 21 INZ(' ')
|
|
DMSGKEY S 4 INZ(' ')
|
|
DMSGTYPE S 10 INZ('*INFO ')
|
|
DSTACKENTRY S 10 INZ('* ')
|
|
DSTACKCOUNTER S 9B 0 INZ(2)
|
|
DERRCODE DS
|
|
DBYTESIN 1 4B 0 INZ(0)
|
|
DBYTESOUT 5 8B 0 INZ(0)
|
|
D*
|
|
C**************************************************************
|
|
C* START OF PROGRAM *
|
|
C**************************************************************
|
|
C *ENTRY PLIST
|
|
C PARM FILENAME
|
|
C*------------------------------------------------------------*
|
|
C* Set the keyword in the rule array *
|
|
C*------------------------------------------------------------*
|
|
C MOVEL 'PKA ' RULEARRAY
|
|
C MOVE 'CURRENT ' RULEARRAY
|
|
C Z-ADD 2 RULEARRAYCNT
|
|
C*------------------------------------------------------------*
|
|
C* Set the description length *
|
|
C*------------------------------------------------------------*
|
|
C Z-ADD 0 DESCRIPLEN
|
|
C*------------------------------------------------------------*
|
|
C* Find the file name length *
|
|
C*------------------------------------------------------------*
|
|
C EVAL FILENAMELEN = %LEN(%TRIM(FILENAME))
|
|
C**************************************************************
|
|
C* Call Key Store Initialize SAPI *
|
|
C**************************************************************
|
|
C CALLP CSNBKSI (RETURNCODE:
|
|
C REASONCODE:
|
|
C EXITDATALEN:
|
|
C EXITDATA:
|
|
C RULEARRAYCNT:
|
|
C RULEARRAY:
|
|
C FILENAMELEN:
|
|
C FILENAME:
|
|
C DESCRIPLEN:
|
|
C DESCRIP:
|
|
C MASTERKEY)
|
|
C* *------------------------*
|
|
C* * Check the return code *
|
|
C* *------------------------*
|
|
C RETURNCODE IFGT 4
|
|
C* *-----------------------*
|
|
C* * Send failure message *
|
|
C* *-----------------------*
|
|
C MOVEL MSG(1) MSGTEXT
|
|
C MOVE RETURNCODE FAILRETC
|
|
C MOVE REASONCODE FAILRSNC
|
|
C EXSR SNDMSG
|
|
C RETURN
|
|
C ENDIF
|
|
C*
|
|
C* *-----------------------*
|
|
C* * Send success message *
|
|
C* *-----------------------*
|
|
C MOVEL MSG(2) MSGTEXT
|
|
C EXSR SNDMSG
|
|
C*
|
|
C SETON LR
|
|
C*
|
|
C**************************************************************
|
|
C* Subroutine to send a message
|
|
C**************************************************************
|
|
C SNDMSG BEGSR
|
|
C CALL 'QMHSNDPM'
|
|
C PARM MESSAGEID
|
|
C PARM MESSAGEFILE
|
|
C PARM MSGTEXT
|
|
C PARM MSGLENGTH
|
|
C PARM MSGTYPE
|
|
C PARM STACKENTRY
|
|
C PARM STACKCOUNTER
|
|
C PARM MSGKEY
|
|
C PARM ERRCODE
|
|
C ENDSR
|
|
**
|
|
CSNBKSI failed with return/reason codes 9999/9999.
|
|
The file was succesully initialized.</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajcinitialstore.htm" title="A key store file is a database file that stores operational keys, i.e. keys encrypted under the master key. Read this information if you plan to keep records of your DES and PKA keys.">Initialize a key store file</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |