⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evp_sealinit.pod

📁 开源的ssl算法openssl,版本0.9.8H
💻 POD
字号:
=pod=head1 NAMEEVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption=head1 SYNOPSIS #include <openssl/evp.h> int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,                  unsigned char **ek, int *ekl, unsigned char *iv,                  EVP_PKEY **pubk, int npubk); int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,         int *outl, unsigned char *in, int inl); int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,         int *outl);=head1 DESCRIPTIONThe EVP envelope routines are a high level interface to envelopeencryption. They generate a random key and IV (if required) then"envelope" it by using public key encryption. Data can then beencrypted using this key.EVP_SealInit() initializes a cipher context B<ctx> for encryptionwith cipher B<type> using a random secret key and IV. B<type> is normallysupplied by a function such as EVP_des_cbc(). The secret key is encryptedusing one or more public keys, this allows the same encrypted data to bedecrypted using any of the corresponding private keys. B<ek> is an array ofbuffers where the public key encrypted secret key will be written, each buffermust contain enough room for the corresponding encrypted key: that isB<ek[i]> must have room for B<EVP_PKEY_size(pubk[i])> bytes. The actualsize of each encrypted secret key is written to the array B<ekl>. B<pubk> isan array of B<npubk> public keys.The B<iv> parameter is a buffer where the generated IV is written to. It mustcontain enough room for the corresponding cipher's IV, as determined by (forexample) EVP_CIPHER_iv_length(type).If the cipher does not require an IV then the B<iv> parameter is ignoredand can be B<NULL>.EVP_SealUpdate() and EVP_SealFinal() have exactly the same propertiesas the EVP_EncryptUpdate() and EVP_EncryptFinal() routines, as documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manualpage. =head1 RETURN VALUESEVP_SealInit() returns 0 on error or B<npubk> if successful.EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 forfailure.=head1 NOTESBecause a random secret key is generated the random number generatormust be seeded before calling EVP_SealInit().The public key must be RSA because it is the only OpenSSL public keyalgorithm that supports key transport.Envelope encryption is the usual method of using public key encryptionon large amounts of data, this is because public key encryption is slowbut symmetric encryption is fast. So symmetric encryption is used forbulk encryption and the small random symmetric key used is transferredusing public key encryption.It is possible to call EVP_SealInit() twice in the same way asEVP_EncryptInit(). The first call should have B<npubk> set to 0and (after setting any cipher parameters) it should be called againwith B<type> set to NULL.=head1 SEE ALSOL<evp(3)|evp(3)>, L<rand(3)|rand(3)>,L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,L<EVP_OpenInit(3)|EVP_OpenInit(3)>=head1 HISTORYEVP_SealFinal() did not return a value before OpenSSL 0.9.7.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -