Class: GPGME::KeySig
- Inherits:
-
Object
- Object
- GPGME::KeySig
- Defined in:
- lib/gpgme/key_sig.rb,
lib/gpgme/ffi/key_sig.rb
Instance Attribute Summary collapse
-
#keyid ⇒ Object
readonly
Returns the value of attribute keyid.
-
#pubkey_algo ⇒ Object
readonly
Returns the value of attribute pubkey_algo.
Class Method Summary collapse
Instance Method Summary collapse
- #expired? ⇒ Boolean
- #expires ⇒ Object
- #exportable? ⇒ Boolean
- #inspect ⇒ Object
- #invalid? ⇒ Boolean
- #revoked? ⇒ Boolean
- #timestamp ⇒ Object
Instance Attribute Details
#keyid ⇒ Object (readonly)
Returns the value of attribute keyid.
5 6 7 |
# File 'lib/gpgme/key_sig.rb', line 5 def keyid @keyid end |
#pubkey_algo ⇒ Object (readonly)
Returns the value of attribute pubkey_algo.
5 6 7 |
# File 'lib/gpgme/key_sig.rb', line 5 def pubkey_algo @pubkey_algo end |
Class Method Details
.new_from_struct(struct) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/gpgme/ffi/key_sig.rb', line 3 def self.new_from_struct(struct) instance = allocate instance.instance_exec do @revoked = (struct[:flags] >> 0) & 1 @expired = (struct[:flags] >> 1) & 1 @invalid = (struct[:invalid] >> 2) & 1 @exportable = (struct[:exportable] >> 3) & 1 @pubkey_algo = struct[:pubkey_algo] @keyid = struct[:keyid] @timestamp = struct[:timestamp] @expires = struct[:expires] end instance end |
Instance Method Details
#expired? ⇒ Boolean
11 12 13 |
# File 'lib/gpgme/key_sig.rb', line 11 def expired? @expired == 1 end |
#expires ⇒ Object
27 28 29 |
# File 'lib/gpgme/key_sig.rb', line 27 def expires Time.at(@expires) end |
#exportable? ⇒ Boolean
19 20 21 |
# File 'lib/gpgme/key_sig.rb', line 19 def exportable? @exportable == 1 end |
#inspect ⇒ Object
31 32 33 |
# File 'lib/gpgme/key_sig.rb', line 31 def inspect "#<#{self.class} #{keyid} timestamp=#{}, expires=#{expires}>" end |
#invalid? ⇒ Boolean
15 16 17 |
# File 'lib/gpgme/key_sig.rb', line 15 def invalid? @invalid == 1 end |
#revoked? ⇒ Boolean
7 8 9 |
# File 'lib/gpgme/key_sig.rb', line 7 def revoked? @revoked == 1 end |
#timestamp ⇒ Object
23 24 25 |
# File 'lib/gpgme/key_sig.rb', line 23 def Time.at(@timestamp) end |