ungetc

ungetc(c) Instance Public methods Pushes character c back onto the stream such that a subsequent buffered character read will return it. Unlike IO#getc multiple bytes may be pushed back onto the stream. Has no effect on unbuffered reads (such as sysread).

write

write(s) Instance Public methods Writes s to the stream. If the argument is not a string it will be converted using String#to_s. Returns the number of bytes written.

write_nonblock

write_nonblock(s) Instance Public methods Writes str in the non-blocking manner. If there is buffered data, it is flushed first. This may block. #write_nonblock returns number of bytes written to the SSL connection. When no data can be written without blocking it raises OpenSSL::SSL::SSLError extended by IO::WaitReadable or IO::WaitWritable. IO::WaitReadable means SSL needs to read internally so #write_nonblock should be called again after the underlying IO is readable. IO::WaitWr

ciphers

Cipher.ciphers â array[string...] Class Public methods Returns the names of all available ciphers in an array.

new

Cipher.new(string) â cipher Class Public methods The string must contain a valid cipher name like âAES-128-CBCâ or â3DESâ. A list of cipher names is available by calling ::ciphers.

auth_data=

cipher.auth_data = string â string Instance Public methods Sets the cipher's additional authenticated data. This field must be set when using AEAD cipher modes such as GCM or CCM. If no associated data shall be used, this method must still be called with a value of ââ. The contents of this field should be non-sensitive data which will be added to the ciphertext to generate the authentication tag which validates the contents of the ciphertext. The AAD must be set prior to encryptio

auth_tag

cipher.auth_tag([ tag_len ] â string Instance Public methods Gets the authentication tag generated by Authenticated Encryption Cipher modes (GCM for example). This tag may be stored along with the ciphertext, then set on the decryption cipher to authenticate the contents of the ciphertext against changes. If the optional integer parameter tag_len is given, the returned tag will be tag_len bytes long. If the parameter is omitted, the maximum length of 16 bytes will be returned. For

auth_tag=

cipher.auth_tag = string â string Instance Public methods Sets the authentication tag to verify the contents of the ciphertext. The tag must be set after calling #decrypt, #key= and #iv=, but before assigning the associated authenticated data using #auth_data= and of course, before decrypting any of the ciphertext. After all decryption is performed, the tag is verified automatically in the call to #final.

authenticated?

cipher.authenticated? â boolean Instance Public methods Indicated whether this Cipher instance uses an Authenticated Encryption mode.

decrypt

cipher.decrypt â self Instance Public methods Initializes the Cipher for decryption. Make sure to call #encrypt or #decrypt before using any of the following methods: key=, iv=, #random_key, #random_iv, #pkcs5_keyivgen Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, 0).