Class: Rnp::Verify::Signature

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

Overview

Class representing an individual signature.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#creation_timeTime (readonly)

The creation time of the signature

Returns:

  • (Time)


79
80
81
# File 'lib/rnp/op/verify.rb', line 79

def creation_time
  @creation_time
end

#expiration_timeInteger (readonly)

The expiration (as the number of seconds after #creation_time)

Returns:

  • (Integer)


82
83
84
# File 'lib/rnp/op/verify.rb', line 82

def expiration_time
  @expiration_time
end

#hashString (readonly)

The hash algorithm used for the signature

Returns:

  • (String)


73
74
75
# File 'lib/rnp/op/verify.rb', line 73

def hash
  @hash
end

#keyKey (readonly)

The key that created the signature

Returns:



76
77
78
# File 'lib/rnp/op/verify.rb', line 76

def key
  @key
end

Instance Method Details

#expired?Boolean

Check if this signature is expired.

Returns:

  • (Boolean)

    true if the signature is expired



133
134
135
# File 'lib/rnp/op/verify.rb', line 133

def expired?
  @status == LibRnp::RNP_ERROR_SIGNATURE_EXPIRED
end

#good?Boolean

Check if this signature is good.

Returns:

  • (Boolean)

    true if the signature is valid and not expired



116
117
118
# File 'lib/rnp/op/verify.rb', line 116

def good?
  @status == LibRnp::RNP_SUCCESS
end

#valid?Boolean

Note:

A valid signature may also be expired.

Check if this signature is valid.

Returns:

  • (Boolean)

    true if the signature is valid



125
126
127
128
# File 'lib/rnp/op/verify.rb', line 125

def valid?
  @status == LibRnp::RNP_SUCCESS ||
    @status == LibRnp::RNP_ERROR_SIGNATURE_EXPIRED
end