HSTS::Preloaded - Inspect Chrome's HSTS preloaded list
version 1.0.0
This is a library to work with Chrome's HSTS preloaded list.
One can submit hosts for inclusion to the list with the form https://hstspreload.appspot.com/.
And in the source code of Chromium one can see the list of hosts that are currently in the list: https://code.google.com/p/chromium/codesearch#chromium/src/net/http/transport_security_state_static.json
This library simplifies the work with the preloaded list.
my $h = HSTS::Preloaded->new();
The constructor. It creates new object. It downloads all the info from Chrome's HSTS preloaded list and stores it in the object. This is the only method that interacts with intenet. All other methods uses data that object already have.
my $result = $h->host_is_in_hsts_preloaded_list( $host );
Method returns true value if the specified host is in HSTS preloaded list. Otherwise method returns false value.
For example:
$h->host_is_in_hsts_preloaded_list('google.com'); # true $h->host_is_in_hsts_preloaded_list('microsoft.com'); # false
my $data = $h->get_all_hsts_preloaded_list_data();
Returns all the data. You can read the descrioption of the data structure https://code.google.com/p/chromium/codesearch#chromium/src/net/http/transport_security_state_static.json
This remoted returns perl hashref. For the boolean values that were in JSON file the JSON::PP::Boolean objects are used.
Here is an example of some part of the data.
my $partial_data = $h->get_all_hsts_preloaded_list_data()->{entries}->[619];
The $partial_data will be:
{ include_subdomains => JSON::PP::Boolean { public methods (0) private methods (1) : __ANON__ internals: 1 }, mode => "force-https", name => "www.dropbox.com", pins => "dropbox", }
Ivan Bessarabov <ivan@bessarabov.ru>
This software is copyright (c) 2015 by Ivan Bessarabov.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install HSTS::Preloaded, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HSTS::Preloaded
CPAN shell
perl -MCPAN -e shell install HSTS::Preloaded
For more information on module installation, please visit the detailed CPAN module installation guide.