Parse Certificate (QSYPARSC, QsyParseCertificate) API


  Required Parameter Group for QSYPARSC:



  Default Public Authority: *USE

  Threadsafe: Yes



  Syntax for QsyParseCertificate:
 #include <qsydigid.h>

 void QsyParseCertificate(
                    char    *Certificate,
                    int      Type,
                    int      Length_of_certificate,
                    char    *Format_name,
                    char    *Receiver_variable,
                    int      Length_of_receiver_variable,
		    void    *Error_code
		    );

  Service Program: QSYDIGID

  Default Public Authority: *USE

  Threadsafe: Yes

The Parse Certificate (OPM, QSYPARSC; ILE, QsyParseCertificate) API parses a certificate and returns the results to the caller.


Authorities and Locks

None.


Required Parameter Group

Certificate
INPUT; CHAR(*)

The entire certificate encoded in Abstract Syntax Notation 1 Distinguished Encoding Rules (ASN.1 DER) format. This is not a text string.

Type
INPUT; BINARY(4)

The type or format of the certificate.

The possible types are:


Length of certificate
INPUT; BINARY(4)

The length of the certificate.

Format
INPUT; CHAR(8)

The format of the parsed certificate.

The possible types are:


Receiver variable
OUTPUT; CHAR(*)

The storage that is provided by the user to hold the certificate text. For more information, see Format of Receiver Variable.

Length of receiver variable
INPUT; BINARY(4)

The length of the storage that is provided by the user.

Error code
I/O; CHAR(*)

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



Usage Notes

If format CERT0200 is specified, the Offset to EIM identifier, Length of EIM identifier, Offset to EIM local registry name, Length of EIM local registry name, Offset to user name, and Length of user name fields will be 0.

Format of Receiver Variable

For details about the format that is returned in the receiver variable, for Format CERT0200 see Certificate Format CERT0200 (Plain Text).

The following tables describe the order and format of the data returned in the receiver variable for Format CERT0210. For detailed descriptions of the fields in the tables, see Field Descriptions.

Note: A distinguished name (DN) consists of the following fields in the order presented:


Certificate Format CERT0210

The CERT0210 format consists of a certificate handle and some of the sections of the certificate parsed into a more readable format. If the length of a field is 0 or the offset to a field is 0, then the field does not contain any information. Either the field is empty, it is not used in the certificate, or it is not recognized. The fields specified by the offsets and lengths in this format are either text or hexadecimal bytes as indicated in the field descriptions.



Field Descriptions

Available length of this certificate and format information. The available length of this certificate and format information. If this length is more than the returned length of this certificate and format information field, then not all of the fields were returned.

Fields specified by their offsets and lengths above. The fields that were specified by their offsets and lengths prior to this field.

Certificate information. The actual data in the certificate. Specific fields can be accessed by using the offset to the specific field.

Format name. The format of the returned output.

Length of ASN.1 format certificate. The length of the ASN.1 DER format certificate. This length refers to a field of hexadecimal bytes.

Start of changeLength of basic constraints Certificate Authority (CA). The length of the field that indicates the basic constraints Certificate Authority (CA).End of change

Start of changeLength of basic constraints path length constraint. The length of the field that indicates the basic constraints path length constraint. This length refers to a field of hexadecimal bytes.End of change

Start of changeLength of Certificate Revocation List (CRL) distribution points distribution point name. The length of the field that indicates the Certificate Revocation List (CRL) distribution points distribution point name.End of change

Start of changeLength of certificate fingerprint. The length of the field that indicates the certificate fingerprint. This length refers to a field of hexadecimal bytes.End of change

Start of changeLength of certificate fingerprint algorithm. The length of the field that indicates the certificate fingerprint algorithm.End of change

Length of certificate handle. The length of the certificate handle. This length refers to a field of hexadecimal bytes.

Start of changeLength of extended key usage identifier. The length of the field that indicates the extended key usage identifier.End of change

Length of issuer's common name. The length of the field that indicates the issuer's common name.

Length of issuer's country or region. The length of the field that indicates the issuer's country or region.

Length of issuer's distinguished name (DN) in DER representation. The length of the field that indicates the issuer's DN in DER representation.

Length of issuer's email address. The length of the field that indicates the issuer's email address.

Length of issuer's locality. The length of the field that indicates the issuer's locality.

Length of issuer's organization. The length of the field that indicates the issuer's organization.

Length of issuer's organizational unit. The length of the field that indicates the issuer's organizational unit.

Length of issuer's postal code. The length of the field that indicates the issuer's postal code.

Length of issuer's state or province. The length of the field that indicates the issuer's state or province.

Length of issuer's unique ID (Version 2). The length of the field that indicates the issuer's unique ID (Version 2). This length refers to a field of hexadecimal bytes.

Start of changeLength of key usage. The length of the field that indicates the key usage. This length refers to a field of hexadecimal bytes.End of change

Start of changeLength of policy identifier. The length of the field that indicates the policy identifier.End of change

Start of changeLength of public key. The length of the field that indicates the public key. This length refers to a field of hexadecimal bytes.End of change

Length of public key in DER representation. The length of the public key. This length refers to a field of hexadecimal bytes.

Start of changeLength of public key size. The length of the field that indicates the public key size. This length refers to a field of hexadecimal bytes which represent the size in bits.End of change

Length of serial number. The length of the field that indicates the serial number.

Start of changeLength of SHA-1 certificate fingerprint. The length of the field that indicates the SHA-1certificate fingerprint. This length refers to a field of hexadecimal bytesEnd of change

Start of changeLength of SHA-256 certificate fingerprint. The length of the field that indicates the SHA-256 certificate fingerprint. This length refers to a field of hexadecimal bytesEnd of change

Start of changeLength of signature algorithm. The length of the field that indicates the signature algorithm.End of change

Start of changeLength of subject alternative name directory name. The length of the field that indicates the subject alternative name directory name.End of change

Start of changeLength of subject alternative name Domain Name System (DNS) name. The length of the field that indicates the subject alternative name Domain Name System (DNS) name.End of change

Start of changeLength of subject alternative name IP address. The length of the field that indicates the subject alternative name IP address. This length refers to a field of hexadecimal bytes and is based on the IP address format, 4 for IPv4 and 16 for IPv6.End of change

Start of changeLength of subject alternative name RFC 822 name. The length of the field that indicates the subject alternative name RFC 822 name.End of change

Start of changeLength of subject alternative name Uniform Resource Identifier (URI). The length of the field that indicates the subject alternative name Uniform Resource Identifier (URI).End of change

Length of subject's common name. The length of the field that indicates the subject's common name.

Length of subject's country or region. The length of the field that indicates the subject's country or region.

Length of subject's distinguished name (DN) in DER representation. The length of the field that indicates the subject's DN in DER representation.

Length of subject's email address. The length of the field that indicates the subject's email address.

Length of subject's locality. The length of the field that indicates the subject's locality.

Length of subject's organization. The length of the field that indicates the subject's organization.

Length of subject's organizational unit. The length of the field that indicates the subject's organizational unit.

Length of subject's postal code. The length of the field that indicates the subject's postal code.

Length of subject's public key algorithm. The length of the field that indicates the subject's public key algorithm.

Length of subject's state or province. The length of the field that indicates the subject's state or province.

Length of subject's unique ID (Version 2). The length of the field that indicates the subject's unique ID (Version 2). This length refers to a field of hexadecimal bytes.

Length of validity period start. The length of the field that indicates the beginning date of the validity period. The first 8 characters consist of 4 characters for the year, 2 characters for the month, and 2 characters for the day. The last 6 characters consist of 2 characters for the hours, 2 characters for the minutes, and 2 characters for the seconds.

Length of validity period end. The length of the field that indicates the ending date of the validity period. The first 8 characters consist of 4 characters for the year, 2 characters for the month, and 2 characters for the day. The last 6 characters consist of 2 characters for the hours, 2 characters for the minutes, and 2 characters for the seconds.

Length of version. The length of the field that indicates the version. This length refers to a field of hexadecimal bytes.

Offset to ASN.1 format certificate. The offset to the ASN.1 DER format certificate. This offset refers to a field of hexadecimal bytes.

Start of changeOffset to basic constraints Certificate Authority (CA). The offset to the field that indicates the basic constraints Certificate Authority (CA).End of change

Start of changeOffset to basic constraints path length constraint. The offset to the field that indicates the basic constraints path length constraint. This offset refers to a field of hexadecimal bytes.End of change

Start of changeOffset to Certificate Revocation List (CRL) distribution points distribution point name. The offset to the field that indicates the Certificate Revocation List (CRL) distribution points distribution point name.End of change

Start of changeOffset to certificate fingerprint. The offset to the field that indicates the certificate fingerprint. This offset refers to a field of hexadecimal bytes.End of change

Start of changeOffset to certificate fingerprint algorithm. The offset to the field that indicates the certificate fingerprint algorithm.End of change

Offset to certificate handle. The offset to the certificate handle. This offset refers to a field of hexadecimal bytes.

Start of changeOffset to extended key usage identifier. The offset to the field that indicates the extended key usage identifier.End of change

Offset to issuer's common name. The offset to the field that indicates the issuer's common name.

Offset to issuer's country or region. The offset to the field that indicates the issuer's country or region.

Offset to issuer's distinguished name (DN) in DER representation. The offset to the field that indicates the issuer's DN in DER representation.

Offset to issuer's email address. The offset to the field that indicates the issuer's email address.

Offset to issuer's locality. The offset to the field that indicates the issuer's locality.

Offset to issuer's organization. The offset to the field that indicates the issuer's organization.

Offset to issuer's organizational unit. The offset to the field that indicates the issuer's organizational unit.

Offset to issuer's postal code. The offset to the field that indicates the issuer's postal code.

Offset to issuer's state or province. The offset to the field that indicates the issuer's state or province.

Offset to issuer's unique ID (Version 2). The offset to the field that indicates the issuer's unique ID (Version 2). This offset refers to a field of hexadecimal bytes.

Start of changeOffset to key usage. The offset to the field that indicates the key usage. This offset refers to a field of hexadecimal bytes.End of change

Start of changeOffset to policy identifier. The offset to field that indicates the policy identifier.End of change

Start of changeOffset to public key. The offset to the field that indicates the public key. This offset refers to a field of hexadecimal bytes.End of change

Offset to public key in DER representation. The offset to the public key. This offset refers to a field of hexadecimal bytes.

Start of changeOffset to public key size. The offset to the field that indicates the public key size. This offset refers to a field of hexadecimal bytes which represent the size in bits.End of change

Offset to serial number. The offset to the field that indicates the serial number.

Start of changeOffset to SHA-1 certificate fingerprint. The offset to the field that indicates the SHA-1 certificate fingerprint. This offset refers to a field of hexadecimal bytes.End of change

Start of changeOffset to SHA-256 certificate fingerprint. The offset to the field that indicates the SHA-256 certificate fingerprint. This offset refers to a field of hexadecimal bytes.End of change

Start of changeOffset to signature algorithm. The offset to the field that indicates the signature algorithm.End of change

Start of changeOffset to subject alternative name directory name. The offset to the field that indicates the subject alternative name directory name.End of change

Start of changeOffset to subject alternative name Domain Name System (DNS) name. The offset to the field that indicates the subject alternative name Domain Name System (DNS) name.End of change

Start of changeOffset to subject alternative name IP address. The offset to the field that indicates the subject alternative name IP address. This offset refers to a field of hexadecimal bytes and is based on the IP address format, 4 for IPv4 and 16 for IPv6.End of change

Start of changeOffset to subject alternative name RFC 822 name. The offset to the field that indicates the subject alternative name RFC 822 name.End of change

Start of changeOffset to subject alternative name Uniform Resource Identifier (URI). The offset to the field that indicates the subject alternative name Uniform Resource Identifier (URI).End of change

Offset to subject's common name. The offset to the field that indicates the subject's common name.

Offset to subject's country or region. The offset to the field that indicates the subject's country or region.

Offset to subject's distinguished name (DN) in DER representation. The offset to the field that indicates the subject's DN in DER representation.

Offset to subject's email address. The offset to the field that indicates the subject's email address.

Offset to subject's locality. The offset to the field that indicates the subject's locality.

Offset to subject's organization. The offset to the field that indicates the subject's organization.

Offset to subject's organizational unit. The offset to the field that indicates the subject's organizational unit.

Offset to subject's postal code. The offset to the field that indicates the subject's postal code.

Offset to subject's public key algorithm. The offset to the field that indicates the subject's public key algorithm.

Offset to subject's state or province. The offset to the field that indicates the subject's state or province.

Offset to subject's unique ID (Version 2). The offset to the field that indicates the subject's unique ID (Version 2). This offset refers to a field of hexadecimal bytes.

Offset to validity period start. The offset to the field that indicates the beginning date of the validity period.

Offset to validity period end. The offset to the field that indicates the ending date of the validity period.

Offset to version. The offset to the field that indicates the version. This offset refers to a field of hexadecimal bytes.

Reserved. An ignored field.

Returned length of this certificate and format information. The total length of this certificate and format information that was returned. This length is for one certificate and can be used to access the next certificate in the list.

User name. The name of the user profile that is specified in the call to the API.

Error Messages



API introduced: V4R2

[ Back to top | Security APIs | APIs by category ]