Returns the base64 encoded hash value of a given string. The return value is properly padded with ‘=’ and contains no line feeds.
Reset the digest to its initial state and return self
.
Reset the digest to the initial state and return self.
Returns the memory address for this closure
The integer memory location of this function
Returns the memory address for this handle.
Return the object that this pinned instance references.
Returns true if the reference has been cleared, otherwise returns false.
Set
the free function for this pointer to function
in the given Fiddle::Function
.
Get the free function for this pointer.
Returns a new instance of Fiddle::Function
.
Returns if the free function for this pointer has been called.
Returns the integer memory location of this pointer.
Returns a new Fiddle::Pointer
instance that is a reference pointer for this pointer.
Analogous to the ampersand operator in C.
ptr.to_s => string ptr.to_s(len) => string
Returns the pointer contents as a string.
When called with no arguments, this method will return the contents until the first NULL byte.
When called with len
, a string of len
bytes will be returned.
See to_str
Wakes up all threads waiting for this lock.
base - Integer
Valid values:
0 - MPI
2 - binary
10 - the default
16 - hex
Fully resets the internal state of the Cipher
. By using this, the same Cipher
instance may be used several times for encryption or decryption tasks.
Internally calls EVP_CipherInit_ex(ctx, NULL, NULL, NULL, NULL, -1).
Get the parsable form of the current configuration
Given the following configuration being created:
config = OpenSSL::Config.new #=> #<OpenSSL::Config sections=[]> config['default'] = {"foo"=>"bar","baz"=>"buz"} #=> {"foo"=>"bar", "baz"=>"buz"} puts config.to_s #=> [ default ] # foo=bar # baz=buz
You can parse get the serialized configuration using to_s
and then parse it later:
serialized_config = config.to_s # much later... new_config = OpenSSL::Config.parse(serialized_config) #=> #<OpenSSL::Config sections=["default"]> puts new_config #=> [ default ] foo=bar baz=buz
Return the hash value computed with name Digest
. name is either the long name or short name of a supported digest algorithm.
OpenSSL::Digest.digest("SHA256", "abc")
which is equivalent to:
OpenSSL::Digest.digest('SHA256', "abc")
Resets the Digest
in the sense that any Digest#update
that has been performed is abandoned and the Digest
is set to its initial state again.
Returns the authentication code as a binary 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.digest('sha1', key, data) #=> "\xDE|\x9B\x85\xB8\xB7\x8A\xA6\xBC\x8Az6\xF7\n\x90p\x1C\x9D\xB4\xD9"