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