| 1 | package PGP::Finger::GPG; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | extends 'PGP::Finger::Source'; | |||||||||
| 6 | |||||||||||
| 7 | # ABSTRACT: gpgfinger source to query local gnupg | ||||||||||
| 8 | 1 | our $VERSION = '1.1'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use PGP::Finger::Result; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use PGP::Finger::Key; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use IPC::Run qw(run); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | has 'cmd' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, | ||||||||||
| 16 | 0 | ▶ | default => sub { [ '/usr/bin/gpg', '--export' ] }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 17 | 1 | ); | |||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub fetch { | ||||||||
|
Subroutine
fetch: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 20 | 0 | my ( $self, $addr ) = @_; | |||||||||
| 21 | 0 | my @cmd = ( @{$self->cmd}, $addr ); | |||||||||
| 22 | 0 | my ( $in, $out, $err ); | |||||||||
| 23 | 0 | ▶ | run( \@cmd, \$in, \$out, \$err ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | or die('error running gpg: '.$err.' ('.$!.')'); | ||||||||||
| 25 | |||||||||||
| 26 | 0 | my $result = PGP::Finger::Result->new; | |||||||||
| 27 | 0 | my $key = PGP::Finger::Key->new( | |||||||||
| 28 | mail => $addr, | ||||||||||
| 29 | data => $out, | ||||||||||
| 30 | ); | ||||||||||
| 31 | 0 | $key->set_attr( source => 'local GnuPG' ); | |||||||||
| 32 | |||||||||||
| 33 | 0 | $result->add_key( $key ); | |||||||||
| 34 | 0 | return $result; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | 1; | |||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||