Class: GPGME::SubKey
- Inherits:
-
Object
- Object
- GPGME::SubKey
- Defined in:
- lib/gpgme.rb
Constant Summary collapse
- PUBKEY_ALGO_LETTERS =
{ PK_RSA => ?R, PK_ELG_E => ?g, PK_ELG => ?G, PK_DSA => ?D }
Instance Attribute Summary collapse
-
#fpr ⇒ Object
(also: #fingerprint)
readonly
Returns the value of attribute fpr.
-
#keyid ⇒ Object
readonly
Returns the value of attribute keyid.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#pubkey_algo ⇒ Object
readonly
Returns the value of attribute pubkey_algo.
Instance Method Summary collapse
- #capability ⇒ Object
- #expires ⇒ Object
- #inspect ⇒ Object
- #pubkey_algo_letter ⇒ Object
- #secret? ⇒ Boolean
- #timestamp ⇒ Object
- #to_s ⇒ Object
- #trust ⇒ Object
Instance Attribute Details
#fpr ⇒ Object (readonly) Also known as: fingerprint
Returns the value of attribute fpr.
1274 1275 1276 |
# File 'lib/gpgme.rb', line 1274 def fpr @fpr end |
#keyid ⇒ Object (readonly)
Returns the value of attribute keyid.
1274 1275 1276 |
# File 'lib/gpgme.rb', line 1274 def keyid @keyid end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
1274 1275 1276 |
# File 'lib/gpgme.rb', line 1274 def length @length end |
#pubkey_algo ⇒ Object (readonly)
Returns the value of attribute pubkey_algo.
1274 1275 1276 |
# File 'lib/gpgme.rb', line 1274 def pubkey_algo @pubkey_algo end |
Instance Method Details
#capability ⇒ Object
1284 1285 1286 1287 1288 1289 1290 1291 |
# File 'lib/gpgme.rb', line 1284 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 ⇒ Object
1301 1302 1303 |
# File 'lib/gpgme.rb', line 1301 def expires Time.at(@expires) end |
#inspect ⇒ Object
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 |
# File 'lib/gpgme.rb', line 1316 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], .strftime('%Y-%m-%d'), trust.inspect, capability.inspect) end |
#pubkey_algo_letter ⇒ Object
1312 1313 1314 |
# File 'lib/gpgme.rb', line 1312 def pubkey_algo_letter PUBKEY_ALGO_LETTERS[@pubkey_algo] || ?? end |
#secret? ⇒ Boolean
1293 1294 1295 |
# File 'lib/gpgme.rb', line 1293 def secret? @secret == 1 end |
#timestamp ⇒ Object
1297 1298 1299 |
# File 'lib/gpgme.rb', line 1297 def Time.at() end |
#to_s ⇒ Object
1327 1328 1329 1330 1331 1332 1333 1334 |
# File 'lib/gpgme.rb', line 1327 def to_s sprintf("%s %4d%c/%s %s\n", secret? ? 'ssc' : 'sub', length, pubkey_algo_letter, (@fingerprint || @keyid)[-8 .. -1], .strftime('%Y-%m-%d')) end |
#trust ⇒ Object
1277 1278 1279 1280 1281 1282 |
# File 'lib/gpgme.rb', line 1277 def trust return :revoked if @revoked == 1 return :expired if @expired == 1 return :disabled if @disabled == 1 return :invalid if @invalid == 1 end |