Debian Codegraph @

upstream/debian-unstable/man3/X509_get0_notBefore.3ssl

raw
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 "X509_GET0_NOTBEFORE 3SSL"
58 .TH X509_GET0_NOTBEFORE 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 X509_get0_notBefore, X509_getm_notBefore, X509_get0_notAfter,
65 X509_getm_notAfter, X509_set1_notBefore, X509_set1_notAfter,
66 X509_ACERT_get0_notBefore, X509_ACERT_get0_notAfter,
67 X509_ACERT_set1_notBefore, X509_ACERT_set1_notAfter,
68 X509_CRL_get0_lastUpdate, X509_CRL_get0_nextUpdate, X509_CRL_set1_lastUpdate,
69 X509_CRL_set1_nextUpdate \- get or set certificate or CRL dates
70 .SH SYNOPSIS
71 .IX Header "SYNOPSIS"
72 .Vb 1
73 \& #include <openssl/x509.h>
74 \&
75 \& const ASN1_TIME *X509_get0_notBefore(const X509 *x);
76 \& const ASN1_TIME *X509_get0_notAfter(const X509 *x);
77 \&
78 \& ASN1_TIME *X509_getm_notBefore(const X509 *x);
79 \& ASN1_TIME *X509_getm_notAfter(const X509 *x);
80 \&
81 \& int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
82 \& int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
83 \&
84 \& const ASN1_GENERALIZEDTIME *X509_ACERT_get0_notBefore(const X509 *x);
85 \& const ASN1_GENERALIZEDTIME *X509_ACERT_get0_notAfter(const X509 *x);
86 \&
87 \& int X509_ACERT_set1_notBefore(X509_ACERT *x, const ASN1_GENERALIZEDTIME *tm);
88 \& int X509_ACERT_set1_notAfter(X509_ACERT *x, const ASN1_GENERALIZEDTIME *tm);
89 \&
90 \& const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
91 \& const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
92 \&
93 \& int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
94 \& int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
95 .Ve
96 .SH DESCRIPTION
97 .IX Header "DESCRIPTION"
98 \&\fBX509_get0_notBefore()\fR and \fBX509_get0_notAfter()\fR return the \fBnotBefore\fR
99 and \fBnotAfter\fR fields of certificate \fIx\fR respectively. The value
100 returned is an internal pointer which must not be freed up after
101 the call. \fIx\fR \fBMUST NOT\fR be NULL.
102 .PP
103 \&\fBX509_getm_notBefore()\fR and \fBX509_getm_notAfter()\fR are similar to
104 \&\fBX509_get0_notBefore()\fR and \fBX509_get0_notAfter()\fR except they return
105 non-constant mutable references to the associated date field of
106 the certificate.
107 .PP
108 \&\fBX509_set1_notBefore()\fR and \fBX509_set1_notAfter()\fR set the \fBnotBefore\fR
109 and \fBnotAfter\fR fields of \fIx\fR to \fItm\fR. Ownership of the passed
110 parameter \fItm\fR is not transferred by these functions so it must
111 be freed up after the call.
112 .PP
113 \&\fBX509_ACERT_get0_notBefore()\fR and \fBX509_ACERT_get0_notAfter()\fR return
114 the \fBnotBefore\fR and \fBnotAfter\fR fields of certificate \fBx\fR respectively.
115 returned is an internal pointer which must not be freed up after
116 the call.
117 .PP
118 \&\fBX509_ACERT_set1_notBefore()\fR and \fBX509_ACERT_set1_notAfter()\fR set the \fBnotBefore\fR
119 and \fBnotAfter\fR fields of \fBx\fR to \fBtm\fR. Ownership of the passed
120 parameter \fBtm\fR is not transferred by these functions so it must
121 be freed up after the call.
122 .PP
123 \&\fBX509_CRL_get0_lastUpdate()\fR and \fBX509_CRL_get0_nextUpdate()\fR return the
124 \&\fBlastUpdate\fR and \fBnextUpdate\fR fields of \fIcrl\fR. The value
125 returned is an internal pointer which must not be freed up after
126 the call. If the \fBnextUpdate\fR field is absent from \fIcrl\fR then
127 NULL is returned.
128 .PP
129 \&\fBX509_CRL_set1_lastUpdate()\fR and \fBX509_CRL_set1_nextUpdate()\fR set the \fBlastUpdate\fR
130 and \fBnextUpdate\fR fields of \fIcrl\fR to \fItm\fR. Ownership of the passed parameter
131 \&\fItm\fR is not transferred by these functions so it must be freed up after the
132 call.
133 For \fBX509_CRL_set1_nextUpdate()\fR the \fItm\fR argument may be NULL,
134 which implies removal of the optional \fBnextUpdate\fR field.
135 .SH "RETURN VALUES"
136 .IX Header "RETURN VALUES"
137 \&\fBX509_get0_notBefore()\fR, \fBX509_get0_notAfter()\fR and \fBX509_CRL_get0_lastUpdate()\fR
138 return a pointer to an \fBASN1_TIME\fR structure.
139 .PP
140 \&\fBX509_CRL_get0_lastUpdate()\fR return a pointer to an \fBASN1_TIME\fR structure
141 or NULL if the \fBlastUpdate\fR field is absent.
142 .PP
143 \&\fBX509_set1_notBefore()\fR, \fBX509_set1_notAfter()\fR, \fBX509_CRL_set1_lastUpdate()\fR and
144 \&\fBX509_CRL_set1_nextUpdate()\fR return 1 for success or 0 for failure.
145 .SH NOTES
146 .IX Header "NOTES"
147 Unlike the \fBX509\fR and \fBX509_CRL\fR routines, the \fBX509_ACERT\fR routines
148 use the ASN1_GENERALIZEDTIME format instead of ASN1_TIME for holding time
149 data.
150 .SH "SEE ALSO"
151 .IX Header "SEE ALSO"
152 \&\fBd2i_X509\fR\|(3),
153 \&\fBASN1_GENERALIZEDTIME_check\fR\|(3)
154 \&\fBERR_get_error\fR\|(3),
155 \&\fBX509_CRL_get0_by_serial\fR\|(3),
156 \&\fBX509_get0_signature\fR\|(3),
157 \&\fBX509_get_ext_d2i\fR\|(3),
158 \&\fBX509_get_extension_flags\fR\|(3),
159 \&\fBX509_get_pubkey\fR\|(3),
160 \&\fBX509_get_subject_name\fR\|(3),
161 \&\fBX509_NAME_add_entry_by_txt\fR\|(3),
162 \&\fBX509_NAME_ENTRY_get_object\fR\|(3),
163 \&\fBX509_NAME_get_index_by_NID\fR\|(3),
164 \&\fBX509_NAME_print_ex\fR\|(3),
165 \&\fBX509_new\fR\|(3),
166 \&\fBX509_sign\fR\|(3),
167 \&\fBX509V3_get_d2i\fR\|(3),
168 \&\fBX509_verify_cert\fR\|(3)
169 .SH HISTORY
170 .IX Header "HISTORY"
171 \&\fBX509_get_notBefore()\fR and \fBX509_get_notAfter()\fR were deprecated in OpenSSL
172 1.1.0.
173 .PP
174 \&\fBX509_ACERT_get0_notBefore()\fR, \fBX509_ACERT_get0_notAfter()\fR,
175 \&\fBX509_ACERT_set1_notBefore()\fR, \fBX509_ACERT_set1_notAfter()\fR
176 were added in OpenSSL 3.4.
177 .SH COPYRIGHT
178 .IX Header "COPYRIGHT"
179 Copyright 2016\-2024 The OpenSSL Project Authors. All Rights Reserved.
180 .PP
181 Licensed under the Apache License 2.0 (the "License"). You may not use
182 this file except in compliance with the License. You can obtain a copy
183 in the file LICENSE in the source distribution or at
184 <https://www.openssl.org/source/license.html>.