1OCSP_REQUEST_NEW(3) OpenSSL OCSP_REQUEST_NEW(3)
2
3
4
6 OCSP_REQUEST_new, OCSP_REQUEST_free, OCSP_request_add0_id,
7 OCSP_request_sign, OCSP_request_add1_cert, OCSP_request_onereq_count,
8 OCSP_request_onereq_get0 - OCSP request functions
9
11 #include <openssl/ocsp.h>
12
13 OCSP_REQUEST *OCSP_REQUEST_new(void);
14 void OCSP_REQUEST_free(OCSP_REQUEST *req);
15
16 OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
17
18 int OCSP_request_sign(OCSP_REQUEST *req,
19 X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
20 STACK_OF(X509) *certs, unsigned long flags);
21
22 int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
23
24 int OCSP_request_onereq_count(OCSP_REQUEST *req);
25 OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
26
28 OCSP_REQUEST_new() allocates and returns an empty OCSP_REQUEST
29 structure.
30
31 OCSP_REQUEST_free() frees up the request structure req.
32
33 OCSP_request_add0_id() adds certificate ID cid to req. It returns the
34 OCSP_ONEREQ structure added so an application can add additional
35 extensions to the request. The id parameter MUST NOT be freed up after
36 the operation.
37
38 OCSP_request_sign() signs OCSP request req using certificate signer,
39 private key key, digest dgst and additional certificates certs. If the
40 flags option OCSP_NOCERTS is set then no certificates will be included
41 in the request.
42
43 OCSP_request_add1_cert() adds certificate cert to request req. The
44 application is responsible for freeing up cert after use.
45
46 OCSP_request_onereq_count() returns the total number of OCSP_ONEREQ
47 structures in req.
48
49 OCSP_request_onereq_get0() returns an internal pointer to the
50 OCSP_ONEREQ contained in req of index i. The index value i runs from 0
51 to OCSP_request_onereq_count(req) - 1.
52
54 OCSP_REQUEST_new() returns an empty OCSP_REQUEST structure or NULL if
55 an error occurred.
56
57 OCSP_request_add0_id() returns the OCSP_ONEREQ structure containing cid
58 or NULL if an error occurred.
59
60 OCSP_request_sign() and OCSP_request_add1_cert() return 1 for success
61 and 0 for failure.
62
63 OCSP_request_onereq_count() returns the total number of OCSP_ONEREQ
64 structures in req.
65
66 OCSP_request_onereq_get0() returns a pointer to an OCSP_ONEREQ
67 structure or NULL if the index value is out or range.
68
70 An OCSP request structure contains one or more OCSP_ONEREQ structures
71 corresponding to each certificate.
72
73 OCSP_request_onereq_count() and OCSP_request_onereq_get0() are mainly
74 used by OCSP responders.
75
77 Create an OCSP_REQUEST structure for certificate cert with issuer
78 issuer:
79
80 OCSP_REQUEST *req;
81 OCSP_ID *cid;
82
83 req = OCSP_REQUEST_new();
84 if (req == NULL)
85 /* error */
86 cid = OCSP_cert_to_id(EVP_sha1(), cert, issuer);
87 if (cid == NULL)
88 /* error */
89
90 if (OCSP_REQUEST_add0_id(req, cid) == NULL)
91 /* error */
92
93 /* Do something with req, e.g. query responder */
94
95 OCSP_REQUEST_free(req);
96
98 crypto(7), OCSP_cert_to_id(3), OCSP_request_add1_nonce(3),
99 OCSP_resp_find_status(3), OCSP_response_status(3), OCSP_sendreq_new(3)
100
102 Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
103
104 Licensed under the OpenSSL license (the "License"). You may not use
105 this file except in compliance with the License. You can obtain a copy
106 in the file LICENSE in the source distribution or at
107 <https://www.openssl.org/source/license.html>.
108
109
110
1111.1.1d 2019-10-03 OCSP_REQUEST_NEW(3)