1=pod
2
3=head1 NAME
4
5PKCS12_item_decrypt_d2i, PKCS12_item_decrypt_d2i_ex,
6PKCS12_item_i2d_encrypt, PKCS12_item_i2d_encrypt_ex - PKCS12 item
7encrypt/decrypt functions
8
9=head1 SYNOPSIS
10
11 #include <openssl/pkcs12.h>
12
13 void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
14                               const char *pass, int passlen,
15                               const ASN1_OCTET_STRING *oct, int zbuf);
16 void *PKCS12_item_decrypt_d2i_ex(const X509_ALGOR *algor, const ASN1_ITEM *it,
17                                  const char *pass, int passlen,
18                                  const ASN1_OCTET_STRING *oct, int zbuf,
19                                  OSSL_LIB_CTX *libctx,
20                                  const char *propq);
21 ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
22                                            const ASN1_ITEM *it,
23                                            const char *pass, int passlen,
24                                            void *obj, int zbuf);
25 ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt_ex(X509_ALGOR *algor,
26                                               const ASN1_ITEM *it,
27                                               const char *pass, int passlen,
28                                               void *obj, int zbuf,
29                                               OSSL_LIB_CTX *ctx,
30                                               const char *propq);
31
32=head1 DESCRIPTION
33
34PKCS12_item_decrypt_d2i() and PKCS12_item_decrypt_d2i_ex() decrypt an octet
35string containing an ASN.1 encoded object using the algorithm I<algor> and
36password I<pass> of length I<passlen>. If I<zbuf> is nonzero then the output
37buffer will zeroed after the decrypt.
38
39PKCS12_item_i2d_encrypt() and PKCS12_item_i2d_encrypt_ex() encrypt an ASN.1
40object I<it> using the algorithm I<algor> and password I<pass> of length
41I<passlen>, returning an encoded object in I<obj>. If I<zbuf> is nonzero then
42the buffer containing the input encoding will be zeroed after the encrypt.
43
44Functions ending in _ex() allow for a library context I<ctx> and property query
45I<propq> to be used to select algorithm implementations.
46
47=head1 RETURN VALUES
48
49PKCS12_item_decrypt_d2i() and PKCS12_item_decrypt_d2i_ex() return the decrypted
50object or NULL if an error occurred.
51
52PKCS12_item_i2d_encrypt() and PKCS12_item_i2d_encrypt_ex() return the encrypted
53data as an ASN.1 Octet String or NULL if an error occurred.
54
55=head1 SEE ALSO
56
57L<PKCS12_pbe_crypt_ex(3)>,
58L<PKCS8_encrypt_ex(3)>
59
60=head1 HISTORY
61
62PKCS12_item_decrypt_d2i_ex() and PKCS12_item_i2d_encrypt_ex() were added in OpenSSL 3.0.
63
64=head1 COPYRIGHT
65
66Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
67
68Licensed under the Apache License 2.0 (the "License").  You may not use
69this file except in compliance with the License.  You can obtain a copy
70in the file LICENSE in the source distribution or at
71L<https://www.openssl.org/source/license.html>.
72
73=cut
74