class GPGME::Crypto

def verify(sig, options = {})

Other tags:
    Example: verifying a detached signature -
    Example: saving output to file -
    Example: simple verification -

Returns:
  • (GPGME::Data) - unless the sign is detached, the {GPGME::Data}

Parameters:
  • &block () --
  • options (Hash) --
  • sig () --
def verify(sig, options = {})
  options = @default_options.merge options
  sig         = Data.new(sig)
  signed_text = Data.new(options[:signed_text])
  output      = Data.new(options[:output]) unless options[:signed_text]
  GPGME::Ctx.new(options) do |ctx|
    ctx.verify(sig, signed_text, output)
    ctx.verify_result.signatures.each do |signature|
      yield signature
    end
  end
  if output
    output.seek(0)
    output
  end
end