With respect to "Check authenticity of cpan mods installed", I know that every tarball accepted on CPAN has a few checksum attributes computed and stored in the corresponding CPAN author directory.

For example, let's say you are interested in this specific distribution release:

https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-Checksums-2.12.tar.gz

You can find the "checksum" for every file on ANDK directory at

https://www.cpan.org/authors/id/A/AN/ANDK/CHECKSUMS

This file has a data structure encoded in Perl itself, and the bit that matters for the tarball in question is

'CPAN-Checksums-2.12.tar.gz' => { 'md5' => 'a98eaa3f96c052ee73690459d8e7a4f4', 'md5-ungz' => 'e49a4710110f8a6a916ece44165ee1e8', 'mtime' => '2016-06-14', 'sha256' => '99600fb2d1a007f84e16b5eae608ffbc288bd0af92fbcc5d73120 +d43ee5d2d38', 'sha256-ungz' => 'aaddaf9ca455863e3f28c55e26741251640ee477906e3e03 +8f5e330ccf406970', 'size' => 14868 },

So you can write code to make sure the downloaded tarball matches the corresponding attributes / checksums.

For example, the commands below (on OS X) manually "check" the size and md5 sum of the .gz file.

$ curl -O https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-Checksum +s-2.12.tar.gz $ stat -f '%N %z' CPAN-Checksums-2.12.tar.gz CPAN-Checksums-2.12.tar.gz 14868 $ md5 CPAN-Checksums-2.12.tar.gz MD5 (CPAN-Checksums-2.12.tar.gz) = a98eaa3f96c052ee73690459d8e7a4f4

I think some CPAN clients (especiallly CPAN which is part of Perl core) may be configured to verify those checksums while downloading and installing. Someone else may correct me or point to the specific incantations to make that work.


In reply to Re: New to perl - Check authenticity of cpan mods installed/used by ferreira
in thread New to perl - Check authenticity of cpan mods installed/used by gradius85

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.