Parameters

The parameters for CSNBRNGL.

For the definitions of the return_code, reason_code, exit_data_length, and exit_data parameters, see Parameters common to all verbs.

rule_array_count
Direction: Input
Type: Integer
A pointer to an integer variable containing the number of elements in the rule_array variable. This value must be 1 or 2.
rule_array
Direction: Input
Type: String array
A pointer to a string variable containing an array of keywords. The keywords are eight bytes in length, and must be left-aligned and padded on the right with space characters. The rule_array keywords are described in Table 1.
Table 1. Keywords for Random Number Generate Long control information

Keywords for Random Number Generate Long control information

Keyword Description
Parity adjust (One required)
EVEN Specifies that each generated random byte is adjusted for even parity.
ODD Specifies that each generated random byte is adjusted for odd parity.
RANDOM Specifies that each generated random byte is not adjusted for parity.
RT-KRD RANDOM bytes are generated that are not adjusted for parity. The random bytes are returned in the random_number parameter formatted as a TR-34 Key Receiving Device (KRD) Random Number Token, or (RT-KRD). The user must allocate the random_number_length bytes requested in the random_number buffer plus an additional 21 bytes to allow for encoding and overhead.
Encryption Method (One, optional)
TDES-CBC Specifies to return the generated random number Triple-DES encrypted using the key specified in the key_identifier parameter. Must be a double or triple length key.
key_identifier_length
Direction: Input
Type: Integer
A pointer to an integer variable containing the number of bytes of data in the key_identifier variable.
key_identifier
Direction: Input
Type: String
A pointer to a string variable containing an internal key-token or the key label of an internal key-token record. For CCA tokens, use a key type of CIPHER or ENCIPHER and double or triple length only.

For TR-31 tokens, use the following attributes:

  • TR-31 key usage: D0
  • Algorithm: T
  • TR-31 mode of key use: B or E
random_number_length
Direction: Input/Output
Type: Integer
A pointer to an integer variable containing the number of bytes in the random_number variable. On input, the minimum value is 1 and the maximum value is 8192.

Use this variable to specify the number of random bytes that the verb is to return. On output, this variable contains the number of bytes returned by the verb in the random_number variable.

When the keyword RT-KRD is requested: The user must allocate the random_number_length bytes requested in the random_number buffer plus an additional 21 bytes to allow for encoding and overhead. On output the actual size of the RT-KRD token, including overhead, is written to this variable. If the maximum RT-KRD size is 200 bytes, the maximum random number size is 179 bytes.

When the requested rule array keyword is TDES-CBC, the value must be a multiple of 8. The maximum value is 1024.

random_number
Direction: Output
Type: String
A pointer to a string variable containing the random number generated.

When the keyword RT-KRD is requested: The user must allocate the random_number_length bytes requested in the random_number buffer plus an additional 21 bytes to allow for encoding and overhead.