In Files

Parent

GPGME::SubKey

Attributes

fingerprint[R]
fpr[R]
keyid[R]
length[R]
pubkey_algo[R]

Public Instance Methods

capability() click to toggle source
# File lib/gpgme.rb, line 1350
def capability
  caps = Array.new
  caps << :encrypt if @can_encrypt
  caps << :sign if @can_sign
  caps << :certify if @can_certify
  caps << :authenticate if @can_authenticate
  caps
end
expires() click to toggle source
# File lib/gpgme.rb, line 1375
def expires
  Time.at(@expires)
end
inspect() click to toggle source
# File lib/gpgme.rb, line 1390
def inspect
  sprintf("#<#{self.class} %s %4d%c/%s %s trust=%s, capability=%s>",
          secret? ? 'ssc' : 'sub',
          length,
          pubkey_algo_letter,
          (@fingerprint || @keyid)[-8 .. -1],
          timestamp.strftime('%Y-%m-%d'),
          trust.inspect,
          capability.inspect)
end
pubkey_algo_letter() click to toggle source
# File lib/gpgme.rb, line 1386
def pubkey_algo_letter
  PUBKEY_ALGO_LETTERS[@pubkey_algo] || ??
end
secret?() click to toggle source
# File lib/gpgme.rb, line 1367
def secret?
  @secret == 1
end
timestamp() click to toggle source
# File lib/gpgme.rb, line 1371
def timestamp
  Time.at(@timestamp)
end
to_s() click to toggle source
# File lib/gpgme.rb, line 1401
def to_s
  sprintf("%s   %4d%c/%s %s\n",
          secret? ? 'ssc' : 'sub',
          length,
          pubkey_algo_letter,
          (@fingerprint || @keyid)[-8 .. -1],
          timestamp.strftime('%Y-%m-%d'))
end
trust() click to toggle source
# File lib/gpgme.rb, line 1343
def trust
  return :revoked if @revoked == 1
  return :expired if @expired == 1
  return :disabled if @disabled == 1
  return :invalid if @invalid == 1
end
usable_for?(purposes) click to toggle source
# File lib/gpgme.rb, line 1359
def usable_for?(purposes)
  unless purposes.kind_of? Array
    purposes = [purposes]
  end
  return false if [:revoked, :expired, :disabled, :invalid].include? trust
  return (purposes - capability).empty?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.