view release on metacpan or search on metacpan
t/cp932-table.jis view on Meta::CPAN
0xe6a0: $Bf!f"f#f$f%f&f'f(f)f*f+f,f-f.f/f0f1f2f3f4f5f6f7f8f9f:f;f<f=f>(B
0xe6c0: $Bf@fAfBfCfDfEfFfGfHfIfJfKfLfMfNfOfPfQfRfSfTfUfVfWfXfYfZf[f\f]f^(B
0xe6e0: $Bf`fafbfcfdfefffgfhfifjfkflfmfnfofpfqfrfsftfufvfwfxfyfzf{f|f}f~(B
0xe7a0: $Bg!g"g#g$g%g&g'g(g)g*g+g,g-g.g/g0g1g2g3g4g5g6g7g8g9g:g;g<g=g>(B
0xe7c0: $Bg@gAgBgCgDgEgFgGgHgIgJgKgLgMgNgOgPgQgRgSgTgUgVgWgXgYgZg[g\g]g^(B
0xe7e0: $Bg`gagbgcgdgegfggghgigjgkglgmgngogpgqgrgsgtgugvgwgxgygzg{g|g}g~(B
0xe8a0: $Bh!h"h#h$h%h&h'h(h)h*h+h,h-h.h/h0h1h2h3h4h5h6h7h8h9h:h;h<h=h>(B
0xe8c0: $Bh@hAhBhChDhEhFhGhHhIhJhKhLhMhNhOhPhQhRhShThUhVhWhXhYhZh[h\h]h^(B
0xe8e0: $Bh`hahbhchdhehfhghhhihjhkhlhmhnhohphqhrhshthuhvhwhxhyhzh{h|h}h~(B
0xe9a0: $Bi!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>(B
0xe9c0: $Bi@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^(B
view all matches for this distribution
view release on metacpan or search on metacpan
t/table.jis view on Meta::CPAN
0xe6a0: $Bf!f"f#f$f%f&f'f(f)f*f+f,f-f.f/f0f1f2f3f4f5f6f7f8f9f:f;f<f=f>(B
0xe6c0: $Bf@fAfBfCfDfEfFfGfHfIfJfKfLfMfNfOfPfQfRfSfTfUfVfWfXfYfZf[f\f]f^(B
0xe6e0: $Bf`fafbfcfdfefffgfhfifjfkflfmfnfofpfqfrfsftfufvfwfxfyfzf{f|f}f~(B
0xe7a0: $Bg!g"g#g$g%g&g'g(g)g*g+g,g-g.g/g0g1g2g3g4g5g6g7g8g9g:g;g<g=g>(B
0xe7c0: $Bg@gAgBgCgDgEgFgGgHgIgJgKgLgMgNgOgPgQgRgSgTgUgVgWgXgYgZg[g\g]g^(B
0xe7e0: $Bg`gagbgcgdgegfggghgigjgkglgmgngogpgqgrgsgtgugvgwgxgygzg{g|g}g~(B
0xe8a0: $Bh!h"h#h$h%h&h'h(h)h*h+h,h-h.h/h0h1h2h3h4h5h6h7h8h9h:h;h<h=h>(B
0xe8c0: $Bh@hAhBhChDhEhFhGhHhIhJhKhLhMhNhOhPhQhRhShThUhVhWhXhYhZh[h\h]h^(B
0xe8e0: $Bh`hahbhchdhehfhghhhihjhkhlhmhnhohphqhrhshthuhvhwhxhyhzh{h|h}h~(B
0xe9a0: $Bi!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>(B
0xe9c0: $Bi@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[i\i]i^(B
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LedgerSMB/Installer.pm view on Meta::CPAN
}
$log->info( "Downloading release tarball $archive" );
$class->_download( $installpath, $version );
$log->info( "Verifying tarball against gpg public key & signature" );
my $downloaded_tar = File::Spec->catfile( $installpath, $archive );
$dss->verify_sig( $installpath,
$downloaded_tar,
"$downloaded_tar.asc",
$signing_key_data )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Common/Conf/DefaultValues.pm view on Meta::CPAN
'Directory' => '/var/lib/lemonldap-ng/sessions/',
'generateModule' =>
'Lemonldap::NG::Common::Apache::Session::Generate::SHA256',
'LockDirectory' => '/var/lib/lemonldap-ng/sessions/lock/'
},
'gpgAuthnLevel' => 5,
'gpgDb' => '',
'grantSessionRules' => {},
'groups' => {},
'handlerInternalCache' => 15,
'handlerServiceTokenTTL' => 30,
'hiddenAttributes' => '_password _2fDevices',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Manager/Attributes.pm view on Meta::CPAN
'Lemonldap::NG::Common::Apache::Session::Generate::SHA256',
'LockDirectory' => '/var/lib/lemonldap-ng/sessions/lock/'
},
'type' => 'keyTextContainer'
},
'gpgAuthnLevel' => {
'default' => 5,
'type' => 'int'
},
'gpgDb' => {
'default' => '',
'type' => 'text'
},
'grantSessionRules' => {
'default' => {},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Portal/Auth/GPG.pm view on Meta::CPAN
);
sub init {
my $self = shift;
$self->db( $self->conf->{gpgDb} );
unless ( $self->db ) {
$self->error("gpgDb not set");
return 0;
}
unless ( -r $self->db ) {
$self->error( "Unable to read " . $self->db );
return 0;
lib/Lemonldap/NG/Portal/Auth/GPG.pm view on Meta::CPAN
unless ( $self->ottRule->( $req, {} ) ) {
$self->error("OTT isn't set, unable to use GPG");
}
# Keep token data for later use
my ( $token, $gpgToken );
if ( $token = $req->param('token') ) {
$gpgToken = $self->ott->getToken($token);
$req->data->{tokenVerified} = 1 if ($gpgToken);
}
my $res = $self->SUPER::extractFormInfo($req);
return $res if ($res);
my $signed = $req->data->{password};
unless ( $signed =~ /SIGNATURE/s ) {
lib/Lemonldap/NG/Portal/Auth/GPG.pm view on Meta::CPAN
$self->setSecurity($req);
return PE_BADCREDENTIALS;
}
my ( $out, $err );
$self->logger->debug(
"Launching:\ngpgv --homedir /dev/null --keyring $self->{db} <<EOF\n$signed\nEOF"
);
my ( $lang, $language ) = ( $ENV{LANG}, $ENV{LANGUAGE} );
$ENV{LANG} = $ENV{LANGUAGE} = 'C';
IPC::Run::run( [ 'gpgv', '--homedir', '/dev/null', '--keyring', $self->db ],
\$signed, \$out, \$err, IPC::Run::timeout(10) );
if ( $? >> 8 != 0 ) {
$self->userLogger->error("GPG verification fails:\n$out\n# # #\n$err");
$self->setSecurity($req);
return PE_BADCREDENTIALS;
lib/Lemonldap/NG/Portal/Auth/GPG.pm view on Meta::CPAN
if ( $err =~ /using .*? key (.*)$/m ) {
$key = $1;
chomp $key;
}
else {
$self->logger->error("Unable to parse gpgv result:\n$err");
return PE_ERROR;
}
$self->logger->debug("GPG full sign key: $key");
my $in;
IPC::Run::run( [
'gpg', '--homedir', $self->tmp, '--keyring',
$self->db, '--list-key', $key
],
\$in,
\$out,
\$err,
IPC::Run::timeout(10)
);
( $ENV{LANG}, $ENV{LANGUAGE} ) = ( $lang, $language );
if ( $? >> 8 != 0 ) {
$self->logger->error("gpg --list-key return an error:\n$err");
return PE_ERROR;
}
if ( $out =~ /pub [^\n]*\r?\n +([^\n]+)\n/ ) {
$key = $1;
chomp $key;
}
else {
$self->logger->error(
"Unable to parse gpg --list-key result:\n$out\n$err\n");
return PE_ERROR;
}
$self->logger->debug("GPG full master key: $key");
# Keep only gpgKeyLength characters
my $length = $self->conf->{gpgKeyLength} || 8;
$length = 8 if ( $length < 8 );
$key =~ s/.*?(.{8,$length})$/$1/;
$self->logger->info("User key: $key");
my @identities = ( $out =~ /uid\s+(.*)$/gm );
my $mail = $req->param('user');
foreach (@identities) {
if (/^(.*)\s+<\Q$mail\E>/) {
$req->data->{gpgFullName} = $1;
$req->data->{gpgMail} = $mail;
$req->user($mail);
$self->userLogger->notice("GPG user $mail authenticated");
return PE_OK;
}
}
$self->userLogger->warn("Given mail does not match with gpg key");
$self->setSecurity($req);
return PE_BADCREDENTIALS;
}
sub authenticate {
return PE_OK;
}
sub setAuthSessionInfo {
my ( $self, $req ) = @_;
$req->sessionInfo->{gpgMail} = $req->data->{gpgMail};
$req->sessionInfo->{authenticationLevel} = $self->conf->{gpgAuthnLevel};
return PE_OK;
}
sub authLogout {
return PE_OK;
}
sub getDisplayType {
return "gpgform";
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/EN/SENNA/third-party/senna/hash/words.lst view on Meta::CPAN
gp0
gp0x
gpa
gpb
gpc
gpg
gpi
gpl
gpm
gpo
gprd
view all matches for this distribution
view release on metacpan or search on metacpan
share/count_1w.txt view on Meta::CPAN
rampage 1365049
aggravated 1365039
fink 1364952
jurassic 1364811
deem 1364711
gpg 1364699
gnupg 1364527
melville 1364503
cavern 1364330
ene 1363827
sumner 1363674
share/count_1w.txt view on Meta::CPAN
cere 100993
agon 100991
rosi 100989
icwales 100988
traver 100982
gpgme 100982
trots 100981
providential 100978
wellston 100975
gladius 100975
ryedale 100970
share/count_1w.txt view on Meta::CPAN
fluoranthene 81189
mediumship 81188
omidyar 81186
depopulation 81186
untiring 81185
libgpg 81185
wyrm 81184
combustibles 81181
channelnewsasia 81181
eosin 81179
kham 81177
share/count_1w.txt view on Meta::CPAN
strausberg 70996
ionizers 70996
sankara 70995
bco 70995
ecember 70993
agpgart 70991
americium 70990
trickett 70989
archean 70989
adls 70987
jessee 70986
share/count_1w.txt view on Meta::CPAN
trichlorobenzene 31445
privies 31445
boxleitner 31445
atodiad 31445
adscam 31445
gpgga 31444
alcom 31444
abeles 31444
wwwgame 31443
underfill 31443
naturforsch 31443
share/count_1w.txt view on Meta::CPAN
fishimg 28761
concatenative 28761
stromelysin 28760
saimiri 28760
pinacoteca 28760
gpgsm 28760
ccch 28760
sertorius 28759
kamilla 28759
harran 28759
eecipes 28759
share/count_1w.txt view on Meta::CPAN
dacono 25665
blache 25665
bernville 25665
antiangiogenic 25665
overtemperature 25664
gpgle 25664
consulship 25664
capecross 25664
bluejack 25664
behov 25664
sealcolony 25663
share/count_1w.txt view on Meta::CPAN
rody 25442
pointinganglescontainer 25442
lucton 25442
lbz 25442
interforst 25442
gpggle 25442
goolw 25442
gogil 25442
goblle 25442
wwwamsterdam 25441
slaveholder 25441
share/count_1w.txt view on Meta::CPAN
scuppers 20951
reitter 20951
nephropathies 20951
mysqlcc 20951
launderettes 20951
kgpg 20951
consigliere 20951
aircat 20951
targetdistribution 20950
shchedrin 20950
scma 20950
share/count_1w.txt view on Meta::CPAN
mindemoya 13099
mglurs 13099
kosamui 13099
isllc 13099
hattery 13099
gpgol 13099
dourado 13099
dormann 13099
devoirs 13099
cdsl 13099
carbocation 13099
share/count_1w.txt view on Meta::CPAN
nitsa 13038
neurofibromas 13038
jttf 13038
hentgen 13038
haysom 13038
gpggal 13038
globalsign 13038
giannoni 13038
encephalartos 13038
driftless 13038
archeive 13038
share/count_1w.txt view on Meta::CPAN
computerservice 12852
blogsspot 12852
augarten 12852
wyrley 12851
underselling 12851
sgpgi 12851
sarreguemines 12851
reoprts 12851
oberth 12851
luigia 12851
irtp 12851
share/count_1w.txt view on Meta::CPAN
largeboobies 12781
kleyn 12781
itemstatechanged 12781
hukou 12781
healthcares 12781
gpgoe 12781
goolag 12781
freecasinogames 12781
filamin 12781
figga 12781
catwings 12781
share/count_1w.txt view on Meta::CPAN
hooog 12725
hooel 12725
haooh 12725
halloweeb 12725
greesoft 12725
gpgoa 12725
goopel 12725
gooolf 12725
gokog 12725
gohle 12725
gofol 12725
share/count_1w.txt view on Meta::CPAN
gttool 12711
greenwoodparkmall 12711
gpollo 12711
gpoge 12711
gpoga 12711
gpgole 12711
gpgla 12711
gpgel 12711
goyyle 12711
goylo 12711
govle 12711
goteel 12711
goplo 12711
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/Info.pm view on Meta::CPAN
#> cat /tmp/pgswstats.yml
---
pgfault: 397040955
pgmajfault: 4611
pgpgin: 21531693
pgpgout: 49511043
pswpin: 8
pswpout: 272
time: 1236783534.9328
Every time you call the script the initial statistics are loaded/stored from/to
view all matches for this distribution
view release on metacpan or search on metacpan
get back to you in 7 days, don't wait for me; just email CPANSec.
If the email is addressed to me, I recommend encrypting to the
OpenPGP key identified by the long key ID 9536149F905DC1DB:
$ gpg [--keyserver hkps://...] --recv-keys 9536149F905DC1DB
or by the email address <security@rapidcow.org>:
$ gpg [--auto-key-locate dane,wkd] --locate-keys security@rapidcow.org
view all matches for this distribution
view release on metacpan or search on metacpan
3. Changes: File edited to widen line limit from 60 columns to 79
columns, to ease the reading.
4. THANKS: Updated.
2005-04-26 version 1.15
1. SIGNATURE: Included Modules::Signature gpg signature file added.
2. 00-signature.t: Added.
2005-04-21 version 1.14
1. maketext: Prototypes of the following subroutines are
declared first now: main() and parse_args().
view all matches for this distribution
view release on metacpan or search on metacpan
devel/bin/release_commands.pl view on Meta::CPAN
. qq|\$d->addfile(\$fh); print \$d->hexdigest; |
. qq|print " apache-lucy-$x_y_z_version.tar.gz\\n"' > |
. qq| apache-lucy-$x_y_z_version.tar.gz.sha512\n|;
say qq|# Sign the release.|;
say qq|gpg --armor --output apache-lucy-$x_y_z_version.tar.gz.asc |
. qq|--detach-sig apache-lucy-$x_y_z_version.tar.gz\n|;
say qq|# Add the artifacts and commit to the dev area on dist.apache.org.|;
say qq|svn add |
. qq|apache-lucy-$x_y_z_version.tar.gz |
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MDV/Distribconf.pm view on Meta::CPAN
The path or basename of the synthesis. By default, this is the hdlist
name prefixed by C<synthesis>.
=item B<pubkey>
The path or basename of the gpg public key file. By default, this is
the media name prefixed by C<pubkey_>.
=item B<name>
A human-readable name for the media. By default this is the media path
view all matches for this distribution
view release on metacpan or search on metacpan
lib/mhopt.pl view on Meta::CPAN
'modtime', # Set modification time on files to message date
'months=s', # Month names
'monthsabr=s', # Abbreviated month names
'msgexcfilter=s',
# Perl expression(s) for selective message exclusion
'msgpgs', # Create message pages
'msgsep=s', # Message separator for mailbox files
'msgprefix=s', # Filename prefix for message files
'multipg', # Generate multi-page indexes
'news', # Add links to newsgroups
'newsurl=s', # URL to use for news hyperlinks
lib/mhopt.pl view on Meta::CPAN
'nogziplinks', # Do not add '.gz' extensions to files
'nokeeponrmm', # Delete message files on archive remove
'nolock', # Do no archive locking
'nomailto', # Do not add in mailto links for e-mail addresses
'nomain', # Do not create a main index
'nomsgpgs', # Do not create message pages
'nomodtime', # Do no set modification time on files to message date
'nomultipg', # Do not generate multi-page indexes
'nonews', # Do not add links to newsgroups
'noposixstrftime',
# Use own implementation for time format process
lib/mhopt.pl view on Meta::CPAN
$DoFolRefs = 0 if $opt{'nofolrefs'};
$GzipFiles = 1 if $opt{'gzipfiles'};
$GzipFiles = 0 if $opt{'nogzipfiles'};
$GzipLinks = 1 if $opt{'gziplinks'};
$GzipLinks = 0 if $opt{'nogziplinks'};
$NoMsgPgs = 0 if $opt{'msgpgs'};
$NoMsgPgs = 1 if $opt{'nomsgpgs'};
$SaveRsrcs = 1 if $opt{'saveresources'};
$SaveRsrcs = 0 if $opt{'nosaveresources'};
$SpamMode = 1 if $opt{'spammode'};
$SpamMode = 0 if $opt{'nospammode'};
$KeepOnRmm = 1 if $opt{'keeponrmm'};
view all matches for this distribution
view release on metacpan or search on metacpan
share/mime-info/freedesktop.org.xml view on Meta::CPAN
<comment>PGP/MIME-encrypted message header</comment>
<magic>
<match type="string" value="-----BEGIN PGP MESSAGE-----" offset="0"/>
</magic>
<glob pattern="*.pgp"/>
<glob pattern="*.gpg"/>
<glob pattern="*.asc" weight="10"/>
<alias type="application/pgp"/>
</mime-type>
<mime-type type="application/pgp-keys">
<comment>PGP keys</comment>
share/mime-info/freedesktop.org.xml view on Meta::CPAN
</magic>
<glob pattern="*.skr"/>
<glob pattern="*.pkr"/>
<glob pattern="*.asc" weight="10"/>
<glob pattern="*.pgp"/>
<glob pattern="*.gpg"/>
<glob pattern="*.key"/>
</mime-type>
<mime-type type="application/pgp-signature">
<comment>Detached OpenPGP signature</comment>
<magic>
<match type="string" value="-----BEGIN PGP SIGNATURE-----" offset="0"/>
</magic>
<glob pattern="*.asc" weight="10"/>
<glob pattern="*.sig"/>
<glob pattern="*.pgp"/>
<glob pattern="*.gpg"/>
</mime-type>
<!-- defined in RFC 2311 -->
<mime-type type="application/pkcs7-mime">
<comment>PKCS#7 file</comment>
<acronym>PKCS</acronym>
view all matches for this distribution
view release on metacpan or search on metacpan
testmsgs/frag.msg view on Meta::CPAN
kYfhgOMpBVE1XTj/AMfEdfmB+vI0WSsLy2darMlK9mUnGiq/kr/YcU7HGiqqFBNMFlbXGMjpjuea
21Qjrh4VtrI7rbsd02uFT16Y8abdQY80Et40h1fHBSCL5ou2tJ50CwjlIfsqOpyQSCBzVdPkks54
5bmNTEr+m8Tn4gaGuFYCymtxaTap6NlayKkjhRxbqITuXP8Aq5IBtlIxNUz2HyxYeSLG0vbe4N1e
swazs04ll+GsjMp6UyTlY4jIOGt0y0/zxNr8rkaBHqMrr6b3htSzPGOql0FRTC0Twyh/Eq6J5Z0D
R7W71m0kAl+O6gsbyHlHbxncxqGr8Xuy8sLRlJvnaeaBqmteYbC4vUK+kfgtlnVuLMtCpWMCiqP9
+LgpgJFg9vd6pcS6g2pXA01IXFrDblebS3MjU2K/sdshu7CGmil1neaxY6sdIumltpZCViIDlHHK
rsjBfj4/5OA25X5eFPXtOTStK8r+tcWy6g4UmaalWdCac29T4xQHJxLrcYMp1D0vPL248uiGa9tL
OKzMhLQRwKzMACQtTyIXlkJc3oIxycIEjaC1O7v57rT/ANFR3JueQEqpEzEJ0JJHP4D/AK2BNQAo
8kwlufNGm3CRyxL9ZVZJY7aIfG0aCpLNXhy/yGx4i0+DA7gNXWqXLyxvJGlrKqLxiNOaPMpZTxXl
vvy+H7f2ciSW/DwjmmPlryxe2+pJd6kyrbpJzeQSAyvx3B9M/GnJvgocsAcXXavag9D+pi/ZxFqE
7Q8SXUhGNT04kjbJOgiSDs8q862t3ZalNbqJJGlAeO5dKBvEchUFtviyGQno9RoMwA3RPko3mm3C
view all matches for this distribution
view release on metacpan or search on metacpan
- implement g_mime_cipher_ g_mime_session_ g_mime_gpg_
g_mime_multipart_encrypted_ g_mime_multipart_signed_
Planed for next major release.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MIME/types.db view on Meta::CPAN
gnucash;application/x-gnucash
gnumeric;application/x-gnumeric
gnuplot;application/x-gnuplot
go;text/x-go
gp;application/x-gnuplot
gpg;application/pgp-encrypted
gph;application/vnd.flographit
gpkg.tar;application/vnd.gentoo.gpkg
gpkg;application/geopackage+sqlite3
gplt;application/x-gnuplot
gpt;x-chemical/x-mopac-graph
lib/MIME/types.db view on Meta::CPAN
p2p-overlay+xml;relo;;
patch-ops-error+xml;xer;;
pdf;pdf;base64;
pdx;pdx;;
pem-certificate-chain;pem;;
pgp-encrypted;pgp,gpg,asc;7bit;
pgp-keys;asc,key,skr,pkr,pgp,gpg;7bit;
pgp-signature;asc,sig,pgp,gpg;base64;
pidf-diff+xml;xml;;
pkcs10;p10;;
pkcs12;p12,pfx;;
pkcs7-mime;p7m,p7c;;
pkcs7-signature;p7s;;
view all matches for this distribution
view release on metacpan or search on metacpan
testmsgs/frag.msg view on Meta::CPAN
kYfhgOMpBVE1XTj/AMfEdfmB+vI0WSsLy2darMlK9mUnGiq/kr/YcU7HGiqqFBNMFlbXGMjpjuea
21Qjrh4VtrI7rbsd02uFT16Y8abdQY80Et40h1fHBSCL5ou2tJ50CwjlIfsqOpyQSCBzVdPkks54
5bmNTEr+m8Tn4gaGuFYCymtxaTap6NlayKkjhRxbqITuXP8Aq5IBtlIxNUz2HyxYeSLG0vbe4N1e
swazs04ll+GsjMp6UyTlY4jIOGt0y0/zxNr8rkaBHqMrr6b3htSzPGOql0FRTC0Twyh/Eq6J5Z0D
R7W71m0kAl+O6gsbyHlHbxncxqGr8Xuy8sLRlJvnaeaBqmteYbC4vUK+kfgtlnVuLMtCpWMCiqP9
+LgpgJFg9vd6pcS6g2pXA01IXFrDblebS3MjU2K/sdshu7CGmil1neaxY6sdIumltpZCViIDlHHK
rsjBfj4/5OA25X5eFPXtOTStK8r+tcWy6g4UmaalWdCac29T4xQHJxLrcYMp1D0vPL248uiGa9tL
OKzMhLQRwKzMACQtTyIXlkJc3oIxycIEjaC1O7v57rT/ANFR3JueQEqpEzEJ0JJHP4D/AK2BNQAo
8kwlufNGm3CRyxL9ZVZJY7aIfG0aCpLNXhy/yGx4i0+DA7gNXWqXLyxvJGlrKqLxiNOaPMpZTxXl
vvy+H7f2ciSW/DwjmmPlryxe2+pJd6kyrbpJzeQSAyvx3B9M/GnJvgocsAcXXavag9D+pi/ZxFqE
7Q8SXUhGNT04kjbJOgiSDs8q862t3ZalNbqJJGlAeO5dKBvEchUFtviyGQno9RoMwA3RPko3mm3C
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MToken.pm view on Meta::CPAN
=head2 get_fingerprint
Returns the fingerprint from local config or ask it
=head2 get_gpgbin
Returns the GNUPG path from local config
=head2 get_manifest
lib/MToken.pm view on Meta::CPAN
}
}
$self->lconfig->set(opensslbin => $opensslbin);
# Ask GnuPG
my $gpgbin = $self->cli_prompt('GnuPG (gpg) program:', $self->lconfig->get("ogpgbin") ||
$self->conf("gpgbin") || which(GPGBIN) || GPGBIN);
unless ($gpgbin) {
return $self->raise("Program GnuPG (gpg) not found. Please install it and try again later");
} else {
my $cmd = [$gpgbin, "--version"];
my $err = "";
my $out = CTK::Util::execute( $cmd, undef, \$err );
if ($err) {
say cyan("#", join(" ", @$cmd));
say STDERR red($err);
}
return $self->raise("Program GnuPG (gpg) not found. Please install it and try again later") unless $out;
unless ($out =~ /^gpg\s+\(GnuPG\)\s+[2-9]\.[0-9]/m) {
say STDERR yellow("GnuPG Version is not correctly. May be some problems");
say cyan($out) if $self->verbosemode;
}
}
$self->lconfig->set(gpgbin => $gpgbin);
# Ask fingerprint
my $fingerprint = $self->get_fingerprint;
$self->lconfig->set(fingerprint => $fingerprint) if $fingerprint;
lib/MToken.pm view on Meta::CPAN
? $db_info{tags}
: decode(locale => $self->cli_prompt('Tags (commas or spaces are tag delimiter):', encode(locale => $db_info{tags} || "")));
# New filename
my $out_file = File::Spec->catfile($self->tempdir, sprintf("%s.gpg", $fname));
#say $out_file;
# Encrypt file to tempdir
my %exest = $self->execmd($self->get_gpgbin, "--encrypt", "--armor", "--quiet", "--recipient", $fingerprint, "--output", $out_file, $in_file);
unless ($exest{status} && -f $out_file) {
$self->raise("Can't encrypt file %s", $in_file);
next;
}
lib/MToken.pm view on Meta::CPAN
$self->error($store->error || sprintf("Store (%s): Unknown error", $store->dsn));
return 0;
}
# Get file names
my $enc_file_path = path($self->tempdir, sprintf("%s.gpg", $filename));
my $dec_file_path = path($self->option("output") || File::Spec->catfile(getcwd(), $filename));
#say explain({enc_file_path => $enc_file_path->to_string, dec_file_path => $dec_file_path->to_string});
# Write file content on disk (spurt, spew; see also Module::Build::Base::_spew)
$enc_file_path->spurt($data{content} || "");
lib/MToken.pm view on Meta::CPAN
$self->error(sprintf("Can't load empty file %s", $enc_file_path->to_string));
return 0;
}
# Decrypt file to tempdir
# gpg -d -q -o $bname $1
my $out_file = $dec_file_path->to_string;
my %exest = $self->execmd($self->get_gpgbin, "--decrypt", "--quiet", "--output", $out_file, $enc_file_path->to_string);
unless ($exest{status} && -e $out_file) {
$self->error(sprintf("Can't decrypt file %s", $enc_file_path->to_string));
my $newfile = $enc_file_path->copy_to(sprintf("%s.gpg", $out_file));
say magenta("The encrypted file has been stored to %s", $newfile->to_string) if filesize($newfile->to_string);
return 0;
}
# Check size
lib/MToken.pm view on Meta::CPAN
say $data{content} || "";
return 1;
}
# Get file names
my $enc_file_path = path($self->tempdir, sprintf("%s.gpg", $filename));
my $dec_file_path = path($self->tempdir, $filename);
# Write file content on disk (spurt, spew; see also Module::Build::Base::_spew)
my $in_file = $enc_file_path->to_string;
$enc_file_path->spurt($data{content} || "");
lib/MToken.pm view on Meta::CPAN
$self->error(sprintf("Can't load empty file %s", $in_file));
return 0;
}
# Decrypt file to tempdir
# gpg -d -q -o $bname $1
my $out_file = $dec_file_path->to_string;
my %exest = $self->execmd($self->get_gpgbin, "--decrypt", "--quiet", "--output", $out_file, $in_file);
unless ($exest{status} && -e $out_file) {
$self->error(sprintf("Can't decrypt file %s", $in_file));
say $data{content} || "";
return 0;
}
lib/MToken.pm view on Meta::CPAN
}
$tar->write($tarball_arch_path->to_string, 1);
chdir $curdir;
# Encrypt file to tempdir
my %exest = $self->execmd($self->get_gpgbin, "--encrypt", "--quiet", "--recipient", $fingerprint, "--output",
$tarball_path->to_string, $tarball_arch_path->to_string);
unless ($exest{status} && -f $tarball_path->to_string) {
$self->error(sprintf("Can't encrypt file %s: %s", $tarball_arch_path->to_string, $exest{error}));
return 0;
}
lib/MToken.pm view on Meta::CPAN
}
}
# Decrypt file
unless (-e $archive_path->to_string) {
my %exest = $self->execmd($self->get_gpgbin, "--decrypt", "--quiet", "--output", $archive_path->to_string, $tarball_path->to_string);
unless ($exest{status} && -e $archive_path->to_string) {
$self->error(sprintf("Can't decrypt file %s: %s", $tarball_path->to_string, $exest{error}));
return 0;
}
$tarball_path->remove;
lib/MToken.pm view on Meta::CPAN
}
sub get_opensslbin {
my $self = shift;
return $self->lconfig->get("opensslbin") || $self->conf("opensslbin") || which(OPENSSLBIN) || OPENSSLBIN;
}
sub get_gpgbin {
my $self = shift;
return $self->lconfig->get("gpgbin") || $self->conf("gpgbin") || which(GPGBIN) || GPGBIN;
}
sub get_server_url {
my $self = shift;
return $self->lconfig->get("server_url") || $self->conf("server_url") || SERVER_URL;
}
lib/MToken.pm view on Meta::CPAN
my $fingerprint = "";
my %exest = ();
# Get public keys info
unless ($self->option("force")) {
%exest = $self->execmd($self->get_gpgbin, "--list-keys");
if ($exest{status}) {
say blue($exest{output} || "no keys found");
}
}
# Get public keys fingerprints
%exest = $self->execmd($self->get_gpgbin, "--list-keys", "--with-colons");
if ($exest{status} && $exest{output}) {
my @fingerprints = map {$_ = uc($1) if /\:([0-9a-f]{16,40})\:/i } grep { /fpr/ } split("\n", $exest{output});
my $fingerprint_default = $fingerprint_cfg || $fingerprints[0] || 'none';
while (1) {
if ($self->option("force")) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MYDan/Collector/Stat.pm view on Meta::CPAN
my ( $keep, $NAME, %eval ) = ( 9, 'TEST' );
my @statcol = ( 1 .. $keep, 'stat', 'group', 'warnning', 'info' );
my %FIXME =
(
PAGE => [ 'pgpgin/s', 'kbhugfree' ],
IO => [ 'tps' ],
LOAD => [ 'runq-sz', 'proc/s', 'cswch/s' ],
MEM => [ 'frmpg/s', 'kbmemfree' ],
SWAP => [ 'kbswpfree', 'pswpin/s' ],
NFS => [ 'call/s', 'scall/s' ],
view all matches for this distribution
view release on metacpan or search on metacpan
any concern to you, by all means verify the signature of this file and
contact the author if any discrepancy is detected.
You can find more information about this at the following URL
http://mipagina.cantv.net/lem/gpg/
This information includes the correct keys, fingerprints, etc.Note
that this README file should also be signed.
LICENSE AND WARRANTY
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/BIMI/Data/CA/06c167cfebf48d35d62410185e11c5eb-DigiCert-Verified-Mark-Root-CA.pem view on Meta::CPAN
MRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMScwJQYDVQQDEx5EaWdpQ2VydCBW
ZXJpZmllZCBNYXJrIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
AoICAQDawvvIO7cL04ptZxgLw/YwqDuluiFsMvGsr+vZcfq5c3hKuX0uMrslza91
OFB6SPmbkG2hLErOcaVH0nMnG0RE3AM6dpfhw7qU+n3c6XPS7HlO9ZC57GJeaOXy
b0cmcK2G96WC/VRuB1ZgjqYoq6PP4yjn/DB/Pc+7kjwJ2EDH5BFEnywVq4rH1a+Q
AbVDpxJfCfQZV1VKW+JNtO/KKKX+NlPrtHroSgKiRZ019oWptImyfgpg7j6FNNAT
R8uPsvU5zYJyCDOxKv4MqllMJmUVwGUHF61WnbiZeJsxzb5H5wMpikX4mfdKaIm0
ym2QsHVRazST1bIVvAZThcKPd2EnysQi6XpYpMcpiSRo58ENXZW47M/Ocu7mBCLP
TJEPEC9YG2aCfHxFSz/n6xZR+1rvNPUxcLZ+FNOwZRnHqcqe5TDNQewoC8/AWR0O
dKqu2WgBF40ncXmtm5QnYhlTmBcoPUWfR40bCLJsm4fV2B4hkC5ZCHV/91jpsv7j
hsGkpQpY6n9XWBABW6ZGQWM4jXxybbNmb3u21xx8rEkaIh22is08i41xeV9iLYec
view all matches for this distribution
view release on metacpan or search on metacpan
bin/install_deps.pl view on Meta::CPAN
'cache_metadata' => q[1],
'cpan_home' => qq[$ENV{HOME}/.cpan],
'ftp' => $ftp,
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gpg' => q[],
'gzip' => $gzip,
'histfile' => qq[$ENV{HOME}/.cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[],
'inactivity_timeout' => q[5],
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
my $dist = '$(DISTNAME)-$(VERSION).tar.gz';
my @EXE_FILES = ('expand-alias');
my %PREREQ_PM = ('IO::File');
my %clean = ('FILES' => "$dist $dist.asc distdir");
my %macro = (
'GPG' => 'gpg',
'AUTHOR' => 'darren@cpan.org',
);
WriteMakefile(
NAME => __PACKAGE__,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/GPG.pm view on Meta::CPAN
sub get_debug { shift->{debug} }
sub get_debug_dir { shift->{debug_dir} }
sub get_gnupg_hash_init { shift->{gnupg_hash_init} }
sub get_digest { shift->{digest} }
sub get_default_key_encrypt { shift->{default_key_encrypt} }
sub get_gpg_call { shift->{gpg_call} }
sub get_no_strict_7bit_encoding { shift->{no_strict_7bit_encoding} }
sub get_use_long_key_ids { shift->{use_long_key_ids} }
sub set_default_key_id { shift->{default_key_id} = $_[1] }
sub set_default_passphrase { shift->{default_passphrase} = $_[1] }
sub set_debug { shift->{debug} = $_[1] }
sub set_debug_dir { shift->{debug_dir} = $_[1] }
sub set_gnupg_hash_init { shift->{gnupg_hash_init} = $_[1] }
sub set_digest { shift->{digest} = $_[1] }
sub set_default_key_encrypt { shift->{default_key_encrypt} = $_[1] }
sub set_gpg_call { shift->{gpg_call} = $_[1] }
sub set_no_strict_7bit_encoding { shift->{no_strict_7bit_encoding}=$_[1]}
sub set_use_long_key_ids { shift->{use_long_key_ids} = $_[1] }
sub new {
my $class = shift;
my %par = @_;
my ($default_key_id, $default_passphrase, $debug, $debug_dir) =
@par{'default_key_id','default_passphrase','debug','debug_dir'};
my ($gnupg_hash_init, $digest, $gpg_call, $default_key_encrypt) =
@par{'gnupg_hash_init','digest','gpg_call','default_key_encrypt'};
my ($no_strict_7bit_encoding, $use_long_key_ids) =
@par{'no_strict_7bit_encoding','use_long_key_ids'};
$debug_dir ||= $ENV{DUMPDIR} || File::Spec->tmpdir . '/mail-gpg-test';
$gnupg_hash_init ||= {};
$digest ||= "RIPEMD160";
$gpg_call ||= "gpg";
$no_strict_7bit_encoding ||= 0;
$use_long_key_ids ||= 0;
my $self = bless {
default_key_id => $default_key_id,
lib/Mail/GPG.pm view on Meta::CPAN
debug => $debug,
debug_dir => $debug_dir,
gnupg_hash_init => $gnupg_hash_init,
digest => $digest,
default_key_encrypt => $default_key_encrypt,
gpg_call => $gpg_call,
no_strict_7bit_encoding => $no_strict_7bit_encoding,
use_long_key_ids => $use_long_key_ids,
}, $class;
return $self;
}
sub new_gpg_interface {
my $self = shift;
my %par = @_;
my ($options, $passphrase) = @par{'options','passphrase'};
my $gpg = GnuPG::Interface->new;
$gpg->passphrase($passphrase) if defined $passphrase;
$gpg->call( $self->get_gpg_call ) if $self->get_gpg_call ne '';
my $gnupg_hash_init = $self->get_gnupg_hash_init;
if ($options) {
$gpg->options->hash_init( %{$options}, %{$gnupg_hash_init} );
}
else {
$gpg->options->hash_init( %{$gnupg_hash_init} );
}
$gpg->options->push_extra_args( '--digest', $self->get_digest );
$gpg->options->meta_interactive(0);
return $gpg;
}
sub save_debug_file {
my $self = shift;
my %par = @_;
my ($name, $data, $data_fh ) = @par{'name','data','data_fh' };
$name = $self->get_debug_dir . "/mgpg-" . $name;
open( DBG, ">$name" ) or die "can't write $name";
if ($data_fh) {
seek $data_fh, 0, 0;
print DBG $_ while <$data_fh>;
lib/Mail/GPG.pm view on Meta::CPAN
}
return $is_armor;
}
sub perform_multiplexed_gpg_io {
my $self = shift;
my %par = @_;
my ($data_fh, $data_canonify, $stdin_fh, $stderr_fh) =
@par{'data_fh','data_canonify','stdin_fh','stderr_fh'};
my ($stdout_fh, $status_fh, $stderr_sref, $stdout_sref) =
lib/Mail/GPG.pm view on Meta::CPAN
my $buffer;
while (1) {
#-- as long we has data try to write
#-- it into gpg
while ( $data_fh && $stdin->can_write(0.001) ) {
if ( $data_fh_glob
? read $data_fh,
$buffer, 1024
: $data_fh->read( $buffer, 1024 ) ) {
lib/Mail/GPG.pm view on Meta::CPAN
#-- canonify it if requested
$buffer =~ s/\x0A/\x0D\x0A/g;
$buffer =~ s/\x0D\x0D\x0A/\x0D\x0A/g;
}
#-- feed it into gpg
print $stdin_fh $buffer;
}
else {
#-- no data read, close gpg's stdin
#-- and set the data filehandle to false
close $stdin_fh;
$data_fh = 0;
}
}
#-- probably we can read from gpg's stdout
while ( $stdout->can_read(0.001) ) {
last if eof($stdout_fh);
$$stdout_sref .= <$stdout_fh>;
}
#-- probably we can read from gpg's stderr
while ( $stderr->can_read(0.001) ) {
last if eof($stderr_fh);
$$stderr_sref .= <$stderr_fh>;
}
#-- probably we can read from gpg's status
if ($status) {
while ( $status->can_read(0.001) ) {
last if eof($status_fh);
$$status_sref .= <$status_fh>;
}
}
#-- we're finished if no more data left
#-- and both gpg's stdout and stderr
#-- are at eof.
return
if !$data_fh
&& eof($stderr_fh)
&& eof($stdout_fh)
lib/Mail/GPG.pm view on Meta::CPAN
my $self = shift;
my ($output_stdout, %par) = @_;
my ($coerce, $debug, $verbose) =
@par{'coerce','debug','verbose'};
#-- grab key ID's and emails from output (backward compatible to gpg 1.x)
#
# Example:
# search request: "--list-keys --with-colons 6C187D0F196ED9E3"
# format : see /usr/share/doc/packages/gpg2/DETAILS
#
#--OLD sample: gpg (GnuPG) 1.4.11
# tru:t:1:1431088683:0:3:1:5
# pub:-:1024:17:062F00DAE20F5035:2004-02-10:::-:Jörn Reder Mail\x3a\x3aGPG Test Key <mailgpg@localdomain>::scaESCA:
# sub:-:1024:16:6C187D0F196ED9E3:2004-02-10::::::e:
#
# expected output: (062F00DAE20F5035, 'Jörn Reder Mail::GPG Test Key <mailgpg@localdomain>')
#
#--NEW sample: gpg (GnuPG) 2.0.22
# tru:t:1:1429473192:0:3:1:5
# pub:-:1024:17:062F00DAE20F5035:1076425915:::-:::scaESCA:
# uid:-::::1076425915::588869ADE077B8FB05788A99565AEED15AED8231::Jörn Reder Mail\x3a\x3aGPG Test Key <mailgpg@localdomain>:
# sub:-:1024:16:6C187D0F196ED9E3:1076425917::::::e:
#
# expected output: (062F00DAE20F5035, 'Jörn Reder Mail::GPG Test Key <mailgpg@localdomain>',
# 6C187D0F196ED9E3, 'Jörn Reder Mail::GPG Test Key <mailgpg@localdomain>')
#
# PERLBOTIX<ätt>cpan.org / May, 2015
my @result;
lib/Mail/GPG.pm view on Meta::CPAN
$output_stdout .= "\nFLUSH\n"; #-- we add this token to trigger flushing of the last record
#-- these values are valid per "paragraph" (from pub: to pub:)
my @ids; #-- list of potential IDs (pub, sub)
my @emails; #-- list of potential email adresses (uid)
my $gpg2_mode = 0; #-- auto-detect OLD/NEW format: true if NEW (gpg2) format
#-- parse output line by line
#-- OLD-format (gpg 1.x): simulate old behaviour
#-- NEW-format (gpg 2.x): create all combinations of valid key-IDs and emails; return (pub) key-ID first,
# so the result stays backward compatible
while ( $output_stdout =~ m!^((\w+):?.*?)[\r\n]+!mg ) {
my ($line, $tag) = ($1, $2);
lib/Mail/GPG.pm view on Meta::CPAN
last if defined $fields[1] and $fields[1] eq 'FLUSH';
#-- parse 'new' format (pub:..; next: uid:..., uid:..., sub:... )
if ( not defined $fields[9] or $fields[9] =~ /^\s*$/ ) {
$gpg2_mode = 1;
push @ids, $fields[4];
}
#-- parse 'old' format (pub:)
elsif ( $fields[9] =~ /<[^>]+>/ ) {
$gpg2_mode = 0;
push @ids, $fields[4];
push @emails, $fields[9];
}
else {
die "Cannot parse: ($line)";
}
} #-- 'pub' & 'FLUSH' handled obove
#-- handle 'sub' entries / extract key-id
elsif ( $tag eq 'sub' and $gpg2_mode and $fields[4]) {
push @ids, $fields[4];
}
#-- handle 'uid' entries / extract email
elsif ( $tag eq 'uid' and $gpg2_mode and $fields[9] =~ /<[^>]+>/ ) {
push @emails, $fields[9];
}
#-- ignore anything else
else {
warn "Ignoring line [gpg2_mode=$gpg2_mode] -- '$line'" if $debug;
}
} #-- loop over output_stdout
warn Data::Dumper->Dump( [ \@result], [qw(RESULT_AS_REF)] ) if $debug;
lib/Mail/GPG.pm view on Meta::CPAN
sub query_keyring {
my $self = shift;
my %par = @_;
my ($search, $debug) = @par{'search','debug'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- get a GnuPG::Interface
my $gpg = $self->new_gpg_interface;
#-- initialize Handles
my $stdout = IO::Handle->new;
my $stderr = IO::Handle->new;
my $handles = GnuPG::Handles->new(
stdout => $stdout,
stderr => $stderr,
);
#-- execute gpg --list-public-keys
my $pid = $gpg->wrap_call(
handles => $handles,
commands => [ "--list-keys", "--with-colons" ],
command_args => [$search],
);
#-- fetch gpg's STDERR
my $output_stderr;
$output_stderr .= $_ while <$stderr>;
close $stderr;
#-- fetch gpg's STDOUT
my $output_stdout;
$output_stdout .= $_ while <$stdout>;
close $stdout;
#-- wait on gpg exit
waitpid $pid, 0;
if ( $debug ) {
warn "LIST_KEYS(CMD) -- --list-keys --with-colons $search\n";
warn "LIST_KEYS(STDERR) -- search for ($search):\n$output_stderr\n";
lib/Mail/GPG.pm view on Meta::CPAN
#-- return result: undef if nothing found, first key-id if
#-- a scalar is requested, all entries suitable for a hash
#-- slurp if an array is requested
# Compatibility note: The first id is always the id of the 'pub' entry, even for a subkey-hit.
# gpgv2: The result should not be used to initialise a hash, since some emails will be clobbered.
# We need another interface here. Curently Mail::GPG uses only the first entry...
return if not @result;
return $result[0] if not wantarray;
return @result;
}
lib/Mail/GPG.pm view on Meta::CPAN
my $self = shift;
my %par = @_;
my ($key_id, $passphrase, $entity) =
@par{'key_id','passphrase','entity'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- get default key ID and passphrase, if not given
$key_id = $self->get_default_key_id if not defined $key_id;
$passphrase = $self->get_default_passphrase if not defined $passphrase;
lib/Mail/GPG.pm view on Meta::CPAN
entity => $entity,
method => "sign",
);
#-- get a GnuPG::Interface
my $gpg = $self->new_gpg_interface(
options => {
armor => 1,
default_key => $key_id,
},
passphrase => $passphrase,
lib/Mail/GPG.pm view on Meta::CPAN
stdin => $stdin,
stdout => $stdout,
stderr => $stderr,
);
#-- execute gpg for signing
my $pid = $gpg->detach_sign( handles => $handles );
#-- put encoded entity data into temporary file
#-- (faster than in-memory operation)
my ( $data_fh, $data_file ) = File::Temp::tempfile();
unlink $data_file;
$sign_part->print($data_fh);
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr ) = ("", "");
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 1,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
stderr_sref => \$output_stderr,
stdout_sref => \$output_stdout,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
my $self = shift;
my %par = @_;
my ($key_id, $passphrase, $entity, $recipients, $_no_sign) =
@par{'key_id','passphrase','entity','recipients','_no_sign'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- get default key ID and passphrase, if not given
$key_id = $self->get_default_key_id if not defined $key_id;
$passphrase = $self->get_default_passphrase if not defined $passphrase;
lib/Mail/GPG.pm view on Meta::CPAN
entity => $entity,
method => "encrypt",
);
#-- get a GnuPG::Interface
my $gpg = $self->new_gpg_interface(
options => {
armor => 1,
default_key => $key_id,
},
passphrase => $passphrase,
);
#-- add recipients, but first extract the mail-adress
#-- part, otherwise gpg couldn't find keys for adresses
#-- with quoted printable encodings in the name part-
$recipients = $self->extract_mail_address( recipients => $recipients, );
$gpg->options->push_recipients($_) for @{$recipients};
#-- add default key to recipients if requested
$gpg->options->push_recipients( $self->get_default_key_id )
if $self->get_default_key_encrypt
and $self->get_default_key_id;
#-- initialize handles
my $stdin = IO::Handle->new;
lib/Mail/GPG.pm view on Meta::CPAN
stdin => $stdin,
stdout => $stdout,
stderr => $stderr,
);
#-- execute gpg for encryption
my $pid;
if ($_no_sign) {
$pid = $gpg->encrypt( handles => $handles );
}
else {
$pid = $gpg->sign_and_encrypt( handles => $handles );
}
#-- put encoded entity data into temporary file
#-- (faster than in-memory operation)
my ( $data_fh, $data_file ) = File::Temp::tempfile();
unlink $data_file;
$encrypt_part->print($data_fh);
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr ) = ("", "");
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 1,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
stderr_sref => \$output_stderr,
stdout_sref => \$output_stdout,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
my $self = shift;
my %par = @_;
my ($key_id, $passphrase, $entity) =
@par{'key_id','passphrase','entity'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- get default key ID and passphrase, if not given
$key_id = $self->get_default_key_id if not defined $key_id;
$passphrase = $self->get_default_passphrase if not defined $passphrase;
lib/Mail/GPG.pm view on Meta::CPAN
die "Content transfer encoding '$encoding' is not 7bit safe"
unless $encoding =~ /^(quoted-printable|base64|7bit)\s*$/i;
}
#-- get a GnuPG::Interface, with ASCII armor enabled
my $gpg = $self->new_gpg_interface(
options => {
armor => 1,
default_key => $key_id,
},
passphrase => $passphrase,
lib/Mail/GPG.pm view on Meta::CPAN
stdin => $stdin,
stdout => $stdout,
stderr => $stderr,
);
#-- execute gpg for signing
my $pid = $gpg->clearsign( handles => $handles );
#-- put encoded entity data into temporary file
#-- (faster than in-memory operation)
my ( $data_fh, $data_file ) = File::Temp::tempfile();
unlink $data_file;
$entity->print($data_fh);
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr ) = ("", "");
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 1,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
stderr_sref => \$output_stderr,
stdout_sref => \$output_stdout,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
my $self = shift;
my %par = @_;
my ($key_id, $passphrase, $entity, $recipients, $_no_sign) =
@par{'key_id','passphrase','entity','recipients','_no_sign'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- get default key ID and passphrase, if not given
if ( not $_no_sign ) {
$key_id = $self->get_default_key_id if not defined $key_id;
lib/Mail/GPG.pm view on Meta::CPAN
#-- check parameters
die "Entity has no body" if not $entity->bodyhandle;
#-- get a GnuPG::Interface, with ASCII armor enabled
my $gpg = $self->new_gpg_interface(
options => {
armor => 1,
default_key => $key_id,
},
passphrase => $passphrase,
);
#-- add recipients, but first extract the mail-adress
#-- part, otherwise gpg couldn't find keys for adresses
#-- with quoted printable encodings in the name part-
$recipients = $self->extract_mail_address( recipients => $recipients, );
$gpg->options->push_recipients($_) for @{$recipients};
#-- add default key to recipients if requested
$gpg->options->push_recipients( $self->get_default_key_id )
if $self->get_default_key_encrypt
and $self->get_default_key_id;
#-- initialize handles
my $stdin = IO::Handle->new;
lib/Mail/GPG.pm view on Meta::CPAN
stdin => $stdin,
stdout => $stdout,
stderr => $stderr,
);
#-- execute gpg for encryption
my $pid;
if ($_no_sign) {
$pid = $gpg->encrypt( handles => $handles );
}
else {
$pid = $gpg->sign_and_encrypt( handles => $handles );
}
#-- put encoded entity data into temporary file
#-- (faster than in-memory operation)
my ( $data_fh, $data_file ) = File::Temp::tempfile();
unlink $data_file;
$entity->print($data_fh);
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr ) = ("", "");
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 0,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
stderr_sref => \$output_stderr,
stdout_sref => \$output_stdout,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
sub decrypt {
my $self = shift;
my %par = @_;
my ($entity, $passphrase) = @par{'entity','passphrase'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- get default passphrase, if not given
$passphrase = $self->get_default_passphrase if not defined $passphrase;
lib/Mail/GPG.pm view on Meta::CPAN
entity => $entity,
encrypted_text_sref => \$encrypted_text,
);
#-- get a GnuPG::Interface
my $gpg = $self->new_gpg_interface( passphrase => $passphrase, );
#-- initialize handles
my $stdin = IO::Handle->new;
my $stdout = IO::Handle->new;
my $stderr = IO::Handle->new;
lib/Mail/GPG.pm view on Meta::CPAN
stdout => $stdout,
stderr => $stderr,
status => $status,
);
#-- start gpg for decryption
my $pid = $gpg->decrypt( handles => $handles );
#-- put encoded entity data into temporary file
#-- (faster than in-memory operation)
my ( $data_fh, $data_file ) = File::Temp::tempfile();
unlink $data_file;
print $data_fh $encrypted_text;
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr, $output_status ) = ( "", "", "" );
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 1,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
lib/Mail/GPG.pm view on Meta::CPAN
stdout_sref => \$output_stdout,
status_sref => \$output_status,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
name => "dec-data.txt",
data => $dec_entity->as_string,
);
}
#-- fetch information from gpg's stderr output
#-- and construct a Mail::GPG::Result object from it
my $result = Mail::GPG::Result->new(
mail_gpg => $self,
gpg_stdout => \$output_stdout,
gpg_stderr => \$output_stderr,
gpg_status => \$output_status,
gpg_rc => $rc,
);
#-- return decrypted entity and result object
return $dec_entity if not wantarray;
return ( $dec_entity, $result );
lib/Mail/GPG.pm view on Meta::CPAN
sub verify {
my $self = shift;
my %par = @_;
my ($entity) = $par{'entity'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- check if the entity is signed
my ( $signed_text, $signature_text );
lib/Mail/GPG.pm view on Meta::CPAN
else {
die "Entity is not multipart/signed and has no body";
}
#-- get a GnuPG::Interface
my $gpg = $self->new_gpg_interface;
#-- initialize handles
my $stdin = IO::Handle->new;
my $stdout = IO::Handle->new;
my $stderr = IO::Handle->new;
lib/Mail/GPG.pm view on Meta::CPAN
#-- signature is detached, save it to a temp file
( $sign_fh, $sign_file ) = File::Temp::tempfile();
print $sign_fh $signature_text;
close $sign_fh;
#-- pass signature filename to gpg
$pid = $gpg->verify(
handles => $handles,
command_args => [ $sign_file, "-" ],
);
}
else {
#-- ASCII armor message with embedded signature
$pid = $gpg->verify( handles => $handles, );
}
#-- put encoded entity data into temporary file
#-- (faster than in-memory operation)
my ( $data_fh, $data_file ) = File::Temp::tempfile();
unlink $data_file;
print $data_fh $signed_text;
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr, $output_status ) = ( "", "", "" );
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 1,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
lib/Mail/GPG.pm view on Meta::CPAN
stdout_sref => \$output_stdout,
status_sref => \$output_status,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
data => \$signed_text,
);
}
#-- construct a Mail::GPG::Result object from
#-- gpg's stderr output
my $result = Mail::GPG::Result->new(
mail_gpg => $self,
gpg_stdout => \$output_stdout,
gpg_stderr => \$output_stderr,
gpg_status => \$output_status,
gpg_rc => $rc,
);
#-- return result object
return $result;
}
lib/Mail/GPG.pm view on Meta::CPAN
sub get_decrypt_key {
my $self = shift;
my %par = @_;
my ($entity) = $par{'entity'};
#-- ignore any PIPE signals, in case of gpg exited
#-- early before we fed our data into it.
local $SIG{PIPE} = 'IGNORE';
#-- we parse gpg's output and rely on english
local $ENV{LC_ALL} = "C";
#-- check if the entity is encrypted at all
#-- (dies if not)
my $encrypted_text;
lib/Mail/GPG.pm view on Meta::CPAN
entity => $entity,
encrypted_text_sref => \$encrypted_text,
);
#-- get a GnuPG::Interface
my $gpg = $self->new_gpg_interface;
#-- initialize handles
my $stdin = IO::Handle->new;
my $stdout = IO::Handle->new;
my $stderr = IO::Handle->new;
lib/Mail/GPG.pm view on Meta::CPAN
stdin => $stdin,
stdout => $stdout,
stderr => $stderr,
);
#-- start gpg for decryption
my $pid = $gpg->wrap_call(
handles => $handles,
commands =>
[ "--decrypt", "--batch", "--list-only", "--status-fd", "1" ],
);
lib/Mail/GPG.pm view on Meta::CPAN
unlink $data_file;
print $data_fh $encrypted_text;
#-- perform I/O (multiplexed to prevent blocking)
my ( $output_stdout, $output_stderr ) = ( "", "" );
$self->perform_multiplexed_gpg_io(
data_fh => $data_fh,
data_canonify => 1,
stdin_fh => $stdin,
stderr_fh => $stderr,
stdout_fh => $stdout,
stderr_sref => \$output_stderr,
stdout_sref => \$output_stdout,
);
#-- close reader filehandles (stdin was closed
#-- by perform_multiplexed_gpg_io())
close $stdout;
close $stderr;
#-- fetch zombie
waitpid $pid, 0;
lib/Mail/GPG.pm view on Meta::CPAN
# Suppress warnings about unknown record type 'tru'
# in GnuPG::Interface
local $SIG{__WARN__} = sub {1};
my $gpg = $self->new_gpg_interface;
my @keys = $gpg->get_public_keys($key_id);
croak "Request for key ID '$key_id' got multiple result"
if @keys > 1;
return "" unless $keys[0];
lib/Mail/GPG.pm view on Meta::CPAN
% perl Makefile.PL
% make test
% make install
Mail::GPG has a bunch of tests which will create a temporary
gpg keyring to be able to do real encryption and stuff. You
need to have gpg in your path for the tests to succeed, otherwise
all useful tests will be skipped.
Note that the test 04.big needs some time, on an Athlon 1800XP
about 12 seconds, so be patient ;)
lib/Mail/GPG.pm view on Meta::CPAN
Currently none. Please report any bugs to the author: Joern Reder
<joern AT zyn.de>.
=head1 EXAMPLES
The Mail::GPG distribution contains the program mgpg-test:
Usage: mgpg-test file ...
It takes one or more filenames of mails as
arguments, analyzes them, prints information about
signatures and decrypts encrypteded mails (after asking
for the correspondent passphrases). The script is rather
lib/Mail/GPG.pm view on Meta::CPAN
=item B<gnupg_hash_init>
This attribute corresponds to the GnuPG::Interface hash_init
attribute. Please refer to the GnuPG::Interface manpage for
details. E.g. you can set gpg's --homedir option this way
and much more.
=item B<digest>
This is the digest used by GnuPG to calculate hash values
for signatures. By default Mail::GPG sets it to "RIPEMD160",
which is needed to handle DSA keys (which are very common).
You can check the supported digests of your gpg installation
by executing 'gpg --version'.
=item B<default_key_encrypt>
Set this attribute to a true value if you whish to have the
B<default_key_id> always added as a recipient for encrypted
lib/Mail/GPG.pm view on Meta::CPAN
Mail::GPG prior version 1.0.4 always used short 32 bit key id's.
By setting this attribute to TRUE you can switch to long
64bit key id's. This affects the query_keyring() method and
the key id's stored in Mail::GPG::Result.
=item B<gpg_call>
This defaults to 'gpg' and is the path of the gpg program
executed through GnuPG::Interface. Change this attribute
if the 'gpg' program is not in your PATH.
=back
=head1 METHODS TO CREATE MIME OpenPGP MESSAGES (RFC 3156)
lib/Mail/GPG.pm view on Meta::CPAN
use GnuPG::Interface->get_public_keys and
GnuPG::Interface->get_secret_keys instead. For
details refer to the GnuPG::PrimaryKey manpage.
If you use Perl 5.8.0 or better email addresses will
be returned as an utf8 enabled scalar, because gpg always
lists email adresses in utf8. Since Perl > 5.8.0 handles
utf8 very nice and transparently, you mostly don't need
to care about this ;)
If you use the module with older Perl versions you need
lib/Mail/GPG.pm view on Meta::CPAN
(patched version only!)
=back
Tests: All temporary files are created in directory F</tmp/mail-gpg-test> now.
The environment variable C<DUMPDIR> can be used to select an alternative directory.
=head2 get_key_trust
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mail/GnuPG.pm view on Meta::CPAN
Create a new Mail::GnuPG instance.
Arguments:
Paramhash...
key => gpg key id
keydir => gpg configuration/key directory
passphrase => primary key password
use_agent => use gpg-agent if non-zero
always_trust => always trust a public key
# FIXME: we need more things here, maybe primary key id.
=cut
lib/Mail/GnuPG.pm view on Meta::CPAN
my $class = ref($proto) || $proto;
my $self = {
key => undef,
keydir => undef,
passphrase => "",
gpg_path => "gpg",
use_agent => 0,
@_
};
$self->{last_message} = [];
$self->{plaintext} = [];
lib/Mail/GnuPG.pm view on Meta::CPAN
}
if (defined $self->{always_trust}) {
$gnupg->options->always_trust($self->{always_trust})
}
$gnupg->call( $self->{gpg_path} ) if defined $self->{gpg_path};
}
=head2 decrypt
lib/Mail/GnuPG.pm view on Meta::CPAN
The message can either be in RFC compliant-ish multipart/encrypted
format, or just a single part ascii armored message.
Output:
On Failure:
Exit code of gpg. (0 on success)
On Success: (just encrypted)
(0, undef, undef)
On success: (signed and encrypted)
lib/Mail/GnuPG.pm view on Meta::CPAN
where the keyid is the key that signed it, and emailaddress is full
name and email address of the primary uid
$self->{last_message} => any errors from gpg
$self->{plaintext} => plaintext output from gpg
$self->{decrypted} => parsed output as MIME::Entity
=cut
sub decrypt {
lib/Mail/GnuPG.pm view on Meta::CPAN
return if not $key;
# get mail address of this key
die "Invalid Key Format: $key" unless $key =~ /^[0-9A-F]+$/i;
my $cmd = $self->{gpg_path} . " --with-colons --list-keys $key 2>&1";
my $gpg_out = qx[ $cmd ];
## FIXME: this should probably use open| instead.
die "Couldn't find key $key in keyring" if $gpg_out !~ /\S/ or $?;
my $mail = (split(":", $gpg_out))[9];
return ($mail, $key);
}
=head2 verify
lib/Mail/GnuPG.pm view on Meta::CPAN
the C<decode_bodies> method of MIME::Parser. See the MIME::Parser
documentation for more information.
Output:
On error:
Exit code of gpg. (0 on success)
On success
( 0,
keyid, # ABCDDCBA
emailaddress # Foo Bar <foo@bar.com>
)
where the keyid is the key that signed it, and emailaddress is full
name and email address of the primary uid. The email/uid is UTF8
encoded, as output by GPG.
$self->{last_message} => any errors from gpg
=cut
# Verify RFC2015/RFC3156 email
sub verify {
lib/Mail/GnuPG.pm view on Meta::CPAN
my $gnupg = GnuPG::Interface->new();
$self->_set_options($gnupg);
my @keys = $gnupg->get_public_keys();
foreach my $key (@keys) {
foreach my $uid ($key->user_ids) {
# M::A may not parse the gpg stuff properly. Cross fingers
my ($a) = Mail::Address->parse($uid->as_string); # list context, please
$key_cache{$a->address}=1 if ref $a;
}
}
}
lib/Mail/GnuPG.pm view on Meta::CPAN
Input:
MIME::Entity containing email message to sign
Output:
Exit code of gpg. (0 on success)
$self->{last_message} => any errors from gpg
The provided $entity will be signed. (i.e. it _will_ be modified.)
=cut
lib/Mail/GnuPG.pm view on Meta::CPAN
Input:
MIME::Entity containing email message to sign.
This entity MUST have a body.
Output:
Exit code of gpg. (0 on success)
$self->{last_message} => any errors from gpg
The provided $entity will be signed. (i.e. it _will_ be modified.)
=cut
lib/Mail/GnuPG.pm view on Meta::CPAN
This entity MUST have a body.
list of recipients
Output:
Exit code of gpg. (0 on success)
$self->{last_message} => any errors from gpg
The provided $entity will be encrypted. (i.e. it _will_ be modified.)
=head2 ascii_signencrypt
lib/Mail/GnuPG.pm view on Meta::CPAN
This entity MUST have a body.
list of recipients
Output:
Exit code of gpg. (0 on success)
$self->{last_message} => any errors from gpg
The provided $entity will be encrypted. (i.e. it _will_ be modified.)
=cut
lib/Mail/GnuPG.pm view on Meta::CPAN
Input:
MIME::Entity containing email message to encrypt
list of email addresses to sign to
Output:
Exit code of gpg. (0 on success)
$self->{last_message} => any errors from gpg
The provided $entity will be encrypted. (i.e. it _will_ be modified.)
=head2 mime_signencrypt
lib/Mail/GnuPG.pm view on Meta::CPAN
Input:
MIME::Entity containing email message to sign encrypt
list of email addresses to sign to
Output:
Exit code of gpg. (0 on success)
$self->{last_message} => any errors from gpg
The provided $entity will be encrypted. (i.e. it _will_ be modified.)
=cut
lib/Mail/GnuPG.pm view on Meta::CPAN
# containing the data to write
# return value:
# $rbuf_of - hash ref indexed by the stringified handles
# containing the data that has been read
#
# read and write errors due to EPIPE (gpg exit) are skipped silently on the
# assumption that gpg will explain the problem on the error handle
#
# other errors cause a non-fatal warning, processing continues on the rest
# of the file handles
#
# NOTE: all the handles get closed inside this function
lib/Mail/GnuPG.pm view on Meta::CPAN
my $count = sysread($rhandle, $rbuf_of->{$rhandle},
$blocksize, length($rbuf_of->{$rhandle}));
warn("read $count bytes from handle $n") if $DEBUG;
if (!defined $count) { # read error
if ($!{EPIPE}) {
warn("read failure (gpg exited?) from handle $n: $!")
if $DEBUG;
} else {
warn("read failure from handle $n: $!");
}
$reader->remove($rhandle);
lib/Mail/GnuPG.pm view on Meta::CPAN
$woffset_of->{$whandle} = 0 if !exists $woffset_of->{$whandle};
my $count = syswrite($whandle, $wbuf_of->{$whandle},
$blocksize, $woffset_of->{$whandle});
if (!defined $count) {
if ($!{EPIPE}) { # write error
warn("write failure (gpg exited?) from handle $n: $!")
if $DEBUG;
} else {
warn("write failure from handle $n: $!");
}
$writer->remove($whandle);
view all matches for this distribution