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