See the OpenSSL
documentation for i2d_ECPKParameters_bio()
See the OpenSSL
documentation for ECPKParameters_print()
Rewinds the graph to the state tagged as ‘tag` @param [Object] tag the tag to rewind to @return [Void]
@param [Hash] options options for dot output. @return [String] Returns a dot format representation of the graph
Raised by Encoding
and String
methods when the source encoding is incompatible with the target encoding.
Generic error class for Fiddle
standard dynamic load exception
Cleared reference exception
The base exception for JSON
errors.
This exception is raised if a parser error occurs.
This exception is raised if the nesting of parsed data structures is too deep.
Generic error, common for all classes under OpenSSL
module
Generic Error for all of OpenSSL::BN
(big num)
General error for openssl library configuration files. Including formatting, parsing errors, etc.
Document-class: OpenSSL::HMAC
OpenSSL::HMAC
allows computing Hash-based Message Authentication Code (HMAC
). It is a type of message authentication code (MAC) involving a hash function in combination with a key. HMAC
can be used to verify the integrity of a message as well as the authenticity.
OpenSSL::HMAC
has a similar interface to OpenSSL::Digest
.
key = "key" data = "message-to-be-authenticated" mac = OpenSSL::HMAC.hexdigest("SHA256", key, data) #=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e"
data1 = File.binread("file1") data2 = File.binread("file2") key = "key" hmac = OpenSSL::HMAC.new(key, 'SHA256') hmac << data1 hmac << data2 mac = hmac.digest
The superclass for all exceptions raised by Ruby/zlib.
The following exceptions are defined as subclasses of Zlib::Error
. These exceptions are raised when zlib library functions return with an error status.
Subclass of Zlib::Error
when zlib returns a Z_DATA_ERROR.
Usually if a stream was prematurely freed.
Subclass of Zlib::Error
When zlib returns a Z_STREAM_ERROR, usually if the stream state was inconsistent.
Subclass of Zlib::Error
When zlib returns a Z_MEM_ERROR, usually if there was not enough memory.
Subclass of Zlib::Error
when zlib returns a Z_BUF_ERROR.
Usually if no progress is possible.
Subclass of Zlib::Error
When zlib returns a Z_VERSION_ERROR, usually if the zlib library version is incompatible with the version assumed by the caller.
Zlib::GzipReader
is the class for reading a gzipped file. GzipReader
should be used as an IO
, or -IO-like, object.
Zlib::GzipReader.open('hoge.gz') {|gz| print gz.read } File.open('hoge.gz') do |f| gz = Zlib::GzipReader.new(f) print gz.read gz.close end
Method
Catalogue The following methods in Zlib::GzipReader
are just like their counterparts in IO
, but they raise Zlib::Error
or Zlib::GzipFile::Error
exception if an error was found in the gzip file.
Be careful of the footer of the gzip file. A gzip file has the checksum of pre-compressed data in its footer. GzipReader
checks all uncompressed data against that checksum at the following cases, and if it fails, raises Zlib::GzipFile::NoFooter
, Zlib::GzipFile::CRCError
, or Zlib::GzipFile::LengthError
exception.
When an reading request is received beyond the end of file (the end of compressed data). That is, when Zlib::GzipReader#read
, Zlib::GzipReader#gets
, or some other methods for reading returns nil.
When Zlib::GzipFile#close
method is called after the object reaches the end of file.
When Zlib::GzipReader#unused
method is called after the object reaches the end of file.
The rest of the methods are adequately described in their own documentation.