1EVP_OPENINIT(3ossl)                 OpenSSL                EVP_OPENINIT(3ossl)
2
3
4

NAME

6       EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption
7

SYNOPSIS

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, int *outl);
16

DESCRIPTION

18       The EVP envelope routines are a high-level interface to envelope
19       decryption. They decrypt a public key encrypted symmetric key and then
20       decrypt data using it.
21
22       EVP_OpenInit() initializes a cipher context ctx for decryption with
23       cipher type. It decrypts the encrypted symmetric key of length ekl
24       bytes passed in the ek parameter using the private key priv.  The IV is
25       supplied in the iv parameter.
26
27       EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties
28       as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as
29       documented on the EVP_EncryptInit(3) manual page.
30

NOTES

32       It is possible to call EVP_OpenInit() twice in the same way as
33       EVP_DecryptInit(). The first call should have priv set to NULL and
34       (after setting any cipher parameters) it should be called again with
35       type set to NULL.
36
37       If the cipher passed in the type parameter is a variable length cipher
38       then the key length will be set to the value of the recovered key
39       length. If the cipher is a fixed length cipher then the recovered key
40       length must match the fixed cipher length.
41

RETURN VALUES

43       EVP_OpenInit() returns 0 on error or a non zero integer (actually the
44       recovered secret key size) if successful.
45
46       EVP_OpenUpdate() returns 1 for success or 0 for failure.
47
48       EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success.
49

SEE ALSO

51       evp(7), RAND_bytes(3), EVP_EncryptInit(3), EVP_SealInit(3)
52
54       Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
55
56       Licensed under the Apache License 2.0 (the "License").  You may not use
57       this file except in compliance with the License.  You can obtain a copy
58       in the file LICENSE in the source distribution or at
59       <https://www.openssl.org/source/license.html>.
60
61
62
633.0.5                             2022-11-01               EVP_OPENINIT(3ossl)
Impressum