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
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
Verifies a previously signed element

   crypto.verify sig, options, &block

 Must have the proper keys available.

 @param sig
   The signature itself. Must be possible to convert into a {GPGME::Data}
   object, so can be a file.

 @param [Hash] options
   * +:signed_text+ if the sign is detached, then must be the plain text
     for which the signature was created.
   * +:output+ where to store the result of the signature. Will be
     converted to a {GPGME::Data} object.
   * Any other option accepted by {GPGME::Ctx.new}

 @param &block
   In the block all the signatures are yielded, so one could verify them.
   See examples.

 @return [GPGME::Data] unless the sign is detached, the {GPGME::Data}
   object with the plain text. If the sign is detached, will return nil.

 @example simple verification
   sign = crypto.sign("Hi there")
   data = crypto.verify(sign) { |signature| signature.valid? }
   data.read # => "Hi there"

 @example saving output to file
   sign = crypto.sign("Hi there")
   out  = File.open("test.asc", "w+")
   crypto.verify(sign, :output => out) {|signature| signature.valid?}
   out.read # => "Hi there"

 @example verifying a detached signature
   sign = crypto.detach_sign("Hi there")
   # Will fail
   crypto.verify(sign) { |signature| signature.valid? }
   # Will succeed
   crypto.verify(sign, :signed_text => "hi there") do |signature|
     signature.valid?
   end