Data::Validate::DNS::SSHFP - Validate DNS SSH Fingerprint (SSHFP) Record Values
version 0.01
use Data::Validate::DNS::SSHFP ':all'; if (is_sshfp_algorithm(3)) { print 'Looks like a valid SSHFP algorithm'; } if (is_sshfp_fptype(2)) { print 'Looks like a valid SSHFP fingerprint type'; } if (is_sshfp_finterprint($fptype, $fingerprint)) { print 'Looks like a valid SSHFP Fingerprint'; } # Or, use object syntax: my $v = Data::Validate::DNS::SSHFP->new; if ($v->is_sshfp_fptype($value)) { ... } # etc.
This module offers functions for validating DNS SSH Fingerprint (SSHFP) record fields to make input validation and untainting easier and more readable.
All of the functions return an untainted value on success and a false value (undef or empty list) on failure. In scalar context you should check that the return value is defined.
All functions can be called as methods if using the object oriented interface.
Constructor
Returns the untainted algorithm number if it is a valid SSHFP algorithm number.
Options:
strict [default: true]
Require that the algorithm is one of the registered values in the IANA Registry
Return the untainted fingerprint type number if it is a valid SSHFP fingerprint number.
Require that the value is one of the registered values in the IANA Registry
Return the untainted value if it looks like a valid SSHFP fingerprint string for the given fingerprint type.
Require that $fptype is one of the registered values in the IANA Registry
$fptype
RFC 4255
IANA Registry for SSHFP RR Parameters
The development version is on github at http://https://github.com/mschout/perl-data-validate-dns-sshfp and may be cloned from git://https://github.com/mschout/perl-data-validate-dns-sshfp.git
Please report any bugs or feature requests on the bugtracker website https://github.com/mschout/perl-data-validate-dns-sshfp/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Michael Schout <mschout@cpan.org>
This software is copyright (c) 2018 by Michael Schout.
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 Data::Validate::DNS::SSHFP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Validate::DNS::SSHFP
CPAN shell
perl -MCPAN -e shell install Data::Validate::DNS::SSHFP
For more information on module installation, please visit the detailed CPAN module installation guide.