RXS_Crypt()
This subprocedure performs cryptographic operations like hashing and encryption. Currently supported operations are:
- MD5
- SHA1
- SHA256
- SHA384
- SHA512
Subprocedure Prototype
|
Returns the output of the specified hashing/crytographic operation is returned. |
|
Field to hold the input of the selected hashing/crytographic operation. You can pass a field smaller than 16M without any additional effort. |
|
Holds settings which control how RXS_Crypt operates. This parm can accomodate a number of possible data structures, listed below. |
|
|
|
Field to hold the output of the selected hashing/crytographic operation. Note that if you pass a field smaller than 16M, you will need to specify the length of the Output in the subfield OutputLength. |
|
Field to hold the input of the selected hashing/crytographic operation. You can pass a field smaller than 16M without any additional effort. |
|
Holds settings which control how RXS_Crypt operates. This parm can accomodate a number of possible data structures, listed below. |
Example Code
*--------------------------------------------------------------
* This example code calculates an MD5 hash from a character field.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D HashMD5DS DS LikeDS(RXS_MD5CryptDS_t)
D Data S Like(RXS_Var1Kv_t)
D Hash S Like(RXS_Var1Kv_t)
/free
Data = 'Hello World';
RXS_ResetDS( HashMD5DS : RXS_DS_TYPE_MD5CRYPT );
Hash = RXS_Crypt( Data : HashMD5DS );
RXS_JobLog( 'Hash: %s' : Hash ); // Output: Hash: B10A8DB164E0754105B7A99BE72E3FE5
*INLR = *ON;
/end-free
*--------------------------------------------------------------
* This example code calculates an MD5 hash from a character field.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/define RXSV6R1
/copy QRPGLECPY,RXSCB
D HashMD5DS DS LikeDS(RXS_MD5CryptDS_t)
D Data S Like(RXS_Var1Kv_t)
D Hash S Like(RXS_Var1Kv_t)
/free
Data = 'Hello World';
RXS_ResetDS( HashMD5DS : RXS_DS_TYPE_MD5CRYPT );
RXS_Crypt( Hash : Data : HashMD5DS );
RXS_JobLog( 'Hash: %s' : Hash ); // Output: Hash: B10A8DB164E0754105B7A99BE72E3FE5
*INLR = *ON;
/end-free
Data Structures
|
|
|
|
|
|
|
Optional IFS stream file to use as input data for hash operation. |
|
CCSID of input data. Used when the input data is of a different CCSID of the job CCSID. Not necessary if using InputStmf. |
|
CCSID to convert the input data into before hashing. Note that this is typically going to be RXS_ISO88591 or RXS_UTF8. |
|
Internal use only |
|
Internal use only |
|
Internal use only |
|
Internal use only |
|
Internal use only |
|
|
|
|
|
|
|
Determines which SHA algorithm/block size to use when hashing. Valid Values:
|
|
Optional IFS stream file to use as input data for hash operation. |
|
CCSID of input data. Used when the input data is of a different CCSID of the job CCSID. Not necessary if using InputStmf. |
|
CCSID to convert the input data into before hashing. Note that this is typically going to be RXS_ISO88591 or RXS_UTF8. |
|
Internal use only |
|
Internal use only |
|
Internal use only |
|
Internal use only |
|
Internal use only |