summaryrefslogtreecommitdiff
path: root/examples/ruby/keyring.rb
blob: 79426ad6c811dc18ce9d6a70ea954fbea3f8d3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

require 'zypp'
include Zypp


keyring = ZYppFactory::instance.get_zypp.key_ring

# FIXME
path = Pathname.new("/suse/aschnell/tmp/repodata/repomd.xml.key")
publickey = PublicKey.new(path)

id = publickey.id()

puts "known #{keyring.is_key_known(id)}"
puts "trusted #{keyring.is_key_trusted(id)}"

keyring.import_key(publickey, true)

puts "known #{keyring.is_key_known(id)}"
puts "trusted #{keyring.is_key_trusted(id)}"