WebAuth::Key(3pm) | User Contributed Perl Documentation | WebAuth::Key(3pm) |
WebAuth::Key - WebAuth encryption and decryption key
use WebAuth qw(WA_KEY_AES WA_AES_128); use WebAuth::Key; my $wa = WebAuth->new; eval { $key = WebAuth::Key->new ($wa, WA_KEY_AES, WA_AES_128); ... }; if ($@) { # handle exception }
A WebAuth::Key object represents a single WebAuth key, which can be used for encryption or decryption. Keys are normally stored in WebAuth::Keyring objects, and token encoding and decoding requires a keyring rather than a key.
To convert a key to a keyring, see the WebAuth keyring_new() method or "WebAuth::Keyring->new".
A WebAuth::Key object will be destroyed when the WebAuth context used to create it is destroyed, and subsequent accesses to it may cause memory access errors or other serious bugs. Be careful not to retain a copy of a WebAuth::Key object after the WebAuth object that created it has been destroyed.
As with WebAuth module functions, failures are signaled by throwing WebAuth::Exception rather than by return status.
If KEY_MATERIAL is given, it should contain SIZE bytes of data, which will be used as the key. If KEY_MATERIAL is not given or is undef, a new random key of the specified TYPE and SIZE will be generated.
This is a convenience wrapper around the WebAuth key_create() method.
Russ Allbery <eagle@eyrie.org>
WebAuth(3), WebAuth::Keyring(3)
This module is part of WebAuth. The current version is available from <http://webauth.stanford.edu/>.
2019-01-05 | perl v5.28.1 |