WebAuth::Keyring(3pm) | User Contributed Perl Documentation | WebAuth::Keyring(3pm) |
WebAuth::Keyring - WebAuth keyring to hold encryption and decryption keys
use WebAuth qw(WA_KEY_AES WA_AES_128); use WebAuth::Key; use WebAuth::Keyring; my $wa = WebAuth->new; eval { $key = WebAuth::Key->new ($wa, WA_KEY_AES, WA_AES_128); $ring = WebAuth::Keyring->new ($wa, $key); ... }; if ($@) { # handle exception }
This Perl class represents a keyring, which is a set of WebAuth keys with associated creation times and times after which they become valid. These keyrings can be read from and stored to files on disk and are used by WebAuth Application Servers and WebKDCs to store their encryption keys.
A WebAuth::Keyring 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::Keyring 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.
The second argument to this method may be either a WebAuth::Key object or a numeric size. If a WebAuth::Key object is provided, a new keyring containing only that key will be created and returned. If a size is provided, a new, empty keyring with space preallocated to hold that many keys is created and returned. (Regardless of the allocated size of a keyring, keyrings will always dynamically expand to hold any new keys that are added to them.)
This is a convenience wrapper around the WebAuth keyring_new() method.
This is a convenience wrapper around the WebAuth keyring_read() method.
This is a convenience wrapper around the WebAuth keyring_read() method.
As with WebAuth module functions, failures are signaled by throwing WebAuth::Exception rather than by return status.
Keys will not used for encryption until after their valid-after time, which provides an opportunity to synchronize the keyring between multiple systems before the keys are used.
If USAGE is WebAuth::WA_KEY_ENCRYPT, this method will return the valid key in the keyring that was created most recently, since this is the best key to use for encryption going forward. If USAGE is WebAuth::WA_KEY_DECRYPT is false, this method will return the key most likely to have been used to encrypt something at the time HINT, where HINT is given in seconds since epoch.
Russ Allbery <eagle@eyrie.org>
WebAuth(3), WebAuth::Key(3), WebAuth::KeyringEntry(3)
This module is part of WebAuth. The current version is available from <http://webauth.stanford.edu/>.
2020-12-21 | perl v5.32.0 |