Verifies the signature
for the data
using a public key pkey
. Unlike verify
, this method will not hash data
with digest
automatically.
Returns true
if the signature is successfully verified, false
otherwise. The caller must check the return value.
See sign_raw
for the signing operation and an example code.
Added in version 3.0. See also the man page EVP_PKEY_verify(3).
signature
A String
containing the signature to be verified.
Recovers the signed data from signature
using a public key pkey
. Not all signature algorithms support this operation.
Added in version 3.0. See also the man page EVP_PKEY_verify_recover(3).
signature
A String
containing the signature to be verified.
In cases no timestamp token has been created, this field contains further info about the reason why response creation failed. The method returns either nil (the request was successful and a timestamp token was created) or one of the following:
:BAD_ALG - Indicates that the timestamp server rejects the message imprint algorithm used in the Request
:BAD_REQUEST - Indicates that the timestamp server was not able to process the Request
properly
:BAD_DATA_FORMAT - Indicates that the timestamp server was not able to parse certain data in the Request
:TIME_NOT_AVAILABLE - Indicates that the server could not access its time source
:UNACCEPTED_POLICY - Indicates that the requested policy identifier is not recognized or supported by the timestamp server
:UNACCEPTED_EXTENSIION - Indicates that an extension in the Request
is not supported by the timestamp server
:ADD_INFO_NOT_AVAILABLE -Indicates that additional information requested is either not understood or currently not available
:SYSTEM_FAILURE - Timestamp
creation failed due to an internal error that occurred on the timestamp server
Returns the message imprint digest. For valid timestamps, this is the same value that was already given in the Request
. If status is GRANTED or GRANTED_WITH_MODS, this is never nil
.
mi = token_info.msg_imprint puts mi -> "DEADBEEF"
Returns serial number of the timestamp token. This value shall never be the same for two timestamp tokens issued by a dedicated timestamp authority. If status is GRANTED or GRANTED_WITH_MODS, this is never nil
.
Set
the message imprint digest.
Returns the message imprint (digest) of the data to be timestamped.
General callback for OpenSSL
verify
Options for how prism should parse/lex the source.
This method is provided by the Ripper
C extension. It is called when a string needs to be dedented because of a tilde heredoc. It is expected that it will modify the string in place and return the number of bytes that were removed.
Defines a custom git source that uses name
to expand git repositories for use in gems built from git repositories. You must provide a block that accepts a git repository name for expansion.
Loads the given private key identified by id and data.
An EngineError
is raised of the OpenSSL::PKey
is unavailable.
Takes file
, a String
with the location of a Ruby
source file, reads, parses and compiles the file, and returns iseq
, the compiled InstructionSequence
with source location metadata set. It parses and compiles using prism.
Optionally takes options
, which can be true
, false
or a Hash
, to modify the default behavior of the Ruby
iseq compiler.
For details regarding valid compile options see ::compile_option=
.
# /tmp/hello.rb puts "Hello, world!" # elsewhere RubyVM::InstructionSequence.compile_file_prism("/tmp/hello.rb") #=> <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
in “” in “foo”
Display to the user that a gem couldn’t be found and reasons why
Check state file is writable. Creates empty file if not present to ensure we can write to it.
Writes the full .gemspec specification (in Ruby
) to the gem home’s specifications/default directory.
In contrast to write_spec
, this keeps file lists, so the ‘gem contents` command works.
Creates windows .bat files for easy running of commands
Creates the scripts to run the applications in the gem.