Verify Signature (QC3VFYSG, Qc3VerifySignature) API


  Required Parameter Group:


  Service Program Name: QC3SIGVR

  Default Public Authority: *USE

  Threadsafe: Yes

The Verify Signature (OPM, QC3VFYSG; ILE, Qc3VerifySignature) API verifies a digital signature is correctly related to the input data. If the verification fails with a CPF9DEF, the input data has been corrupted. A digital signature is created by hashing data and encrypting the hash value using a public key algorithm (PKA). A digital signature can be created by using the Calculate Signature (OPM, QC3CALSG; ILE, Qc3CalculateSignature) API.

Information on cryptographic standards can be found in Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API.

Authorities and Locks

Required device description authority
*USE

Required file authority
*OBJOPR, *READ

Required Parameter Group

Signature
INPUT; CHAR(*)

The digital signature to verify.

Length of signature
INPUT; BINARY(4)

The length of signature should be equal to the key size (size of the modulus), but expressed in bytes.

Input data
INPUT; CHAR(*)

The data to verify.
The format of the input data is specified in the input data format name parameter.

Length of input data
INPUT; BINARY(4)

For input data format DATA0100, this is the length of the data to verify.
For input data format DATA0200, this is the number of entries in the array.

Input data format name
INPUT; CHAR(8)

The format of the input data parameter.
The possible format names follow.

DATA0100
The input data parameter contains the data to verify.

DATA0200
The input data parameter contains an array of pointers and lengths to the data to verify.
See Input Data Formats for a description of this format.

Algorithm description
INPUT; CHAR(*)

The algorithm and associated parameters for verifying the data.
The format of the algorithm description is specified in the algorithm description format name parameter.

Algorithm description format name
INPUT; CHAR(8)

The format of the algorithm description.
The possible format names follow.

ALGD0100
The token for an algorithm context. This format must be used when performing the verify signature operation over multiple calls. After the last call (when the final operation flag is on), the context will reset to its initial state and can be used in another API.

ALGD0400
Parameters for a verify signature operation.

ALGD0600
Parameters for an elliptic curve sign operation (ECDSA).

See Algorithm Description Formats for a description of these formats.

Key description
INPUT; CHAR(*)

The key and associated parameters for verifying the data.
The format of the key description is specified in the key description format name parameter.
If the verify operation extends over multiple calls (see ALGD0100 description above), only the key description from the first call will be used. Therefore, on subsequent calls, you may set the pointer to this parameter to NULL.

Key description format name
INPUT; CHAR(8)

The format of the key description.
If the pointer to the key description parameter is NULL, this parameter will be ignored.
The possible format names follow.

KEYD0100
The token for a key context. This format identifies a key context. A key context is used to store a key value so it need not be recreated or retrieved every time it is used. To create a key context, use the Create Key Context (OPM, QC3CRTKX; ILE, Qc3CreateKeyContext) API.

KEYD0200
Key parameters.

KEYD0400
Keystore label. This format identifies a key from keystore. For more information about cryptographic services keystore, see Cryptographic Services Keystore.

KEYD0600
PEM certificate. This format uses the PKA key in an ASCII encoded PEM based certificate.

KEYD0700
Certificate label. This format uses the public PKA key identified by a label into signature verification certificate keystore (*SIGNATUREVERIFICATION).

KEYD0800
Distinguished name. This format uses the public PKA key identified by a distinguished name for a certificate in signature verification certificate keystore (*SIGNATUREVERIFICATION).

See Key Description Formats for a description of these formats.

Cryptographic service provider
INPUT; CHAR(1)

The cryptographic service provider (CSP) that will perform the verify signature operation.


Cryptographic device name
INPUT; CHAR(10)

The name of a cryptographic device description.
This parameter is valid when the cryptographic service provider parameter specifies 2 (hardware CSP). Otherwise, this parameter must be blanks or the pointer to this parameter set to NULL.

Error code
I/O; CHAR(*)

The structure in which to return error information.
For the format of the structure, see Error code parameter.


Input Data Formats

For detailed descriptions of the table fields, see Input Data Formats Field Descriptions.

DATA0200 Format



Input Data Formats Field Descriptions

Input data length
The length of data to verify.
Input data pointer
A space pointer to the data to verify.
Reserved
Must be null (binary 0s).

Algorithm Description Formats

For detailed descriptions of the table fields, see Algorithm Description Formats Field Descriptions.

ALGD0100 Format

ALGD0400 Format


ALGD0600 Format



Algorithm Description Formats Field Descriptions

Algorithm context token
A token for an algorithm context. The algorithm context is created by using the Create Algorithm Context (OPM, QC3CRTAX; ILE, Qc3CreateAlgorithmContext) API.

Final operation flag
The final processing indicator.


PKA block format
The public key algorithm block format. Following are the valid values.
Public key cipher algorithm
The encryption algorithm. Following are the valid public key cipher algorithms.
Elliptic curve public key algorithm
Following are the valid elliptic curve public key algorithms:
Reserved
Must be null (binary 0s).

Signing hash algorithm
The hash algorithm. Following are the valid values for the signing hash algorithm.
Domain parameters length
The length of elliptic curve ASN.1, BER encoded domain parameters. If no domain parameters are being supplied independently of the keys, this field should be zero and domain parameters pointer should be NULL.
Domain parameters
The elliptic curve ASN.1 BER encoded domain parameters to be used in the event that the ECC key does not already contain domain parameters. If domain parameters are already associated with the key when performing an ECC operation such as ECDSA (See Calculate Signature (OPM, QC3CALSG; ILE, Qc3CalculateSignature) API and Verify Signature (OPM, QC3VFYSG; ILE, Qc3VerifySignature) API) these supplied domain parameters (which will be associated with the Algorithm Context token), will be ignored.

Key Description Formats

For detailed descriptions of the table fields, see Key Description Formats Field Descriptions.

KEYD0100 Format

KEYD0200 Format


KEYD0400 Format


KEYD0600 Format


KEYD0700 Format


KEYD0800 Format



Key Description Formats Field Descriptions

Certificate label
The label of the certificate in signature verification certificate keystore (*SIGNATUREVERIFICATION).

Certificate label length
The length of the certificate label.

Distinguished name
The distinguished name of the certificate in signature verification certificate keystore (*SIGNATUREVERIFICATION).

Distinguished name length
The length of the distinguished name.

File name
The name of a keystore file. Keystore files are created by using the Create Keystore (OPM, QC3CRTKS; ILE, Qc3CreateKeyStore) API.
Key context token
A token for a key context. The key context is created by using the Create Key Context (OPM, QC3CRTKX; ILE, Qc3CreateKeyContext) API.

Key format
The format of the key string field. Following are the valid values.
Key string
The key to use in the verify signature operation.

Key string length
Length of the key string specified in the key string field. The format of the key string is specified in the key format field.

Key type
The type of key. Following are the valid values.
PEM certificate
An ASCII encoded PEM formated certificate.

PEM certificate length
The length of the PEM certificate.

Qualified keystore file name
The keystore file where the key is stored. Keystore files are created by using the Create Keystore (OPM, QC3CRTKS; ILE, Qc3CreateKeyStore) API. The first 10 characters contain the file name. The second 10 characters contain the name of the library where the keystore file is located. You can use the following special values for the library name.
Record label
The label of a key record in a keystore file. The label will be converted from the job CCSID, or if 65535, the job default CCSID (DFTCCSID) job attribute to CCSID 1200 (Unicode UTF-16). The key record may contain either an RSA public or private key. If a private key, the public key is extracted to use in the verify operation. Key records are created by using the Write Key Record (OPM, QC3WRTKR; ILE, Qc3WriteKeyRecord) API or the Generate Key Record (OPM, QC3GENKR; ILE, Qc3GenKeyRecord) API.
Reserved
Must be null (binary 0s).

Error Messages




API introduced: V5R3

[ Back to top | Cryptographic Services APIs | APIs by category ]