NAME
EVPOpenInit, EVPOpenUpdate, EVPOpenFinal - EVP envelope decryption
SYNOPSIS
#include
int EVPOpenInit(EVPCIPHERCTX *ctx,EVPCIPHER *type,unsigned char *ek, int ekl,unsigned char *iv,EVPPKEY *priv); int EVPOpenUpdate(EVPCIPHERCTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl); int EVPOpenFinal(EVPCIPHERCTX *ctx, unsigned char *out, int *outl);DESCRIPTION
The EVP envelope routines are a high level interface to envelope decryption. They decrypt a public key encrypted symmetric key and then decrypt data using it. EVPOpenInit() initializes a cipher context ccttxx for decryption with cipher ttyyppee. It decrypts the encrypted symmetric key of length eekkll bytes passed in the eekk parameter using the private key pprriivv. The IV is supplied in the iivv parameter. EVPOpenUpdate() and EVPOpenFinal() have exactly the same properties as the EVPDecryptUpdate() and EVPDecryptFinal() routines, as documented on the EVPEncryptInit(3) manual page. NNOOTTEESS It is possible to call EVPOpenInit() twice in the same way as EVPDecryptInit(). The first call should have pprriivv set to NULL and (after setting any cipher parameters) it should be called again with ttyyppee set to NULL. If the cipher passed in the ttyyppee parameter is a variable length cipher then the key length will be set to the value of the recovered key length. If the cipher is a fixed length cipher then the recovered key length must match the fixed cipher length.RETURN VALUES
EVPOpenInit() returns 0 on error or a non zero integer (actually the recovered secret key size) if successful. EVPOpenUpdate() returns 1 for success or 0 for failure. EVPOpenFinal() returns 0 if the decrypt failed or 1 for success.SEE ALSO
evp(3), rand(3), EVPEncryptInit(3), EVPSealInit(3) HISTORY0.9.7l 2000-09-23 EVPOpenInit(3)