PKCS12_item_decrypt_d2i.pod 2.9 KB

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