Debian Codegraph @

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