Debian Codegraph @

upstream/debian-unstable/man3/X509_get0_signature.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_SIGNATURE 3SSL"
58 .TH X509_GET0_SIGNATURE 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_signature, X509_REQ_set0_signature, X509_REQ_set1_signature_algo,
65 X509_get_signature_nid, X509_get0_tbs_sigalg, X509_REQ_get0_signature,
66 X509_REQ_get_signature_nid, X509_CRL_get0_signature, X509_CRL_get_signature_nid,
67 X509_CRL_get0_tbs_sigalg, X509_get_signature_info,
68 X509_SIG_INFO_get, X509_SIG_INFO_set,
69 X509_ACERT_get0_signature, X509_ACERT_get0_info_sigalg,
70 X509_ACERT_get_signature_nid \- signature information
71 .SH SYNOPSIS
72 .IX Header "SYNOPSIS"
73 .Vb 1
74 \& #include <openssl/x509.h>
75 \&
76 \& void X509_get0_signature(const ASN1_BIT_STRING **psig,
77 \& const X509_ALGOR **palg,
78 \& const X509 *x);
79 \& void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig);
80 \& int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg);
81 \& int X509_get_signature_nid(const X509 *x);
82 \& const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x);
83 \&
84 \& void X509_REQ_get0_signature(const X509_REQ *crl,
85 \& const ASN1_BIT_STRING **psig,
86 \& const X509_ALGOR **palg);
87 \& int X509_REQ_get_signature_nid(const X509_REQ *crl);
88 \&
89 \& const X509_ALGOR *X509_ACERT_get0_info_sigalg(const X509_ACERT *x);
90 \&
91 \& void X509_CRL_get0_signature(const X509_CRL *crl,
92 \& const ASN1_BIT_STRING **psig,
93 \& const X509_ALGOR **palg);
94 \& int X509_CRL_get_signature_nid(const X509_CRL *crl);
95 \& const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_crl *crl);
96 \&
97 \& int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,
98 \& uint32_t *flags);
99 \&
100 \& int X509_SIG_INFO_get(const X509_SIG_INFO *siginf, int *mdnid, int *pknid,
101 \& int *secbits, uint32_t *flags);
102 \& void X509_SIG_INFO_set(X509_SIG_INFO *siginf, int mdnid, int pknid,
103 \& int secbits, uint32_t flags);
104 \&
105 \& #include <openssl/x509_acert.h>
106 \&
107 \& void X509_ACERT_get0_signature(const X509_ACERT *x,
108 \& const ASN1_BIT_STRING **psig,
109 \& const X509_ALGOR **palg);
110 \& int X509_ACERT_get_signature_nid(const X509_ACERT *x);
111 \&=head1 DESCRIPTION
112 .Ve
113 .PP
114 \&\fBX509_get0_signature()\fR sets \fB*psig\fR to the signature of \fBx\fR and \fB*palg\fR
115 to the signature algorithm of \fBx\fR. The values returned are internal
116 pointers which \fBMUST NOT\fR be freed up after the call.
117 .PP
118 \&\fBX509_set0_signature()\fR and \fBX509_REQ_set1_signature_algo()\fR are the
119 equivalent setters for the two values of \fBX509_get0_signature()\fR.
120 .PP
121 \&\fBX509_get0_tbs_sigalg()\fR and \fBX509_CRL_get0_tbs_sigalg()\fR return the signature
122 algorithm in the signed portion of the certificate or CRL.
123 .PP
124 \&\fBX509_get_signature_nid()\fR returns the NID corresponding to the signature
125 algorithm of \fBx\fR.
126 .PP
127 \&\fBX509_REQ_get0_signature()\fR, \fBX509_REQ_get_signature_nid()\fR
128 \&\fBX509_CRL_get0_signature()\fR and \fBX509_CRL_get_signature_nid()\fR perform the
129 same function for certificate requests and CRLs.
130 .PP
131 \&\fBX509_get_signature_info()\fR retrieves information about the signature of
132 certificate \fBx\fR. The NID of the signing digest is written to \fB*mdnid\fR,
133 the public key algorithm to \fB*pknid\fR, the effective security bits to
134 \&\fB*secbits\fR and flag details to \fB*flags\fR. Any of the parameters can
135 be set to \fBNULL\fR if the information is not required.
136 .PP
137 \&\fBX509_SIG_INFO_get()\fR and \fBX509_SIG_INFO_set()\fR get and set information
138 about a signature in an \fBX509_SIG_INFO\fR structure. They are only
139 used by implementations of algorithms which need to set custom
140 signature information: most applications will never need to call
141 them.
142 .PP
143 \&\fBX509_ACERT_get0_signature()\fR, \fBX509_ACERT_get_signature_nid()\fR and
144 \&\fBX509_ACERT_get0_info_sigalg()\fR perform the same function for attribute
145 certificates.
146 .SH NOTES
147 .IX Header "NOTES"
148 These functions provide lower level access to signatures in certificates
149 where an application wishes to analyse or generate a signature in a form
150 where \fBX509_sign()\fR et al is not appropriate (for example a non standard
151 or unsupported format).
152 .PP
153 The security bits returned by \fBX509_get_signature_info()\fR refers to information
154 available from the certificate signature (such as the signing digest). In some
155 cases the actual security of the signature is less because the signing
156 key is less secure: for example a certificate signed using SHA\-512 and a
157 1024 bit RSA key.
158 .SH "RETURN VALUES"
159 .IX Header "RETURN VALUES"
160 \&\fBX509_get_signature_nid()\fR, \fBX509_REQ_get_signature_nid()\fR and
161 \&\fBX509_CRL_get_signature_nid()\fR return a NID.
162 .PP
163 \&\fBX509_get0_signature()\fR, \fBX509_REQ_get0_signature()\fR and
164 \&\fBX509_CRL_get0_signature()\fR do not return values.
165 .PP
166 \&\fBX509_get_signature_info()\fR returns 1 if the signature information
167 returned is valid or 0 if the information is not available (e.g.
168 unknown algorithms or malformed parameters).
169 .PP
170 \&\fBX509_REQ_set1_signature_algo()\fR returns 0 on success; or 1 on an
171 error (e.g. null ALGO pointer). X509_REQ_set0_signature does
172 not return an error value.
173 .SH "SEE ALSO"
174 .IX Header "SEE ALSO"
175 \&\fBd2i_X509\fR\|(3),
176 \&\fBERR_get_error\fR\|(3),
177 \&\fBX509_CRL_get0_by_serial\fR\|(3),
178 \&\fBX509_get_ext_d2i\fR\|(3),
179 \&\fBX509_get_extension_flags\fR\|(3),
180 \&\fBX509_get_pubkey\fR\|(3),
181 \&\fBX509_get_subject_name\fR\|(3),
182 \&\fBX509_get_version\fR\|(3),
183 \&\fBX509_NAME_add_entry_by_txt\fR\|(3),
184 \&\fBX509_NAME_ENTRY_get_object\fR\|(3),
185 \&\fBX509_NAME_get_index_by_NID\fR\|(3),
186 \&\fBX509_NAME_print_ex\fR\|(3),
187 \&\fBX509_new\fR\|(3),
188 \&\fBX509_sign\fR\|(3),
189 \&\fBX509V3_get_d2i\fR\|(3),
190 \&\fBX509_verify_cert\fR\|(3)
191 .SH HISTORY
192 .IX Header "HISTORY"
193 The
194 \&\fBX509_get0_signature()\fR and \fBX509_get_signature_nid()\fR functions were
195 added in OpenSSL 1.0.2.
196 .PP
197 The
198 \&\fBX509_REQ_get0_signature()\fR, \fBX509_REQ_get_signature_nid()\fR,
199 \&\fBX509_CRL_get0_signature()\fR and \fBX509_CRL_get_signature_nid()\fR were
200 added in OpenSSL 1.1.0.
201 .PP
202 The \fBX509_REQ_set0_signature()\fR and \fBX509_REQ_set1_signature_algo()\fR
203 were added in OpenSSL 1.1.1e.
204 .PP
205 The \fBX509_ACERT_get0_signature()\fR, \fBX509_ACERT_get0_info_sigalg()\fR and
206 \&\fBX509_ACERT_get_signature_nid()\fR functions were added in OpenSSL 3.4.
207 .PP
208 The \fBX509_CRL_get0_tbs_sigalg()\fR function was added in OpenSSL 3.6.
209 .SH COPYRIGHT
210 .IX Header "COPYRIGHT"
211 Copyright 2015\-2025 The OpenSSL Project Authors. All Rights Reserved.
212 .PP
213 Licensed under the Apache License 2.0 (the "License"). You may not use
214 this file except in compliance with the License. You can obtain a copy
215 in the file LICENSE in the source distribution or at
216 <https://www.openssl.org/source/license.html>.