Authen::U2F::Tester::Role::Keystore - U2F Tester Keystore Role.


version 0.03


 package Authen::U2F::Tester::Keystore::Example;

 use Moose;
 use namespace::autoclean;

 with 'Authen::U2F::Tester::Role::Keystore';

 sub exists {
     my ($self, $handle) = @_;
     # if handle is valid and exists in the keystore:
     return 1;

     # else
     return 0;

 sub put {
     my ($self, $private_key) = @_;

     # somehow generate a unique handle
     return $handle;

 sub get {
     my ($self, $handle) = @_;

     $handle = decode_base64url($handle);

     # fetch the Crypt::PK::ECC private key object associated with this handle.
     return $pkec;



This is a Moose::Role that Authen::U2F::Tester keystore's must consume. All required methods must be implemented by the consuming Moose class.


exists($handle): bool

Check if the given handle (in Base64 URL format) exists (or is valid) in the key store.

get($handle): Crypt::PK::ECC

Given the key handle (in Base64 URL format), return the private key (as a Crypt::PK::ECC object) associated with it in the key store.

put($private_key): scalar

Save the given keypair in the keystore, returning a unique key handle that uniquely identifies the keypair. The returned handle should NOT be Base64 URL encoded. $private_key is a raw private key string.

remove($handle): void

Remove the given key handle from the key store.


The development version is on github at http:// and may be cloned from git://


Please report any bugs or feature requests on the bugtracker website

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 <>


This software is copyright (c) 2017 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.