| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "CT_POLICY_EVAL_CTX_NEW 3SSL" |
| 58 |
.TH CT_POLICY_EVAL_CTX_NEW 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
CT_POLICY_EVAL_CTX_new_ex, |
| 65 |
CT_POLICY_EVAL_CTX_new, CT_POLICY_EVAL_CTX_free, |
| 66 |
CT_POLICY_EVAL_CTX_get0_cert, CT_POLICY_EVAL_CTX_set1_cert, |
| 67 |
CT_POLICY_EVAL_CTX_get0_issuer, CT_POLICY_EVAL_CTX_set1_issuer, |
| 68 |
CT_POLICY_EVAL_CTX_get0_log_store, CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE, |
| 69 |
CT_POLICY_EVAL_CTX_get_time, CT_POLICY_EVAL_CTX_set_time \- |
| 70 |
Encapsulates the data required to evaluate whether SCTs meet a Certificate Transparency policy |
| 71 |
.SH SYNOPSIS |
| 72 |
.IX Header "SYNOPSIS" |
| 73 |
.Vb 1 |
| 74 |
\& #include <openssl/ct.h> |
| 75 |
\& |
| 76 |
\& CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx, |
| 77 |
\& const char *propq); |
| 78 |
\& CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void); |
| 79 |
\& void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx); |
| 80 |
\& X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx); |
| 81 |
\& int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert); |
| 82 |
\& X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx); |
| 83 |
\& int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer); |
| 84 |
\& const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx); |
| 85 |
\& void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, |
| 86 |
\& CTLOG_STORE *log_store); |
| 87 |
\& uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); |
| 88 |
\& void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); |
| 89 |
.Ve |
| 90 |
.SH DESCRIPTION |
| 91 |
.IX Header "DESCRIPTION" |
| 92 |
A \fBCT_POLICY_EVAL_CTX\fR is used by functions that evaluate whether Signed |
| 93 |
Certificate Timestamps (SCTs) fulfil a Certificate Transparency (CT) policy. |
| 94 |
This policy may be, for example, that at least one valid SCT is available. To |
| 95 |
determine this, an SCT's timestamp and signature must be verified. |
| 96 |
This requires: |
| 97 |
.IP \(bu 2 |
| 98 |
the public key of the log that issued the SCT |
| 99 |
.IP \(bu 2 |
| 100 |
the certificate that the SCT was issued for |
| 101 |
.IP \(bu 2 |
| 102 |
the issuer certificate (if the SCT was issued for a pre-certificate) |
| 103 |
.IP \(bu 2 |
| 104 |
the current time |
| 105 |
.PP |
| 106 |
The above requirements are met using the setters described below. |
| 107 |
.PP |
| 108 |
\&\fBCT_POLICY_EVAL_CTX_new_ex()\fR creates an empty policy evaluation context |
| 109 |
and associates it with the given library context \fIlibctx\fR and property query |
| 110 |
string \fIpropq\fR. |
| 111 |
.PP |
| 112 |
\&\fBCT_POLICY_EVAL_CTX_new()\fR does the same thing as |
| 113 |
\&\fBCT_POLICY_EVAL_CTX_new_ex()\fR except that it uses the default library |
| 114 |
context and property query string. |
| 115 |
.PP |
| 116 |
The CT_POLICY_EVAL_CTX should then be populated using: |
| 117 |
.IP \(bu 2 |
| 118 |
\&\fBCT_POLICY_EVAL_CTX_set1_cert()\fR to provide the certificate the SCTs were issued for |
| 119 |
.Sp |
| 120 |
Increments the reference count of the certificate. |
| 121 |
.IP \(bu 2 |
| 122 |
\&\fBCT_POLICY_EVAL_CTX_set1_issuer()\fR to provide the issuer certificate |
| 123 |
.Sp |
| 124 |
Increments the reference count of the certificate. |
| 125 |
.IP \(bu 2 |
| 126 |
\&\fBCT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE()\fR to provide a list of logs that are trusted as sources of SCTs |
| 127 |
.Sp |
| 128 |
Holds a pointer to the CTLOG_STORE, so the CTLOG_STORE must outlive the |
| 129 |
CT_POLICY_EVAL_CTX. |
| 130 |
.IP \(bu 2 |
| 131 |
\&\fBCT_POLICY_EVAL_CTX_set_time()\fR to set the time SCTs should be compared with to determine if they are valid |
| 132 |
.Sp |
| 133 |
The SCT timestamp will be compared to this time to check whether the SCT was |
| 134 |
issued in the future. RFC6962 states that "TLS clients MUST reject SCTs whose |
| 135 |
timestamp is in the future". By default, this will be set to 5 minutes in the |
| 136 |
future (e.g. (\fBtime()\fR + 300) * 1000), to allow for clock drift. |
| 137 |
.Sp |
| 138 |
The time should be in milliseconds since the Unix Epoch. |
| 139 |
.PP |
| 140 |
Each setter has a matching getter for accessing the current value. |
| 141 |
.PP |
| 142 |
When no longer required, the \fBCT_POLICY_EVAL_CTX\fR should be passed to |
| 143 |
\&\fBCT_POLICY_EVAL_CTX_free()\fR to delete it. If the argument to |
| 144 |
\&\fBCT_POLICY_EVAL_CTX_free()\fR is NULL, nothing is done. |
| 145 |
.SH NOTES |
| 146 |
.IX Header "NOTES" |
| 147 |
The issuer certificate only needs to be provided if at least one of the SCTs |
| 148 |
was issued for a pre-certificate. This will be the case for SCTs embedded in a |
| 149 |
certificate (i.e. those in an X.509 extension), but may not be the case for SCTs |
| 150 |
found in the TLS SCT extension or OCSP response. |
| 151 |
.SH "RETURN VALUES" |
| 152 |
.IX Header "RETURN VALUES" |
| 153 |
\&\fBCT_POLICY_EVAL_CTX_new_ex()\fR and \fBCT_POLICY_EVAL_CTX_new()\fR will return |
| 154 |
NULL if malloc fails. |
| 155 |
.SH "SEE ALSO" |
| 156 |
.IX Header "SEE ALSO" |
| 157 |
\&\fBct\fR\|(7) |
| 158 |
.SH HISTORY |
| 159 |
.IX Header "HISTORY" |
| 160 |
CT_POLICY_EVAL_CTX_new_ex was added in OpenSSL 3.0. All other |
| 161 |
functions were added in OpenSSL 1.1.0. |
| 162 |
.SH COPYRIGHT |
| 163 |
.IX Header "COPYRIGHT" |
| 164 |
Copyright 2016\-2024 The OpenSSL Project Authors. All Rights Reserved. |
| 165 |
.PP |
| 166 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 167 |
this file except in compliance with the License. You can obtain a copy |
| 168 |
in the file LICENSE in the source distribution or at |
| 169 |
<https://www.openssl.org/source/license.html>. |