Authen...rapped(3pm)

✨ Authen::U2F::Tester::Keystore::Wrapped πŸ’…

okay bestie, say hi to Authen::U2F::Tester::Keystore::Wrapped β€” the Wrapped Keystore for Authen::U2F::Tester πŸŽ€ (yes the module name has a whole saga in it, we move).


🌸 VERSION 🌸

version 0.03 β€” tiny number, big energy ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

my $key = Crypt::PK::ECC->new;
...
my $keystore = Authen::U2F::Tester::Keystore->new(key => $key);

my $keypair = Authen::U2F::Tester::Keypair->new;
my $handle = $keystore->put($keypair->private_key);

if ($keystore->exists($handle)) {
    my $pkec = $keystore->get($handle);
}

like… that's the whole vibe. make a key, make a keystore, put a private key, get a handle back, and later exists / get it. iconic behavior fr fr πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so this is a "wrapped" key store for Authen::U2F::Tester, and it's literally the default key store that Authen::U2F::Tester uses. no cap. 🫢

here's the tea, and it's genuinely the coolest part: this key store needs zero backing storage to keep track of registered keys. none. not a single byte of "hey remember this one?" β€” because instead of remembering anything, it generates key handles by encrypting the private key using the tester's private key, and then just… returns that encrypted value as the key handle. ✨

the FIDO/U2F specs describe this kind of thing somewhat vaguely as a "wrapped" key handle. and honestly? the author's experience is that most of the U2F devices out there use some variation of this scheme, because it lets the devices work with an infinite number of services β€” no local storage required on the U2F device at all. infinite. services. slay. πŸ’…

so why don't we need to store the handle anywhere? because this class can tell whether a handle is valid all by itself, by trying to decrypt the key handle you passed in:

  • if decryption succeeds β†’ the handle is valid βœ…
  • otherwise β†’ the handle is not valid ❌

that's it, that's the whole trick, and it ate. πŸ”₯


πŸŽ€ SEE ALSO πŸŽ€

  • Authen::U2F::Tester::Role::Keystore

🌈 SOURCE 🌈

the development version is on github at <http://https://github.com/mschout/perl-authen-u2f-tester> and may be cloned from <git://https://github.com/mschout/perl-authen-u2f-tester.git> 🧚 (yes those URLs look a little cursed, that's exactly what the page says, we do not touch, we do not fix πŸ™ˆ)


πŸ’€ BUGS πŸ’€

please report any bugs or feature requests on the bugtracker website <https://github.com/mschout/perl-authen-u2f-tester/issues> πŸ›

when you submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or the desired feature. pleaseeee bestie, the patch is the love language here 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Michael Schout <mschout@cpan.org> ⭐


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. πŸ’œ


perl v5.26.2 Β· 2018-04-12 β€” that's the version and date stamp from the bottom of the page, mwah, and that's a wrap on Authen::U2F::Tester::Keystore::Wrapped. go forth and wrap some key handles bestie πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from