summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/PKCS8_pkey_set0.3
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2025-04-14 17:32:06 +0000
committercvs2svn <admin@example.com>2025-04-14 17:32:06 +0000
commiteb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch)
treeedb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libcrypto/man/PKCS8_pkey_set0.3
parent247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff)
downloadopenbsd-tb_20250414.tar.gz
openbsd-tb_20250414.tar.bz2
openbsd-tb_20250414.zip
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libcrypto/man/PKCS8_pkey_set0.3')
-rw-r--r--src/lib/libcrypto/man/PKCS8_pkey_set0.3159
1 files changed, 0 insertions, 159 deletions
diff --git a/src/lib/libcrypto/man/PKCS8_pkey_set0.3 b/src/lib/libcrypto/man/PKCS8_pkey_set0.3
deleted file mode 100644
index f3d5a294c3..0000000000
--- a/src/lib/libcrypto/man/PKCS8_pkey_set0.3
+++ /dev/null
@@ -1,159 +0,0 @@
1.\" $OpenBSD: PKCS8_pkey_set0.3,v 1.3 2024/09/02 07:45:09 tb 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: September 2 2024 $
18.Dt PKCS8_PKEY_SET0 3
19.Os
20.Sh NAME
21.Nm PKCS8_pkey_set0 ,
22.Nm PKCS8_pkey_get0 ,
23.Nm PKCS8_pkey_add1_attr_by_NID ,
24.Nm PKCS8_pkey_get0_attrs
25.Nd change and inspect PKCS#8 PrivateKeyInfo objects
26.Sh SYNOPSIS
27.In openssl/x509.h
28.Ft int
29.Fo PKCS8_pkey_set0
30.Fa "PKCS8_PRIV_KEY_INFO *keyinfo"
31.Fa "ASN1_OBJECT *aobj"
32.Fa "int version"
33.Fa "int ptype"
34.Fa "void *pval"
35.Fa "unsigned char *data"
36.Fa "int len"
37.Fc
38.Ft int
39.Fo PKCS8_pkey_get0
40.Fa "const ASN1_OBJECT **paobj"
41.Fa "const unsigned char **pdata"
42.Fa "int *plen"
43.Fa "const X509_ALGOR **palgor"
44.Fa "const PKCS8_PRIV_KEY_INFO *keyinfo"
45.Fc
46.Ft int
47.Fo PKCS8_pkey_add1_attr_by_NID
48.Fa "PKCS8_PRIV_KEY_INFO *keyinfo"
49.Fa "int nid"
50.Fa "int type"
51.Fa "const unsigned char *data"
52.Fa "int len"
53.Fc
54.Ft const STACK_OF(X509_ATTRIBUTE) *
55.Fo PKCS8_pkey_get0_attrs
56.Fa "const PKCS8_PRIV_KEY_INFO *keyinfo"
57.Fc
58.Sh DESCRIPTION
59.Fn PKCS8_pkey_set0
60initializes the
61.Fa keyinfo
62object.
63The algorithm is set to
64.Fa aobj
65with the associated parameter type
66.Fa ptype
67and parameter value
68.Fa pval
69using
70.Xr X509_ALGOR_set0 3 ,
71replacing any previous information about the algorithm.
72Unless
73.Fa data
74is
75.Dv NULL ,
76the encoded private key is set to the
77.Fa len
78bytes starting at
79.Fa data
80using
81.Xr ASN1_STRING_set0 3 ,
82not performing any validation.
83If
84.Fa data
85is
86.Dv NULL ,
87the key data remains unchanged.
88If the
89.Fa version
90argument is greater than or equal to 0, it replaces any existing version;
91otherwise, the version remains unchanged.
92If
93.Fa keyinfo
94contains any attributes, they remain unchanged.
95.Pp
96.Fn PKCS8_pkey_get0
97retrieves some information from the
98.Fa keyinfo
99object.
100Internal pointers to the algorithm OID, the
101.Vt AlgorithmIdentifier ,
102and the encoded private key are stored in
103.Pf * Fa paobj ,
104.Pf * Fa palgor ,
105and
106.Pf * Fa pdata ,
107respectively.
108.Dv NULL
109pointers can be passed for any of these three arguments if the respective
110information is not needed.
111Unless
112.Fa pdata
113is
114.Dv NULL ,
115.Pf * Fa plen
116is set to the number of bytes in
117.Pf * Fa pdata .
118.Pp
119.Fn PKCS8_pkey_add1_attr_by_NID
120creates a new X.501 Attribute object using
121.Xr X509_ATTRIBUTE_create_by_NID 3
122and appends it to the attributes of
123.Fa keyinfo .
124.Sh RETURN VALUES
125.Fn PKCS8_pkey_set0
126and
127.Fn PKCS8_pkey_add1_attr_by_NID
128return 1 for success or 0 for failure.
129.Pp
130.Fn PKCS8_pkey_get0
131always returns 1.
132.Pp
133.Fn PKCS8_pkey_get0_attrs
134returns an internal pointer to the array of attributes associated with
135.Fa keyinfo
136or
137.Dv NULL
138if no attributes are set.
139.Sh SEE ALSO
140.Xr ASN1_STRING_set0 3 ,
141.Xr EVP_PKCS82PKEY 3 ,
142.Xr OBJ_nid2obj 3 ,
143.Xr PKCS8_PRIV_KEY_INFO_new 3 ,
144.Xr STACK_OF 3 ,
145.Xr X509_ALGOR_new 3 ,
146.Xr X509_ATTRIBUTE_create_by_NID 3 ,
147.Xr X509_ATTRIBUTE_new 3
148.Sh HISTORY
149.Fn PKCS8_pkey_set0
150and
151.Fn PKCS8_pkey_get0
152first appeared in OpenSSL 1.0.0 and have been available since
153.Ox 4.9 .
154.Pp
155.Fn PKCS8_pkey_add1_attr_by_NID
156and
157.Fn PKCS8_pkey_get0_attrs
158first appeared in OpenSSL 1.1.0 and have been available since
159.Ox 6.4 .