2
0

EVP_OpenInit.pod 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. =pod
  2. =head1 NAME
  3. EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption
  4. =head1 SYNOPSIS
  5. #include <openssl/evp.h>
  6. int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek,
  7. int ekl,unsigned char *iv,EVP_PKEY *priv);
  8. int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
  9. int *outl, unsigned char *in, int inl);
  10. int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
  11. int *outl);
  12. =head1 DESCRIPTION
  13. The EVP envelope routines are a high level interface to envelope
  14. decryption. They decrypt a public key encrypted symmetric key and
  15. then decrypt data using it.
  16. EVP_OpenInit() initializes a cipher context B<ctx> for decryption
  17. with cipher B<type>. It decrypts the encrypted symmetric key of length
  18. B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>.
  19. The IV is supplied in the B<iv> parameter.
  20. EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties
  21. as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as
  22. documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual
  23. page.
  24. =head1 NOTES
  25. It is possible to call EVP_OpenInit() twice in the same way as
  26. EVP_DecryptInit(). The first call should have B<priv> set to NULL
  27. and (after setting any cipher parameters) it should be called again
  28. with B<type> set to NULL.
  29. If the cipher passed in the B<type> parameter is a variable length
  30. cipher then the key length will be set to the value of the recovered
  31. key length. If the cipher is a fixed length cipher then the recovered
  32. key length must match the fixed cipher length.
  33. =head1 RETURN VALUES
  34. EVP_OpenInit() returns 0 on error or a non zero integer (actually the
  35. recovered secret key size) if successful.
  36. EVP_OpenUpdate() returns 1 for success or 0 for failure.
  37. EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success.
  38. =head1 SEE ALSO
  39. L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
  40. L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
  41. L<EVP_SealInit(3)|EVP_SealInit(3)>
  42. =head1 HISTORY
  43. =cut