1OCSP_CERT_TO_ID(3)                  OpenSSL                 OCSP_CERT_TO_ID(3)
2
3
4

NAME

6       OCSP_cert_to_id, OCSP_cert_id_new, OCSP_CERTID_free,
7       OCSP_id_issuer_cmp, OCSP_id_cmp, OCSP_id_get0_info - OCSP certificate
8       ID utility functions
9

SYNOPSIS

11        #include <openssl/ocsp.h>
12
13        OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst,
14                                     X509 *subject, X509 *issuer);
15
16        OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
17                                      X509_NAME *issuerName,
18                                      ASN1_BIT_STRING *issuerKey,
19                                      ASN1_INTEGER *serialNumber);
20
21        void OCSP_CERTID_free(OCSP_CERTID *id);
22
23        int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
24        int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
25
26        int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
27                              ASN1_OCTET_STRING **pikeyHash,
28                              ASN1_INTEGER **pserial, OCSP_CERTID *cid);
29

DESCRIPTION

31       OCSP_cert_to_id() creates and returns a new OCSP_CERTID structure using
32       message digest dgst for certificate subject with issuer issuer. If dgst
33       is NULL then SHA1 is used.
34
35       OCSP_cert_id_new() creates and returns a new OCSP_CERTID using dgst and
36       issuer name issuerName, issuer key hash issuerKey and serial number
37       serialNumber.
38
39       OCSP_CERTID_free() frees up id.
40
41       OCSP_id_cmp() compares OCSP_CERTID a and b.
42
43       OCSP_id_issuer_cmp() compares only the issuer name of OCSP_CERTID a and
44       b.
45
46       OCSP_id_get0_info() returns the issuer name hash, hash OID, issuer key
47       hash and serial number contained in cid. If any of the values are not
48       required the corresponding parameter can be set to NULL.
49

RETURN VALUES

51       OCSP_cert_to_id() and OCSP_cert_id_new() return either a pointer to a
52       valid OCSP_CERTID structure or NULL if an error occurred.
53
54       OCSP_id_cmp() and OCSP_id_issuer_cmp() returns zero for a match and
55       nonzero otherwise.
56
57       OCSP_CERTID_free() does not return a value.
58
59       OCSP_id_get0_info() returns 1 for success and 0 for failure.
60

NOTES

62       OCSP clients will typically only use OCSP_cert_to_id() or
63       OCSP_cert_id_new(): the other functions are used by responder
64       applications.
65
66       The values returned by OCSP_id_get0_info() are internal pointers and
67       MUST NOT be freed up by an application: they will be freed when the
68       corresponding OCSP_CERTID structure is freed.
69

SEE ALSO

71       crypto(7), OCSP_request_add1_nonce(3), OCSP_REQUEST_new(3),
72       OCSP_resp_find_status(3), OCSP_response_status(3), OCSP_sendreq_new(3)
73
75       Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
76
77       Licensed under the OpenSSL license (the "License").  You may not use
78       this file except in compliance with the License.  You can obtain a copy
79       in the file LICENSE in the source distribution or at
80       <https://www.openssl.org/source/license.html>.
81
82
83
841.1.1q                            2023-02-06                OCSP_CERT_TO_ID(3)
Impressum