BIF DIGEST

Calculate the SHA-1 digest of a string of data.

Read syntax diagramSkip visual syntax diagram
BIF DIGEST

>>-BIF--DIGEST--RECORD(data-value)--RECORDLEN(data-value)------->

   .-HEX--------------.                      
>--+------------------+--RESULT(data-area)---------------------><
   +-BINARY-----------+                      
   +-BASE64-----------+                      
   '-DIGESTTYPE(cvda)-'                      

Conditions: INVREQ, LENGERR

This command is threadsafe.

Description

The BIF DIGEST command is a CICS built-in function that calculates the SHA-1 digest of a string of data. The result can be returned as binary (20 bytes long), hexadecimal (40 bytes long), or base64-encoded (28 bytes long). The SHA-1 digest is a cryptographically strong checksum of the string, so for practical purposes it is unique for each string.

This command uses z/Architecture message security assist (MSA) functions which require z Systems™ cryptographic hardware with CP Assist for Cryptographic Functions (CPACF). For more information, see the z/OS Cryptographic Services Integrated Cryptographic Service Facility Overview.

Options

RECORD(data-value)
Specifies the string of data for which the digest is to be calculated.
RECORDLEN(data-value)
Specifies the length, as a fullword binary value, of the data string.
DIGESTTYPE(cvda)
Specifies the format in which the digest is returned.
HEX
Hexadecimal, which produces a result 40 bytes long, encoded as hexadecimal characters (0 - 9, A - F).
BINARY
Binary, which produces a result 20 bytes long.
BASE64
Base64 encoding, which produces a result 28 bytes long, using the characters A - Z, a - z, 0 - 9, +, /, =.
RESULT(data-area)
Returns the SHA-1 digest of the data string in the format specified by the DIGESTTYPE option. The length of the result depends on the requested format.

Conditions

16 INVREQ
RESP2 values:
1
DIGESTTYPE has an invalid CVDA value.
3
z/Architecture message security assist (MSA) is not available.
22 LENGERR
RESP2 values:
2
The RECORDLEN value is less than 1.


dfhp4_bifdigest.html | Timestamp icon Last updated: Thursday, 27 June 2019