Returns the remaining data held in the cipher object. Further calls to Cipher#update
or Cipher#final
will return garbage. This call should always be made as the last call of an encryption or decryption operation, after having fed the entire plaintext or ciphertext to the Cipher
instance.
If an authenticated cipher was used, a CipherError
is raised if the tag could not be authenticated successfully. Only call this method after setting the authentication tag and passing the entire contents of the ciphertext into the cipher.
Enables or disables padding. By default encryption operations are padded using standard block padding and the padding is checked and removed when decrypting. If the pad parameter is zero then no padding is performed, the total amount of data encrypted or decrypted must then be a multiple of the block size or an error will occur.
See EVP_CIPHER_CTX_set_padding for further information.
Returns the authentication code as a hex-encoded string. The digest parameter specifies the digest algorithm to use. This may be a String
representing the algorithm name or an instance of OpenSSL::Digest
.
key = 'key' data = 'The quick brown fox jumps over the lazy dog' hmac = OpenSSL::HMAC.hexdigest('SHA1', key, data) #=> "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"
String
representation of this configuration object, including the class name and its sections.
Returns an array of currently loaded engines.
Releases all internal structural references for this engine.
May raise an EngineError
if the engine is unavailable
Pretty prints this engine.
Emit a map. The coder will be yielded to the block.
Emit a map with value
Returns a Psych::Parser::Mark
object that contains line, column, and index information.
Get the indentation level.
Set
the indentation level to level
. The level must be less than 10 and greater than 1.
The line number of the current token. This value starts from 1. This method is valid only in event handlers.
returns a string which shows ancillarydata in human-readable form.
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").inspect #=> "#<Socket::AncillaryData: INET6 IPV6 PKTINFO \"\">"
returns the socket family as an integer.
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").family #=> 10
Creates a new Socket::AncillaryData
object which contains a int as data.
The size and endian is dependent on the host.
require 'socket' p Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno) #=> #<Socket::AncillaryData: UNIX SOCKET RIGHTS 2>
Returns the data in ancillarydata as an int.
The size and endian is dependent on the host.
ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno) p ancdata.int #=> 2
Returns a string to show contents of ifaddr.
Returns the interface index of ifaddr.
Returns the netmask address of ifaddr. nil is returned if netmask is not available in ifaddr.
returns the socket family as an integer.
p Socket::Option.new(:INET6, :IPV6, :RECVPKTINFO, [1].pack("i!")).family #=> 10
Returns a string which shows sockopt in human-readable form.
p Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i")).inspect #=> "#<Socket::Option: INET SOCKET KEEPALIVE 1>"
Creates a new Socket::Option
object which contains an int as data.
The size and endian is dependent on the platform.
p Socket::Option.int(:INET, :SOCKET, :KEEPALIVE, 1) #=> #<Socket::Option: INET SOCKET KEEPALIVE 1>