summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ASN1_item_sign.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/man/ASN1_item_sign.3120
1 files changed, 0 insertions, 120 deletions
diff --git a/src/lib/libcrypto/man/ASN1_item_sign.3 b/src/lib/libcrypto/man/ASN1_item_sign.3
deleted file mode 100644
index 8c09fe77ff..0000000000
--- a/src/lib/libcrypto/man/ASN1_item_sign.3
+++ /dev/null
@@ -1,120 +0,0 @@
1.\" $OpenBSD: ASN1_item_sign.3,v 1.3 2024/12/06 12:51:13 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: December 6 2024 $
18.Dt ASN1_ITEM_SIGN 3
19.Os
20.Sh NAME
21.Nm ASN1_item_sign ,
22.Nm ASN1_item_sign_ctx
23.Nd DER-encode and sign an ASN.1 value
24.Sh SYNOPSIS
25.In openssl/x509.h
26.Ft int
27.Fo ASN1_item_sign
28.Fa "const ASN1_ITEM *it"
29.Fa "X509_ALGOR *algor1"
30.Fa "X509_ALGOR *algor2"
31.Fa "ASN1_BIT_STRING *sig_out"
32.Fa "void *val_in"
33.Fa "EVP_PKEY *pkey"
34.Fa "const EVP_MD *type"
35.Fc
36.Ft int
37.Fo ASN1_item_sign_ctx
38.Fa "const ASN1_ITEM *it"
39.Fa "X509_ALGOR *algor1"
40.Fa "X509_ALGOR *algor2"
41.Fa "ASN1_BIT_STRING *sig_out"
42.Fa "void *val_in"
43.Fa "EVP_MD_CTX *ctx"
44.Fc
45.Sh DESCRIPTION
46.Fn ASN1_item_sign
47assumes that
48.Fa val_in
49is an
50.Vt ASN1_VALUE
51of the type specified by
52.Fa it ,
53encodes it into DER format by calling
54.Xr ASN1_item_i2d 3 ,
55and signs the resulting byte array in a way similar to
56.Xr EVP_DigestSign 3 ,
57using a signing context created with
58.Xr EVP_DigestSignInit 3
59for the given digest
60.Fa type
61and private key
62.Fa pkey .
63The created signature is placed into the
64.Fa sig_out
65object provided by the caller,
66freeing and replacing any data already contained in that object.
67.Pp
68.Fn ASN1_item_sign_ctx
69is similar except that the provided
70.Ft ctx
71is used rather than creating a new one.
72No matter whether
73.Fn ASN1_item_sign_ctx
74succeeds or fails,
75.Xr EVP_MD_CTX_cleanup 3
76is called on
77.Fa ctx
78before returning.
79.Pp
80For both functions, unless
81.Fa algor1
82is
83.Dv NULL ,
84its algorithm OID and parameter type are set according to the digest
85.Fa type
86used, and its parameter value is cleared.
87In RSA-PSS mode, the parameter value is also copied into
88.Fa algor1 .
89Unless
90.Fa algor2
91is
92.Dv NULL ,
93the same data is copied into it.
94.Sh RETURN VALUES
95These functions return the length of the signature in bytes
96or 0 if memory allocation, encoding, or signing fails.
97.Pp
98.Fn ASN1_item_sign_ctx
99also fails and returns 0 if
100.Fa ctx
101is not fully initialized.
102.Sh SEE ALSO
103.Xr ASN1_BIT_STRING_new 3 ,
104.Xr ASN1_item_digest 3 ,
105.Xr ASN1_item_i2d 3 ,
106.Xr ASN1_item_verify 3 ,
107.Xr EVP_Digest 3 ,
108.Xr EVP_DigestSign 3 ,
109.Xr EVP_MD_CTX_new 3 ,
110.Xr EVP_PKEY_new 3 ,
111.Xr OBJ_find_sigid_by_algs 3 ,
112.Xr X509_ALGOR_new 3
113.Sh HISTORY
114.Fn ASN1_item_sign
115first appeared in OpenSSL 0.9.7 and has been available since
116.Ox 3.1 .
117.Pp
118.Fn ASN1_item_sign_ctx
119first appeared in OpenSSL 1.0.1 and has been available since
120.Ox 5.3 .