Add little TOTP test script (#1359)

This commit is contained in:
Xavier Guimard 2018-03-19 06:50:11 +01:00
parent 42d53cec63
commit 952fe3a4e8
1 changed files with 16 additions and 0 deletions

16
scripts/totp-client.pl Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/perl -w
use Authen::OATH;
use Convert::Base32 qw( decode_base32 );
unless ( $ARGV[0] ) {
print STDERR "Usage $0 <totp-secret>\n";
exit 1;
}
my $oath = Authen::OATH->new();
my $totp = $oath->totp( decode_base32( $ARGV[0] ) );
print "$totp\n";
1;