Class: Rnp::Verify

Inherits:
Object
  • Object
show all
Defined in:
lib/rnp/op/verify.rb

Overview

Verification operation

Defined Under Namespace

Classes: Signature

Instance Method Summary collapse

Instance Method Details

#executevoid

This method returns an undefined value.

Execute the operation.

This should only be called once.

Raises:



40
41
42
# File 'lib/rnp/op/verify.rb', line 40

def execute
  Rnp.call_ffi(:rnp_op_verify_execute, @ptr)
end

#good?Boolean

Check if all signatures are good.

Returns:

  • (Boolean)

    true if all signatures are valid and not expired.



47
48
49
50
# File 'lib/rnp/op/verify.rb', line 47

def good?
  sigs = signatures
  sigs.size && sigs.all?(&:good?)
end

#inspectObject



29
30
31
# File 'lib/rnp/op/verify.rb', line 29

def inspect
  Rnp.inspect_ptr(self)
end

#signaturesArray<Signature>

Get a list of the checked signatures.

Returns:



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/rnp/op/verify.rb', line 55

def signatures
  return @signatures unless @signatures.nil?
  @signatures = []
  pptr = FFI::MemoryPointer.new(:pointer)
  (0...signature_count).each do |i|
    Rnp.call_ffi(:rnp_op_verify_get_signature_at, @ptr, i, pptr)
    psig = pptr.read_pointer
    @signatures << Signature.new(psig)
  end
  @signatures
end