Manual Pages for UNIX Darwin command on man BIO_set_cipher
MyWebUniversity

Manual Pages for UNIX Darwin command on man BIO_set_cipher

BIOfcipher(3) OpenSSL BIOfcipher(3)

NAME

BIOfcipher, BIOsetcipher, BIOgetcipherstatus, BIOgetcipherctx

- cipher BIO filter

SYNOPSIS

#include

#include

BIOMETHOD * BIOfcipher(void); void BIOsetcipher(BIO *b,const EVPCIPHER *cipher, unsigned char *key, unsigned char *iv, int enc); int BIOgetcipherstatus(BIO *b) int BIOgetcipherctx(BIO *b, EVPCIPHERCTX **pctx)

DESCRIPTION

BIOfcipher() returns the cipher BIO method. This is a filter BIO that encrypts any data written through it, and decrypts any data read from it. It is a BIO wrapper for the cipher routines EVPCipherInit(), EVPCipherUpdate() and EVPCipherFinal(). Cipher BIOs do not support BIOgets() or BIOputs(). BIOflush() on an encryption BIO that is being written through is used to signal that no more data is to be encrypted: this is used to flush and possibly pad the final block through the BIO. BIOsetcipher() sets the cipher of BIO bb to cciipphheerr using key kkeeyy and IV iivv. eenncc should be set to 1 for encryption and zero for decryption. When reading from an encryption BIO the final block is automatically decrypted and checked when EOF is detected. BIOgetcipherstatus() is a BIOctrl() macro which can be called to determine whether the decryption operation was successful. BIOgetcipherctx() is a BIOctrl() macro which retrieves the internal BIO cipher context. The retrieved context can be used in conjunction with the standard cipher routines to set it up. This is useful when BIOsetcipher() is not flexible enough for the applications needs. NNOOTTEESS When encrypting BIOflush() mmuusstt be called to flush the final block through the BIO. If it is not then the final block will fail a subsequent decrypt. When decrypting an error on the final block is signalled by a zero return value from the read operation. A successful decrypt followed by EOF will also return zero for the final read. BIOgetcipherstatus() should be called to determine if the decrypt was successful. As always, if BIOgets() or BIOputs() support is needed then it can be achieved by preceding the cipher BIO with a buffering BIO.

RETURN VALUES

BIOfcipher() returns the cipher BIO method. BIOsetcipher() does not return a value. BIOgetcipherstatus() returns 1 for a successful decrypt and 0 for failure. BIOgetcipherctx() currently always returns 1. EEXXAAMMPPLLEESS TBA

SEE ALSO

TBA

0.9.7l 2003-02-27 BIOfcipher(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™