IBM Crypto Education Community

IBM Crypto Education Community

IBM Crypto Education Community

Join the IBM Crypto Education community to explore and understand IBM cryptography technology. This community is operated and maintained by the IBM Crypto Development team.

 View Only

Rexx Sample: Key Record Read

By Eysha Shirrine Powers posted Wed March 25, 2020 05:28 PM

  

/* Rexx */
 
/*-----------------------------------------------------------------*/
/* Description:                                                    */
/*                                                                 */
/* Read a record from the PKDS                                     */
/*                                                                 */
/*-----------------------------------------------------------------*/
krr_label = left('SAMPLE.SECRET.AES256.KEY001',64);
 
Call CSNBKRR;
 
Exit;
 
/* --------------------------------------------------------------- */
/* CSNBKRR - Key Record Read (CKDS)                                */
/*                                                                 */
/* Reads a key token from the CKDS.                                */
/*                                                                 */
/* See the ICSF Application Programmer's Guide for more details.   */
/* --------------------------------------------------------------- */
CSNBKRR:
krr_rc = 'FFFFFFFF'x;
krr_rs = 'FFFFFFFF'x;
krr_exit_data_length = '00000000'x;
krr_exit_data    = '';
krr_token        = copies('00'x, 64);
 
ADDRESS LINKPGM "CSNBKRR",
                "krr_rc",
                "krr_rs",
                "krr_exit_data_length",
                "krr_exit_data",
                "krr_label",
                "krr_token";
 
if (KRR_RC /= '00000000'x) Then
  say 'KRR Failed   (rc=' c2x(KRR_RC)' rs='c2x(KRR_RS)')' ;
else
  say "Secret Key: " c2x(krr_token);
 
 
return;

 

0 comments
16 views

Permalink