xref: /openbsd-src/lib/libcrypto/man/X509_get0_signature.3 (revision 99fd087599a8791921855f21bd7e36130f39aadc)
1.\" $OpenBSD: X509_get0_signature.3,v 1.5 2018/03/23 23:18:17 schwarze Exp $
2.\" selective merge up to:
3.\" OpenSSL man3/X509_get0_signature 2f7a2520 Apr 25 17:28:08 2017 +0100
4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2015 The OpenSSL Project.  All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in
17.\"    the documentation and/or other materials provided with the
18.\"    distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\"    software must display the following acknowledgment:
22.\"    "This product includes software developed by the OpenSSL Project
23.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\"    endorse or promote products derived from this software without
27.\"    prior written permission. For written permission, please contact
28.\"    openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\"    nor may "OpenSSL" appear in their names without prior written
32.\"    permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\"    acknowledgment:
36.\"    "This product includes software developed by the OpenSSL Project
37.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: March 23 2018 $
53.Dt X509_GET0_SIGNATURE 3
54.Os
55.Sh NAME
56.Nm X509_get0_signature ,
57.Nm X509_REQ_get0_signature ,
58.Nm X509_CRL_get0_signature ,
59.Nm X509_get0_tbs_sigalg ,
60.Nm X509_get_signature_nid ,
61.Nm X509_REQ_get_signature_nid ,
62.Nm X509_CRL_get_signature_nid
63.Nd signature information
64.Sh SYNOPSIS
65.In openssl/x509.h
66.Ft void
67.Fo X509_get0_signature
68.Fa "const ASN1_BIT_STRING **psig"
69.Fa "const X509_ALGOR **palg"
70.Fa "const X509 *x"
71.Fc
72.Ft void
73.Fo X509_REQ_get0_signature
74.Fa "const X509_REQ *req"
75.Fa "const ASN1_BIT_STRING **psig"
76.Fa "const X509_ALGOR **palg"
77.Fc
78.Ft void
79.Fo X509_CRL_get0_signature
80.Fa "const X509_CRL *crl"
81.Fa "const ASN1_BIT_STRING **psig"
82.Fa "const X509_ALGOR **palg"
83.Fc
84.Ft const X509_ALGOR *
85.Fo X509_get0_tbs_sigalg
86.Fa "const X509 *x"
87.Fc
88.Ft int
89.Fo X509_get_signature_nid
90.Fa "const X509 *x"
91.Fc
92.Ft int
93.Fo X509_REQ_get_signature_nid
94.Fa "const X509_REQ *req"
95.Fc
96.Ft int
97.Fo X509_CRL_get_signature_nid
98.Fa "const X509_CRL *crl"
99.Fc
100.Sh DESCRIPTION
101.Fn X509_get0_signature ,
102.Fn X509_REQ_get0_signature ,
103and
104.Fn X509_CRL_get0_signature
105set
106.Pf * Fa psig
107to the signature and
108.Pf * Fa palg
109to the signature algorithm of
110.Fa x ,
111.Fa req ,
112or
113.Fa crl ,
114respectively.
115.Fn X509_get0_tbs_sigalg
116returns the signature algorithm in the signed portion of
117.Fa x .
118The values returned are internal pointers
119that must not be freed by the caller.
120.Pp
121.Fn X509_get_signature_nid ,
122.Fn X509_REQ_get_signature_nid ,
123and
124.Fn X509_CRL_get_signature_nid
125return the NID corresponding to the signature algorithm of
126.Fa x ,
127.Fa req ,
128or
129.Fa crl ,
130respectively.
131.Pp
132These functions provide lower level access to the signature
133for cases where an application wishes to analyse or generate a
134signature in a form where
135.Xr X509_sign 3
136is not appropriate, for example in a non-standard or unsupported format.
137.Sh SEE ALSO
138.Xr OBJ_obj2nid 3 ,
139.Xr X509_ALGOR_new 3 ,
140.Xr X509_CRL_get0_by_serial 3 ,
141.Xr X509_CRL_new 3 ,
142.Xr X509_get_pubkey 3 ,
143.Xr X509_get_subject_name 3 ,
144.Xr X509_get_version 3 ,
145.Xr X509_new 3 ,
146.Xr X509_REQ_new 3 ,
147.Xr X509_sign 3 ,
148.Xr X509_verify_cert 3
149.Sh HISTORY
150.Fn X509_get0_signature
151and
152.Fn X509_get_signature_nid
153first appeared in OpenSSL 1.0.2.
154.Fn X509_REQ_get0_signature ,
155.Fn X509_CRL_get0_signature ,
156.Fn X509_get0_tbs_sigalg ,
157.Fn X509_REQ_get_signature_nid ,
158and
159.Fn X509_CRL_get_signature_nid
160first appeared in OpenSSL 1.1.0.
161All these functions have been available since
162.Ox 6.3 .
163