xref: /freebsd/crypto/openssl/doc/man3/PKCS12_decrypt_skey.pod (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1=pod
2
3=head1 NAME
4
5PKCS12_decrypt_skey, PKCS12_decrypt_skey_ex - PKCS12 shrouded keyBag
6decrypt functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/pkcs12.h>
11
12 PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
13                                          const char *pass, int passlen);
14 PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey_ex(const PKCS12_SAFEBAG *bag,
15                                             const char *pass, int passlen,
16                                             OSSL_LIB_CTX *ctx,
17                                             const char *propq);
18
19=head1 DESCRIPTION
20
21PKCS12_decrypt_skey() Decrypt the PKCS#8 shrouded keybag contained within I<bag>
22using the supplied password I<pass> of length I<passlen>.
23
24PKCS12_decrypt_skey_ex() is similar to the above but allows for a library context
25I<ctx> and property query I<propq> to be used to select algorithm implementations.
26
27=head1 RETURN VALUES
28
29Both functions will return the decrypted key or NULL if an error occurred.
30
31=head1 CONFORMING TO
32
33IETF RFC 7292 (L<https://tools.ietf.org/html/rfc7292>)
34
35=head1 SEE ALSO
36
37L<PKCS8_decrypt_ex(3)>,
38L<PKCS8_encrypt_ex(3)>,
39L<PKCS12_add_key_ex(3)>,
40L<PKCS12_SAFEBAG_create_pkcs8_encrypt_ex(3)>
41
42=head1 HISTORY
43
44PKCS12_decrypt_skey_ex() was added in OpenSSL 3.0.
45
46=head1 COPYRIGHT
47
48Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
49
50Licensed under the Apache License 2.0 (the "License").  You may not use
51this file except in compliance with the License.  You can obtain a copy
52in the file LICENSE in the source distribution or at
53L<https://www.openssl.org/source/license.html>.
54
55=cut
56