summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_OpenInit.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/EVP_OpenInit.3')
-rw-r--r--src/lib/libcrypto/man/EVP_OpenInit.398
1 files changed, 98 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/EVP_OpenInit.3 b/src/lib/libcrypto/man/EVP_OpenInit.3
new file mode 100644
index 0000000000..92873ac453
--- /dev/null
+++ b/src/lib/libcrypto/man/EVP_OpenInit.3
@@ -0,0 +1,98 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt EVP_OPENINIT 3
3.Os
4.Sh NAME
5.Nm EVP_OpenInit ,
6.Nm EVP_OpenUpdate ,
7.Nm EVP_OpenFinal
8.Nd EVP envelope decryption
9.Sh SYNOPSIS
10.In openssl/evp.h
11.Ft int
12.Fo EVP_OpenInit
13.Fa "EVP_CIPHER_CTX *ctx"
14.Fa "EVP_CIPHER *type"
15.Fa "unsigned char *ek"
16.Fa "int ekl"
17.Fa "unsigned char *iv"
18.Fa "EVP_PKEY *priv"
19.Fc
20.Ft int
21.Fo EVP_OpenUpdate
22.Fa "EVP_CIPHER_CTX *ctx"
23.Fa "unsigned char *out"
24.Fa "int *outl"
25.Fa "unsigned char *in"
26.Fa "int inl"
27.Fc
28.Ft int
29.Fo EVP_OpenFinal
30.Fa "EVP_CIPHER_CTX *ctx"
31.Fa "unsigned char *out"
32.Fa "int *outl"
33.Fc
34.Sh DESCRIPTION
35The EVP envelope routines are a high level interface to envelope
36decryption.
37They decrypt a public key encrypted symmetric key and then decrypt data
38using it.
39.Pp
40.Fn EVP_OpenInit
41initializes a cipher context
42.Fa ctx
43for decryption with cipher
44.Fa type .
45It decrypts the encrypted symmetric key of length
46.Fa ekl
47bytes passed in the
48.Fa ek
49parameter using the private key
50.Fa priv .
51The IV is supplied in the
52.Fa iv
53parameter.
54.Pp
55.Fn EVP_OpenUpdate
56and
57.Fn EVP_OpenFinal
58have exactly the same properties as the
59.Xr EVP_DecryptUpdate 3
60and
61.Xr EVP_DecryptFinal 3
62routines.
63.Pp
64It is possible to call
65.Fn EVP_OpenInit
66twice in the same way as
67.Xr EVP_DecryptInit 3 .
68The first call should have
69.Fa priv
70set to
71.Dv NULL
72and (after setting any cipher parameters) it should be
73called again with
74.Fa type
75set to
76.Dv NULL .
77.Pp
78If the cipher passed in the
79.Fa type
80parameter is a variable length cipher then the key length will be set to
81the value of the recovered key length.
82If the cipher is a fixed length cipher then the recovered key length
83must match the fixed cipher length.
84.Sh RETURN VALUES
85.Fn EVP_OpenInit
86returns 0 on error or a non zero integer (actually the recovered secret
87key size) if successful.
88.Pp
89.Fn EVP_OpenUpdate
90returns 1 for success or 0 for failure.
91.Pp
92.Fn EVP_OpenFinal
93returns 0 if the decrypt failed or 1 for success.
94.Sh SEE ALSO
95.Xr evp 3 ,
96.Xr EVP_EncryptInit 3 ,
97.Xr EVP_SealInit 3 ,
98.Xr rand 3