diff options
Diffstat (limited to 'src/lib/libcrypto/doc/EVP_OpenInit.pod')
| -rw-r--r-- | src/lib/libcrypto/doc/EVP_OpenInit.pod | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/lib/libcrypto/doc/EVP_OpenInit.pod b/src/lib/libcrypto/doc/EVP_OpenInit.pod new file mode 100644 index 0000000000..2e710da945 --- /dev/null +++ b/src/lib/libcrypto/doc/EVP_OpenInit.pod | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/evp.h> | ||
| 10 | |||
| 11 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, | ||
| 12 | int ekl,unsigned char *iv,EVP_PKEY *priv); | ||
| 13 | int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
| 14 | int *outl, unsigned char *in, int inl); | ||
| 15 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
| 16 | int *outl); | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | The EVP envelope routines are a high level interface to envelope | ||
| 21 | decryption. They decrypt a public key encrypted symmetric key and | ||
| 22 | then decrypt data using it. | ||
| 23 | |||
| 24 | EVP_OpenInit() initializes a cipher context B<ctx> for decryption | ||
| 25 | with cipher B<type>. It decrypts the encrypted symmetric key of length | ||
| 26 | B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. | ||
| 27 | The IV is supplied in the B<iv> parameter. | ||
| 28 | |||
| 29 | EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties | ||
| 30 | as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as | ||
| 31 | documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual | ||
| 32 | page. | ||
| 33 | |||
| 34 | =head1 NOTES | ||
| 35 | |||
| 36 | It is possible to call EVP_OpenInit() twice in the same way as | ||
| 37 | EVP_DecryptInit(). The first call should have B<priv> set to NULL | ||
| 38 | and (after setting any cipher parameters) it should be called again | ||
| 39 | with B<type> set to NULL. | ||
| 40 | |||
| 41 | If the cipher passed in the B<type> parameter is a variable length | ||
| 42 | cipher then the key length will be set to the value of the recovered | ||
| 43 | key length. If the cipher is a fixed length cipher then the recovered | ||
| 44 | key length must match the fixed cipher length. | ||
| 45 | |||
| 46 | =head1 RETURN VALUES | ||
| 47 | |||
| 48 | EVP_OpenInit() returns 0 on error or a non zero integer (actually the | ||
| 49 | recovered secret key size) if successful. | ||
| 50 | |||
| 51 | EVP_OpenUpdate() returns 1 for success or 0 for failure. | ||
| 52 | |||
| 53 | EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success. | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | L<evp(3)|evp(3)>, L<rand(3)|rand(3)>, | ||
| 58 | L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, | ||
| 59 | L<EVP_SealInit(3)|EVP_SealInit(3)> | ||
| 60 | |||
| 61 | =head1 HISTORY | ||
| 62 | |||
| 63 | =cut | ||
