The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Validate::DNS::SSHFP - Validate DNS SSH Fingerprint (SSHFP) Record Values

VERSION

version 0.01

SYNOPSIS

 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.

DESCRIPTION

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.

METHODS

new()

Constructor

FUNCTIONS

is_sshfp_algorithm($value, %options)

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

is_sshfp_fptype($value, %options)

Return the untainted fingerprint type number if it is a valid SSHFP fingerprint number.

Options:

  • strict [default: true]

    Require that the value is one of the registered values in the IANA Registry

is_sshfp_fingerprint($fptype, $value, %options)

Return the untainted value if it looks like a valid SSHFP fingerprint string for the given fingerprint type.

Options:

  • strict [default: true]

    Require that $fptype is one of the registered values in the IANA Registry

SEE ALSO

SOURCE

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

BUGS

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.

AUTHOR

Michael Schout <mschout@cpan.org>

COPYRIGHT AND LICENSE

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.