1Authen::U2F::Tester::RoUlsee:r:KCeoynsttroirbeu(t3e)d PeArulthDeonc:u:mUe2nFt:a:tTieosnter::Role::Keystore(3)
2
3
4
6 Authen::U2F::Tester::Role::Keystore - U2F Tester Keystore Role.
7
9 version 0.03
10
12 package Authen::U2F::Tester::Keystore::Example;
13
14 use Moose;
15 use namespace::autoclean;
16
17 with 'Authen::U2F::Tester::Role::Keystore';
18
19 sub exists {
20 my ($self, $handle) = @_;
21 ...
22 # if handle is valid and exists in the keystore:
23 return 1;
24
25 # else
26 return 0;
27 }
28
29 sub put {
30 my ($self, $private_key) = @_;
31
32 # somehow generate a unique handle
33 return $handle;
34 }
35
36 sub get {
37 my ($self, $handle) = @_;
38
39 $handle = decode_base64url($handle);
40
41 # fetch the Crypt::PK::ECC private key object associated with this handle.
42 return $pkec;
43 }
44
45 __PACKAGE__->meta->make_immutable;
46
48 This is a Moose::Role that Authen::U2F::Tester keystore's must consume.
49 All required methods must be implemented by the consuming Moose class.
50
52 exists($handle): bool
53 Check if the given handle (in Base64 URL format) exists (or is valid)
54 in the key store.
55
56 get($handle): Crypt::PK::ECC
57 Given the key handle (in Base64 URL format), return the private key (as
58 a Crypt::PK::ECC object) associated with it in the key store.
59
60 put($private_key): scalar
61 Save the given keypair in the keystore, returning a unique key handle
62 that uniquely identifies the keypair. The returned handle should NOT
63 be Base64 URL encoded. $private_key is a raw private key string.
64
65 remove($handle): void
66 Remove the given key handle from the key store.
67
69 The development version is on github at
70 <http://https://github.com/mschout/perl-authen-u2f-tester> and may be
71 cloned from
72 <git://https://github.com/mschout/perl-authen-u2f-tester.git>
73
75 Please report any bugs or feature requests on the bugtracker website
76 <https://github.com/mschout/perl-authen-u2f-tester/issues>
77
78 When submitting a bug or request, please include a test-file or a patch
79 to an existing test-file that illustrates the bug or desired feature.
80
82 Michael Schout <mschout@cpan.org>
83
85 This software is copyright (c) 2017 by Michael Schout.
86
87 This is free software; you can redistribute it and/or modify it under
88 the same terms as the Perl 5 programming language system itself.
89
90
91
92perl v5.36.1 2023-10A-u2t5hen::U2F::Tester::Role::Keystore(3)