Parse Certificate (QSYPARSC, QsyParseCertificate) API
Required Parameter Group for QSYPARSC:
1 | Certificate | Input | Char(*) |
2 | Type | Input | Binary(4) |
3 | Length of certificate | Input | Binary(4) |
4 | Format | Input | Char(8) |
5 | Receiver variable | Output | Char(*) |
6 | Length of receiver variable | Input | Binary(4) |
7 | Error code | I/O | Char(*) |
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:
1 Entire X.509 public key certificate in ASN.1 DER encoding. 3 Base 64 encoded version of the entire X.509 public key certificate in ASN.1 DER encoding. Note that the characters of the Base 64 encoding are the ASCII representation and not the EBCDIC representation.
- 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:
CERT0200 All text fields available. CERT0210 All text fields available. None of the fields are translated from the ASCII format that they had in the certificate into the job CCSID.
- 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:
- Common name
- Organizational unit
- Organization
- Locality
- State
- Postal code
- Country or region
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.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | BINARY(4) | Returned length of this certificate and format information |
4 | 4 | BINARY(4) | Available length of this certificate and format information |
8 | 8 | BINARY(4) | Offset to certificate handle |
12 | C | BINARY(4) | Length of certificate handle |
16 | 10 | BINARY(4) | Offset to version |
20 | 14 | BINARY(4) | Length of version |
24 | 18 | BINARY(4) | Offset to serial number |
28 | 1C | BINARY(4) | Length of serial number |
32 | 20 | BINARY(4) | Offset to issuer's common name |
36 | 24 | BINARY(4) | Length of issuer's common name |
40 | 28 | BINARY(4) | Offset to issuer's country or region |
44 | 2C | BINARY(4) | Length of issuer's country or region |
48 | 30 | BINARY(4) | Offset to issuer's state or province |
52 | 34 | BINARY(4) | Length of issuer's state or province |
56 | 38 | BINARY(4) | Offset to issuer's locality |
60 | 3C | BINARY(4) | Length of issuer's locality |
64 | 40 | BINARY(4) | Offset to issuer's organization |
68 | 44 | BINARY(4) | Length of issuer's organization |
72 | 48 | BINARY(4) | Offset to issuer's organizational unit |
76 | 4C | BINARY(4) | Length of issuer's organizational unit |
80 | 50 | BINARY(4) | Offset to issuer's postal code |
84 | 54 | BINARY(4) | Length of issuer's postal code |
88 | 58 | BINARY(4) | Offset to validity period start |
92 | 5C | BINARY(4) | Length of validity period start |
96 | 60 | BINARY(4) | Offset to validity period end |
100 | 64 | BINARY(4) | Length of validity period end |
104 | 68 | BINARY(4) | Offset to subject's common name |
108 | 6C | BINARY(4) | Length of subject's common name |
112 | 70 | BINARY(4) | Offset to subject's country or region |
116 | 74 | BINARY(4) | Length of subject's country or region |
120 | 78 | BINARY(4) | Offset to subject's state or province |
124 | 7C | BINARY(4) | Length of subject's state or province |
128 | 80 | BINARY(4) | Offset to subject's locality |
132 | 84 | BINARY(4) | Length of subject's locality |
136 | 88 | BINARY(4) | Offset to subject's organization |
140 | 8C | BINARY(4) | Length of subject's organization |
144 | 90 | BINARY(4) | Offset to subject's organizational unit |
148 | 94 | BINARY(4) | Length of subject's organizational unit |
152 | 98 | BINARY(4) | Offset to subject's postal code |
156 | 9C | BINARY(4) | Length of subject's postal code |
160 | A0 | BINARY(4) | Offset to subject's public key algorithm |
164 | A4 | BINARY(4) | Length of subject's public key algorithm |
168 | A8 | BINARY(4) | Offset to issuer's unique ID (Version 2) |
172 | AC | BINARY(4) | Length of issuer's unique ID (Version 2) |
176 | B0 | BINARY(4) | Offset to subject's unique ID (Version 2) |
180 | B4 | BINARY(4) | Length of subject's unique ID (Version 2) |
184 | B8 | BINARY(4) | Offset to issuer's email address |
188 | BC | BINARY(4) | Length of issuer's email address |
192 | C0 | BINARY(4) | Offset to subject's email address |
196 | C4 | BINARY(4) | Length of subject's email address |
216 | D8 | BINARY(4) | Offset to issuer's distinguished name (DN) in DER representation |
220 | DC | BINARY(4) | Length of issuer's distinguished name (DN) in DER representation |
224 | E0 | BINARY(4) | Offset to subject's distinguished name (DN) in DER representation |
228 | E4 | BINARY(4) | Length of subject's distinguished name (DN) in DER representation |
232 | E8 | BINARY(4) | Offset to public key in DER representation |
236 | EC | BINARY(4) | Length of public key in DER representation |
240 | F0 | BINARY(4) | Offset to basic constraints Certificate Authority (CA) |
244 | F4 | BINARY(4) | Length of basic constraints Certificate Authority (CA) |
248 | F8 | BINARY(4) | Offset to basic constraints path length constraint |
252 | FC | BINARY(4) | Length of basic constraints path length constraint |
256 | 100 | BINARY(4) | Offset to policy identifier |
260 | 104 | BINARY(4) | Length of policy identifier |
264 | 108 | BINARY(4) | Offset to Certificate Revocation List (CRL) distribution points distribution point name |
268 | 10C | BINARY(4) | Length of Certificate Revocation List (CRL) distribution points distribution point name |
272 | 110 | BINARY(4) | Offset to certificate fingerprint |
276 | 114 | BINARY(4) | Length of certificate fingerprint |
280 | 118 | BINARY(4) | Offset to certificate fingerprint algorithm |
284 | 11C | BINARY(4) | Length of certificate fingerprint algorithm |
288 | 120 | BINARY(4) | Offset to SHA-1 certificate fingerprint |
292 | 124 | BINARY(4) | Length of SHA-1 certificate fingerprint |
296 | 128 | BINARY(4) | Offset to SHA-256 certificate fingerprint |
300 | 12C | BINARY(4) | Length of SHA-256 certificate fingerprint |
304 | 130 | BINARY(4) | Offset to key usage |
308 | 134 | BINARY(4) | Length of key usage |
312 | 138 | BINARY(4) | Offset to public key |
316 | 13C | BINARY(4) | Length of public key |
320 | 140 | BINARY(4) | Offset to public key size |
324 | 144 | BINARY(4) | Length of public key size |
328 | 148 | BINARY(4) | Offset to signature algorithm |
332 | 14C | BINARY(4) | Length of signature algorithm |
376 | 178 | BINARY(4) | Offset to extended key usage identifier |
380 | 17C | BINARY(4) | Length of extended key usage identifier |
368 | 170 | BINARY(4) | Offset to subject alternative name RFC 822 name |
372 | 174 | BINARY(4) | Length of subject alternative name RFC 822 name |
336 | 150 | BINARY(4) | Offset to subject alternative name directory name |
340 | 154 | BINARY(4) | Length of subject alternative name directory name |
344 | 158 | BINARY(4) | Offset to subject alternative name Domain Name System (DNS) name |
348 | 15C | BINARY(4) | Length of subject alternative name Domain Name System (DNS) name |
352 | 160 | BINARY(4) | Offset to subject alternative name IP address |
356 | 164 | BINARY(4) | Length of subject alternative name IP address |
360 | 168 | BINARY(4) | Offset to subject alternative name Uniform Resource Identifier (URI) |
364 | 16C | BINARY(4) | Length of subject alternative name Uniform Resource Identifier (URI) |
ARRAY(*) of CHAR | Certificate information |
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.
Length of basic constraints Certificate Authority (CA). The length of the field that indicates the basic constraints Certificate Authority (CA).
Length 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.
Length 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.
Length of certificate fingerprint. The length of the field that indicates the certificate fingerprint. This length refers to a field of hexadecimal bytes.
Length of certificate fingerprint algorithm. The length of the field that indicates the certificate fingerprint algorithm.
Length of certificate handle. The length of the certificate handle. This length refers to a field of hexadecimal bytes.
Length of extended key usage identifier. The length of the field that indicates the extended key usage identifier.
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.
Length of key usage. The length of the field that indicates the key usage. This length refers to a field of hexadecimal bytes.
Length of policy identifier. The length of the field that indicates the policy identifier.
Length of public key. The length of the field that indicates the public key. This length refers to a field of hexadecimal bytes.
Length of public key in DER representation. The length of the public key. This length refers to a field of hexadecimal bytes.
Length 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.
Length of serial number. The length of the field that indicates the serial number.
Length of SHA-1 certificate fingerprint. The length of the field that indicates the SHA-1certificate fingerprint. This length refers to a field of hexadecimal bytes
Length 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 bytes
Length of signature algorithm. The length of the field that indicates the signature algorithm.
Length of subject alternative name directory name. The length of the field that indicates the subject alternative name directory name.
Length 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.
Length 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.
Length of subject alternative name RFC 822 name. The length of the field that indicates the subject alternative name RFC 822 name.
Length of subject alternative name Uniform Resource Identifier (URI). The length of the field that indicates the subject alternative name Uniform Resource Identifier (URI).
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.
Offset to basic constraints Certificate Authority (CA). The offset to the field that indicates the basic constraints Certificate Authority (CA).
Offset 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.
Offset 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.
Offset to certificate fingerprint. The offset to the field that indicates the certificate fingerprint. This offset refers to a field of hexadecimal bytes.
Offset to certificate fingerprint algorithm. The offset to the field that indicates the certificate fingerprint algorithm.
Offset to certificate handle. The offset to the certificate handle. This offset refers to a field of hexadecimal bytes.
Offset to extended key usage identifier. The offset to the field that indicates the extended key usage identifier.
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.
Offset to key usage. The offset to the field that indicates the key usage. This offset refers to a field of hexadecimal bytes.
Offset to policy identifier. The offset to field that indicates the policy identifier.
Offset to public key. The offset to the field that indicates the public key. This offset refers to a field of hexadecimal bytes.
Offset to public key in DER representation. The offset to the public key. This offset refers to a field of hexadecimal bytes.
Offset 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.
Offset to serial number. The offset to the field that indicates the serial number.
Offset 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.
Offset 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.
Offset to signature algorithm. The offset to the field that indicates the signature algorithm.
Offset to subject alternative name directory name. The offset to the field that indicates the subject alternative name directory name.
Offset 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.
Offset 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.
Offset to subject alternative name RFC 822 name. The offset to the field that indicates the subject alternative name RFC 822 name.
Offset to subject alternative name Uniform Resource Identifier (URI). The offset to the field that indicates the subject alternative name Uniform Resource Identifier (URI).
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
Message ID | Error Message Text |
---|---|
CPFA0AA E | Error occurred while attempting to obtain space. |
CPF1F41 E | Severe error occurred while addressing parameter list. |
CPF227A E | Certificate type is not valid. |
CPF227B E | Certificate is not correct for the specified type. |
CPF3BFF E | Required option &1 is not available. |
CPF3CF1 E | Error code parameter not valid. |
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF3C1D E | Length specified in parameter &1 not valid. |
CPF3C1E E | Required parameter &1 omitted. |
CPF3C21 E | Format name &1 is not valid. |
CPF3C36 E | Number of parameters, &1, entered for this API was not valid. |
CPF3C90 E | Literal value cannot be changed. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
API introduced: V4R2
[ Back to top | Security APIs | APIs by category ]