Blame doc/man3/CT_POLICY_EVAL_CTX_new.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_new, CT_POLICY_EVAL_CTX_free,
Packit c4476c
CT_POLICY_EVAL_CTX_get0_cert, CT_POLICY_EVAL_CTX_set1_cert,
Packit c4476c
CT_POLICY_EVAL_CTX_get0_issuer, CT_POLICY_EVAL_CTX_set1_issuer,
Packit c4476c
CT_POLICY_EVAL_CTX_get0_log_store, CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE,
Packit c4476c
CT_POLICY_EVAL_CTX_get_time, CT_POLICY_EVAL_CTX_set_time -
Packit c4476c
Encapsulates the data required to evaluate whether SCTs meet a Certificate Transparency policy
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ct.h>
Packit c4476c
Packit c4476c
 CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
Packit c4476c
 void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
Packit c4476c
 X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
Packit c4476c
 int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
Packit c4476c
 X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
Packit c4476c
 int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
Packit c4476c
 const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);
Packit c4476c
 void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx,
Packit c4476c
                                                CTLOG_STORE *log_store);
Packit c4476c
 uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx);
Packit c4476c
 void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
A B<CT_POLICY_EVAL_CTX> is used by functions that evaluate whether Signed
Packit c4476c
Certificate Timestamps (SCTs) fulfil a Certificate Transparency (CT) policy.
Packit c4476c
This policy may be, for example, that at least one valid SCT is available. To
Packit c4476c
determine this, an SCT's timestamp and signature must be verified.
Packit c4476c
This requires:
Packit c4476c
Packit c4476c
=over 2
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
the public key of the log that issued the SCT
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
the certificate that the SCT was issued for
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
the issuer certificate (if the SCT was issued for a pre-certificate)
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
the current time
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
The above requirements are met using the setters described below.
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_new() creates an empty policy evaluation context. This
Packit c4476c
should then be populated using:
Packit c4476c
Packit c4476c
=over 2
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_set1_cert() to provide the certificate the SCTs were issued for
Packit c4476c
Packit c4476c
Increments the reference count of the certificate.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_set1_issuer() to provide the issuer certificate
Packit c4476c
Packit c4476c
Increments the reference count of the certificate.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE() to provide a list of logs that are trusted as sources of SCTs
Packit c4476c
Packit c4476c
Holds a pointer to the CTLOG_STORE, so the CTLOG_STORE must outlive the
Packit c4476c
CT_POLICY_EVAL_CTX.
Packit c4476c
Packit c4476c
=item *
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_set_time() to set the time SCTs should be compared with to determine if they are valid
Packit c4476c
Packit c4476c
The SCT timestamp will be compared to this time to check whether the SCT was
Packit c4476c
issued in the future. RFC6962 states that "TLS clients MUST reject SCTs whose
Packit c4476c
timestamp is in the future". By default, this will be set to 5 minutes in the
Packit c4476c
future (e.g. (time() + 300) * 1000), to allow for clock drift.
Packit c4476c
Packit c4476c
The time should be in milliseconds since the Unix epoch.
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
Each setter has a matching getter for accessing the current value.
Packit c4476c
Packit c4476c
When no longer required, the B<CT_POLICY_EVAL_CTX> should be passed to
Packit c4476c
CT_POLICY_EVAL_CTX_free() to delete it.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
The issuer certificate only needs to be provided if at least one of the SCTs
Packit c4476c
was issued for a pre-certificate. This will be the case for SCTs embedded in a
Packit c4476c
certificate (i.e. those in an X.509 extension), but may not be the case for SCTs
Packit c4476c
found in the TLS SCT extension or OCSP response.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
CT_POLICY_EVAL_CTX_new() will return NULL if malloc fails.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ct(7)>
Packit c4476c
Packit c4476c
=head1 HISTORY
Packit c4476c
Packit c4476c
These functions were added in OpenSSL 1.1.0.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut