]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/crypto/CT_POLICY_EVAL_CTX.pod
Add comment about calling CT_POLICY_EVAL_CTX_free
[thirdparty/openssl.git] / doc / crypto / CT_POLICY_EVAL_CTX.pod
CommitLineData
56f3f714
RP
1=pod
2
3=head1 NAME
4
5CT_POLICY_EVAL_CTX -
6Encapsulates the data required to evaluate whether SCTs meet a Certificate Transparency policy
7
8=head1 SYNOPSIS
9
10 #include <openssl/ct.h>
11
12 CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
13 void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
14 X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
15 void CT_POLICY_EVAL_CTX_set0_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
16 X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
17 void CT_POLICY_EVAL_CTX_set0_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
18 const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
19 void CT_POLICY_EVAL_CTX_set0_log_store(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store);
20
21=head1 DESCRIPTION
22
23A B<CT_POLICY_EVAL_CTX> is used by functions that evaluate whether Signed
24Certificate Timestamps (SCTs) fulfil a Certificate Transparency (CT) policy.
25This policy may be, for example, that at least one valid SCT is available. To
26determine this, an SCT's signature must be verified. This requires:
27
28=over
29
30=item * the public key of the log that issued the SCT
31
32=item * the certificate that the SCT was issued for
33
34=item * the issuer certificate (if the SCT was issued for a pre-certificate)
35
36=back
37
38The above requirements are met using the setters described below.
39
40B<CT_POLICY_EVAL_CTX_new>() creates an empty policy evaluation context. This
41should then be populated using:
42
43=over
44
45=item * B<CT_POLICY_EVAL_CTX_set0_cert>() to provide the certificate the SCTs were issued for
46
47=item * B<CT_POLICY_EVAL_CTX_set0_issuer>() to provide the issuer certificate
48
49=item * B<CT_POLICY_EVAL_CTX_set0_log_store>() to provide a list of logs that are trusted as sources of SCTs
50
51=back
52
53None of these setters take ownership of the pointers passed to them.
54Each setter has a matching getter for accessing the current value.
55The getters do not transfer ownership either.
56
57When no longer required, the B<CT_POLICY_EVAL_CTX> should be passed to
58B<CT_POLICY_EVAL_CTX_free>() to delete it.
59
60=head1 NOTES
61
62The issuer certificate only needs to be provided if at least one of the SCTs
63was issued for a pre-certificate. This will be the case for SCTs embedded in a
64certificate (i.e. those in an X.509 extension), but may not be the case for SCTs
65found in the TLS SCT extension or OCSP response.
66
67=head1 RETURN VALUES
68
69B<CT_POLICY_EVAL_CTX_new>() will return NULL if malloc fails.
70
71=head1 SEE ALSO
72
73L<ct(3)>
74
75=head1 COPYRIGHT
76
77Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
78
79Licensed under the OpenSSL license (the "License"). You may not use
80this file except in compliance with the License. You can obtain a copy
81in the file LICENSE in the source distribution or at
82L<https://www.openssl.org/source/license.html>.
83
84=cut