Class: Rnp::Verify::Signature
- Inherits:
-
Object
- Object
- Rnp::Verify::Signature
- Defined in:
- lib/rnp/op/verify.rb
Overview
Class representing an individual signature.
Instance Attribute Summary collapse
-
#creation_time ⇒ Time
readonly
The creation time of the signature.
-
#expiration_time ⇒ Integer
readonly
The expiration (as the number of seconds after #creation_time).
-
#hash ⇒ String
readonly
The hash algorithm used for the signature.
-
#key ⇒ Key
readonly
The key that created the signature.
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Check if this signature is expired.
-
#good? ⇒ Boolean
Check if this signature is good.
-
#valid? ⇒ Boolean
Check if this signature is valid.
Instance Attribute Details
#creation_time ⇒ Time (readonly)
The creation time of the signature
79 80 81 |
# File 'lib/rnp/op/verify.rb', line 79 def creation_time @creation_time end |
#expiration_time ⇒ Integer (readonly)
The expiration (as the number of seconds after #creation_time)
82 83 84 |
# File 'lib/rnp/op/verify.rb', line 82 def expiration_time @expiration_time end |
#hash ⇒ String (readonly)
The hash algorithm used for the signature
73 74 75 |
# File 'lib/rnp/op/verify.rb', line 73 def hash @hash end |
#key ⇒ Key (readonly)
The key that created the signature
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.
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.
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.
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 |