10 my $config = {gpg => 'gpg',
13 ($config->{program_name}) = $0 =~/([^\/]+)\s*$/;
15 GetOptions($config,'gpg=s',);
17 $config->{gpg_command} = qq($config->{gpg});
19 my @keys_to_check = @ARGV;
23 sub _get_unknown_keys($$){
24 my ($config,$key_id) = @_;
26 my $uid_listing = qx($config->{gpg_command} --with-colons --list-sigs $key_id 2>/dev/null);
27 foreach my $key_record (split(/\n/,$uid_listing)) {
28 next unless $key_record =~ /\:/;
29 my ($record_type,$calculated_trust,$key_length,$algorithm,
30 $full_key_id,$creation_date,$expiration_date,$serial_no,
31 $owner_trust,$user_id,$signature_class,$key_capabilities,
32 $smime_fingerprint,$flag_field,
33 ) = split(/\:/,$key_record);
34 next unless defined $user_id and lc($user_id) eq lc('[User ID not found]');
35 next if exists $got_uid_already{$full_key_id};
36 qx($config->{gpg_command} --recv-keys $full_key_id 2>/dev/null);
37 $got_uid_already{$full_key_id} = 1;
38 print "Retreveved key: 0x".(substr $full_key_id, -8)."\n";
42 foreach my $key_id (@keys_to_check) {
43 _get_unknown_keys($config,$key_id);
44 print qx($config->{gpg_command} --check-sigs $key_id);