diff options
author | schwarze <> | 2021-10-22 15:50:19 +0000 |
---|---|---|
committer | schwarze <> | 2021-10-22 15:50:19 +0000 |
commit | 379657991e7db13a45611f7678c8ed8b54a2e017 (patch) | |
tree | 2f619887d4259aeafce07bbd9e7c179c02dd1da4 /src/lib | |
parent | 360688ab6e2f29d70361c863009f124dfaebd854 (diff) | |
download | openbsd-379657991e7db13a45611f7678c8ed8b54a2e017.tar.gz openbsd-379657991e7db13a45611f7678c8ed8b54a2e017.tar.bz2 openbsd-379657991e7db13a45611f7678c8ed8b54a2e017.zip |
new manual page EVP_PKEY_add1_attr(3) documenting nine functions
for associating X.501 Attributes with private keys
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/man/EVP_PKEY_add1_attr.3 | 188 | ||||
-rw-r--r-- | src/lib/libcrypto/man/EVP_PKEY_new.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/PKCS12_create.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/X509at_add1_attr.3 | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/X509at_get_attr.3 | 3 |
7 files changed, 202 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_add1_attr.3 b/src/lib/libcrypto/man/EVP_PKEY_add1_attr.3 new file mode 100644 index 0000000000..8d30c40b68 --- /dev/null +++ b/src/lib/libcrypto/man/EVP_PKEY_add1_attr.3 | |||
@@ -0,0 +1,188 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_add1_attr.3,v 1.1 2021/10/22 15:50:19 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: October 22 2021 $ | ||
18 | .Dt EVP_PKEY_ADD1_ATTR 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm EVP_PKEY_add1_attr , | ||
22 | .Nm EVP_PKEY_add1_attr_by_OBJ , | ||
23 | .Nm EVP_PKEY_add1_attr_by_NID , | ||
24 | .Nm EVP_PKEY_add1_attr_by_txt , | ||
25 | .Nm EVP_PKEY_delete_attr , | ||
26 | .Nm EVP_PKEY_get_attr , | ||
27 | .Nm EVP_PKEY_get_attr_count , | ||
28 | .Nm EVP_PKEY_get_attr_by_OBJ , | ||
29 | .Nm EVP_PKEY_get_attr_by_NID | ||
30 | .Nd X.501 Attributes of private keys | ||
31 | .Sh SYNOPSIS | ||
32 | .In openssl/x509.h | ||
33 | .Ft int | ||
34 | .Fo EVP_PKEY_add1_attr | ||
35 | .Fa "EVP_PKEY *key" | ||
36 | .Fa "X509_ATTRIBUTE *attr" | ||
37 | .Fc | ||
38 | .Ft int | ||
39 | .Fo EVP_PKEY_add1_attr_by_OBJ | ||
40 | .Fa "EVP_PKEY *key" | ||
41 | .Fa "const ASN1_OBJECT *obj" | ||
42 | .Fa "int type" | ||
43 | .Fa "const unsigned char *data" | ||
44 | .Fa "int len" | ||
45 | .Fc | ||
46 | .Ft int | ||
47 | .Fo EVP_PKEY_add1_attr_by_NID | ||
48 | .Fa "EVP_PKEY *key" | ||
49 | .Fa "int nid" | ||
50 | .Fa "int type" | ||
51 | .Fa "const unsigned char *data" | ||
52 | .Fa "int len" | ||
53 | .Fc | ||
54 | .Ft int | ||
55 | .Fo EVP_PKEY_add1_attr_by_txt | ||
56 | .Fa "EVP_PKEY *key" | ||
57 | .Fa "const char *name" | ||
58 | .Fa "int type" | ||
59 | .Fa "const unsigned char *data" | ||
60 | .Fa "int len" | ||
61 | .Fc | ||
62 | .Ft X509_ATTRIBUTE * | ||
63 | .Fo EVP_PKEY_delete_attr | ||
64 | .Fa "EVP_PKEY *key" | ||
65 | .Fa "int index" | ||
66 | .Fc | ||
67 | .Ft X509_ATTRIBUTE * | ||
68 | .Fo EVP_PKEY_get_attr | ||
69 | .Fa "const EVP_PKEY *key" | ||
70 | .Fa "int index" | ||
71 | .Fc | ||
72 | .Ft int | ||
73 | .Fo EVP_PKEY_get_attr_count | ||
74 | .Fa "const EVP_PKEY *key" | ||
75 | .Fc | ||
76 | .Ft int | ||
77 | .Fo EVP_PKEY_get_attr_by_OBJ | ||
78 | .Fa "const EVP_PKEY *key" | ||
79 | .Fa "const ASN1_OBJECT *obj" | ||
80 | .Fa "int start_after" | ||
81 | .Fc | ||
82 | .Ft int | ||
83 | .Fo EVP_PKEY_get_attr_by_NID | ||
84 | .Fa "const EVP_PKEY *key" | ||
85 | .Fa "int nid" | ||
86 | .Fa "int start_after" | ||
87 | .Fc | ||
88 | .Sh DESCRIPTION | ||
89 | These functions support associating an array of X.501 Attributes | ||
90 | with a private key. | ||
91 | Such attributes can for example be included in PKCS#12 structures. | ||
92 | .Pp | ||
93 | .Fn EVP_PKEY_add1_attr | ||
94 | appends a deep copy of the | ||
95 | .Fa attr | ||
96 | using | ||
97 | .Xr X509at_add1_attr 3 . | ||
98 | .Pp | ||
99 | .Fn EVP_PKEY_add1_attr_by_OBJ , | ||
100 | .Fn EVP_PKEY_add1_attr_by_NID , | ||
101 | and | ||
102 | .Fn EVP_PKEY_add1_attr_by_txt | ||
103 | create a new X.501 Attribute object using | ||
104 | .Xr X509_ATTRIBUTE_create_by_OBJ 3 , | ||
105 | .Xr X509_ATTRIBUTE_create_by_NID 3 , | ||
106 | or | ||
107 | .Xr X509_ATTRIBUTE_create_by_txt 3 , | ||
108 | respectively, and append it using | ||
109 | .Xr X509at_add1_attr 3 . | ||
110 | .Pp | ||
111 | .Fn EVP_PKEY_delete_attr | ||
112 | deletes the attribute with the zero-based | ||
113 | .Fa index | ||
114 | using | ||
115 | .Xr X509at_delete_attr 3 . | ||
116 | .Pp | ||
117 | .Fn EVP_PKEY_get_attr | ||
118 | returns the attribute with the zero-based | ||
119 | .Fa index | ||
120 | using | ||
121 | .Xr X509at_get_attr 3 . | ||
122 | .Pp | ||
123 | .Fn EVP_PKEY_get_attr_count | ||
124 | returns the number of attributes currently associated with the | ||
125 | .Fa key | ||
126 | using | ||
127 | .Xr X509at_get_attr_count 3 . | ||
128 | .Pp | ||
129 | .Fn EVP_PKEY_get_attr_by_OBJ | ||
130 | and | ||
131 | .Fn EVP_PKEY_get_attr_by_NID | ||
132 | search for an attribute of the type | ||
133 | .Fa obj | ||
134 | or | ||
135 | .Fa nid | ||
136 | using | ||
137 | .Xr X509at_get_attr_by_OBJ 3 | ||
138 | or | ||
139 | .Xr X509at_get_attr_by_NID 3 , | ||
140 | respectively. | ||
141 | .Sh RETURN VALUES | ||
142 | .Fn EVP_PKEY_add1_attr , | ||
143 | .Fn EVP_PKEY_add1_attr_by_OBJ , | ||
144 | .Fn EVP_PKEY_add1_attr_by_NID , | ||
145 | and | ||
146 | .Fn EVP_PKEY_add1_attr_by_txt | ||
147 | return 1 for success or 0 for failure. | ||
148 | .Pp | ||
149 | .Fn EVP_PKEY_delete_attr | ||
150 | and | ||
151 | .Fn X509at_get_attr | ||
152 | return the deleted or requested attribute or | ||
153 | .Dv NULL | ||
154 | if the requested index is negative or greater than or equal to | ||
155 | the current number of attributes associated with the | ||
156 | .Fa key . | ||
157 | .Pp | ||
158 | .Fn EVP_PKEY_get_attr_count | ||
159 | returns the current number of attributes. | ||
160 | .Pp | ||
161 | .Fn EVP_PKEY_get_attr_by_OBJ | ||
162 | and | ||
163 | .Fn EVP_PKEY_get_attr_by_NID | ||
164 | return the index of the first attribute that has an index greater than | ||
165 | .Fa start_after | ||
166 | and a type matching | ||
167 | .Fa obj | ||
168 | or | ||
169 | .Fa nid , | ||
170 | respectively, or \-1 on failure. | ||
171 | In addition, | ||
172 | .Fn EVP_PKEY_get_attr_by_NID | ||
173 | returns \-2 if | ||
174 | .Xr OBJ_nid2obj 3 | ||
175 | fails on the requested | ||
176 | .Fa nid . | ||
177 | .Sh SEE ALSO | ||
178 | .Xr EVP_PKEY_new 3 , | ||
179 | .Xr OBJ_nid2obj 3 , | ||
180 | .Xr PKCS12_create 3 , | ||
181 | .Xr X509_ATTRIBUTE_create_by_OBJ 3 , | ||
182 | .Xr X509_ATTRIBUTE_new 3 , | ||
183 | .Xr X509at_add1_attr 3 , | ||
184 | .Xr X509at_get_attr 3 | ||
185 | .Sh HISTORY | ||
186 | These funtions first appeared in OpenSSL 0.9.8 | ||
187 | and have been available since | ||
188 | .Ox 4.5 . | ||
diff --git a/src/lib/libcrypto/man/EVP_PKEY_new.3 b/src/lib/libcrypto/man/EVP_PKEY_new.3 index 76eb345941..754fe94e60 100644 --- a/src/lib/libcrypto/man/EVP_PKEY_new.3 +++ b/src/lib/libcrypto/man/EVP_PKEY_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: EVP_PKEY_new.3,v 1.14 2021/10/19 17:42:49 schwarze Exp $ | 1 | .\" $OpenBSD: EVP_PKEY_new.3,v 1.15 2021/10/22 15:50:19 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 |
3 | .\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 | 3 | .\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 |
4 | .\" | 4 | .\" |
@@ -50,7 +50,7 @@ | |||
50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
52 | .\" | 52 | .\" |
53 | .Dd $Mdocdate: October 19 2021 $ | 53 | .Dd $Mdocdate: October 22 2021 $ |
54 | .Dt EVP_PKEY_NEW 3 | 54 | .Dt EVP_PKEY_NEW 3 |
55 | .Os | 55 | .Os |
56 | .Sh NAME | 56 | .Sh NAME |
@@ -184,6 +184,7 @@ returns 1 for success or 0 for failure. | |||
184 | .Xr CMAC_Init 3 , | 184 | .Xr CMAC_Init 3 , |
185 | .Xr d2i_PrivateKey 3 , | 185 | .Xr d2i_PrivateKey 3 , |
186 | .Xr evp 3 , | 186 | .Xr evp 3 , |
187 | .Xr EVP_PKEY_add1_attr 3 , | ||
187 | .Xr EVP_PKEY_asn1_new 3 , | 188 | .Xr EVP_PKEY_asn1_new 3 , |
188 | .Xr EVP_PKEY_cmp 3 , | 189 | .Xr EVP_PKEY_cmp 3 , |
189 | .Xr EVP_PKEY_CTX_new 3 , | 190 | .Xr EVP_PKEY_CTX_new 3 , |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 74b3a251af..6179d3157b 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.198 2021/10/22 13:29:41 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.199 2021/10/22 15:50:19 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -159,6 +159,7 @@ MAN= \ | |||
159 | EVP_EncodeInit.3 \ | 159 | EVP_EncodeInit.3 \ |
160 | EVP_EncryptInit.3 \ | 160 | EVP_EncryptInit.3 \ |
161 | EVP_OpenInit.3 \ | 161 | EVP_OpenInit.3 \ |
162 | EVP_PKEY_add1_attr.3 \ | ||
162 | EVP_PKEY_asn1_new.3 \ | 163 | EVP_PKEY_asn1_new.3 \ |
163 | EVP_PKEY_asn1_get_count.3 \ | 164 | EVP_PKEY_asn1_get_count.3 \ |
164 | EVP_PKEY_CTX_ctrl.3 \ | 165 | EVP_PKEY_CTX_ctrl.3 \ |
diff --git a/src/lib/libcrypto/man/PKCS12_create.3 b/src/lib/libcrypto/man/PKCS12_create.3 index 1f44ef9b67..d19a6f3e44 100644 --- a/src/lib/libcrypto/man/PKCS12_create.3 +++ b/src/lib/libcrypto/man/PKCS12_create.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: PKCS12_create.3,v 1.10 2021/07/09 12:07:27 schwarze Exp $ | 1 | .\" $OpenBSD: PKCS12_create.3,v 1.11 2021/10/22 15:50:19 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400 | 2 | .\" full merge up to: OpenSSL 05ea606a May 20 20:52:46 2016 -0400 |
3 | .\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 | 3 | .\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 |
4 | .\" | 4 | .\" |
@@ -49,7 +49,7 @@ | |||
49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
51 | .\" | 51 | .\" |
52 | .Dd $Mdocdate: July 9 2021 $ | 52 | .Dd $Mdocdate: October 22 2021 $ |
53 | .Dt PKCS12_CREATE 3 | 53 | .Dt PKCS12_CREATE 3 |
54 | .Os | 54 | .Os |
55 | .Sh NAME | 55 | .Sh NAME |
@@ -165,6 +165,7 @@ if an error occurred. | |||
165 | .Sh SEE ALSO | 165 | .Sh SEE ALSO |
166 | .Xr crypto 3 , | 166 | .Xr crypto 3 , |
167 | .Xr d2i_PKCS12 3 , | 167 | .Xr d2i_PKCS12 3 , |
168 | .Xr EVP_PKEY_add1_attr 3 , | ||
168 | .Xr PKCS12_new 3 , | 169 | .Xr PKCS12_new 3 , |
169 | .Xr PKCS12_newpass 3 , | 170 | .Xr PKCS12_newpass 3 , |
170 | .Xr PKCS12_parse 3 , | 171 | .Xr PKCS12_parse 3 , |
diff --git a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 index 1d059accea..5e4fe27efe 100644 --- a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 +++ b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.13 2021/10/22 13:29:41 schwarze Exp $ | 1 | .\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.14 2021/10/22 15:50:19 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -111,6 +111,7 @@ fails on | |||
111 | .Fa nid . | 111 | .Fa nid . |
112 | .Sh SEE ALSO | 112 | .Sh SEE ALSO |
113 | .Xr d2i_X509_ATTRIBUTE 3 , | 113 | .Xr d2i_X509_ATTRIBUTE 3 , |
114 | .Xr EVP_PKEY_add1_attr 3 , | ||
114 | .Xr OBJ_nid2obj 3 , | 115 | .Xr OBJ_nid2obj 3 , |
115 | .Xr PKCS12_SAFEBAG_new 3 , | 116 | .Xr PKCS12_SAFEBAG_new 3 , |
116 | .Xr PKCS7_add_attribute 3 , | 117 | .Xr PKCS7_add_attribute 3 , |
diff --git a/src/lib/libcrypto/man/X509at_add1_attr.3 b/src/lib/libcrypto/man/X509at_add1_attr.3 index cb5999a702..823cf5b4f3 100644 --- a/src/lib/libcrypto/man/X509at_add1_attr.3 +++ b/src/lib/libcrypto/man/X509at_add1_attr.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: X509at_add1_attr.3,v 1.1 2021/10/22 13:29:41 schwarze Exp $ | 1 | .\" $OpenBSD: X509at_add1_attr.3,v 1.2 2021/10/22 15:50:19 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -120,6 +120,7 @@ or if the requested | |||
120 | is negative or greater than or equal to the number of objects in | 120 | is negative or greater than or equal to the number of objects in |
121 | .Pf * Fa attrs . | 121 | .Pf * Fa attrs . |
122 | .Sh SEE ALSO | 122 | .Sh SEE ALSO |
123 | .Xr EVP_PKEY_add1_attr 3 , | ||
123 | .Xr OBJ_nid2obj 3 , | 124 | .Xr OBJ_nid2obj 3 , |
124 | .Xr STACK_OF 3 , | 125 | .Xr STACK_OF 3 , |
125 | .Xr X509_ATTRIBUTE_create_by_OBJ 3 , | 126 | .Xr X509_ATTRIBUTE_create_by_OBJ 3 , |
diff --git a/src/lib/libcrypto/man/X509at_get_attr.3 b/src/lib/libcrypto/man/X509at_get_attr.3 index 64a2d8d479..8534034317 100644 --- a/src/lib/libcrypto/man/X509at_get_attr.3 +++ b/src/lib/libcrypto/man/X509at_get_attr.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: X509at_get_attr.3,v 1.2 2021/10/22 13:29:41 schwarze Exp $ | 1 | .\" $OpenBSD: X509at_get_attr.3,v 1.3 2021/10/22 15:50:19 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -139,6 +139,7 @@ or | |||
139 | .Dv NULL | 139 | .Dv NULL |
140 | on failure. | 140 | on failure. |
141 | .Sh SEE ALSO | 141 | .Sh SEE ALSO |
142 | .Xr EVP_PKEY_get_attr 3 , | ||
142 | .Xr OBJ_nid2obj 3 , | 143 | .Xr OBJ_nid2obj 3 , |
143 | .Xr STACK_OF 3 , | 144 | .Xr STACK_OF 3 , |
144 | .Xr X509_ATTRIBUTE_get0_data 3 , | 145 | .Xr X509_ATTRIBUTE_get0_data 3 , |