使用Perl验证GPG文件签名 [英] Verify GPG file signature with Perl

查看:117
本文介绍了使用Perl验证GPG文件签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想验证一个GPG签名文件(使用archive.tar.gz.sign验证archive.tar.gz).

I want to verify a GPG signed file (Verify archive.tar.gz with archive.tar.gz.sign).

ATM我只是直接调用gpg并解析退出代码和输出.虽然这是为我工作的解决方案",但我认为必须有一种更好的方法来更轻松地完成此任务.

ATM I simply call gpg directly and parse the exit code and output. While this is a works-for-me solution, I figure there must be a nicer way to do this in a more perlish way.

但是,作为编程新手,我无法理解如何使用GPG CPAN模块.

But as a programming novice I fail to understand how I can use the GPG CPAN modules.

任何提示都非常感谢!

推荐答案

概要中的GnuPG模块在摘要中包含以下内容:

The GnuPG module on CPAN contains this in the synopsis:

use GnuPG qw( :algo );
my $gpg = new GnuPG();
$gpg->verify( signature => "file.txt.asc", file => "file.txt" );

看起来很干净.

这篇关于使用Perl验证GPG文件签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆