This module implements a credentials store. Essentially it allows you to expand one secret (the key of the store) into any number of secrets.
=head1 METHODS
=head2 new
$self->new(keys => \@keys, dir => $dir)
This creates a new C<Crypt::Credentials> object. It takes two named arguments: C<@keys> (mandatory) are the cryptographic keys used to encrypt the credentials, they must be either 16, 24, or 32 bytes long. If multiple keys are given they're tried until the right one is found, this facilitates key rotation. C<$dir> is optional for the directory in which the credentials are stored, it defaults to F<./credentials>.
=head2 get
$self->get($name)
This reads the credentials entry for C<$name>, or throws an exception if it can't be opened for any reason.
=head2 get_yaml
$self->get_yaml($name)
Like the above, except it will decode the payload as YAML.
=head2 put
$self->put($name, $value)
This will write the values to the named credentials entry.
=head2 put_yaml
$self->put_yaml($name, \%values)
Like the above, but it will encode the value to YAML first.
=head2 has
$self->has($name)
This checks if a credentials entry exists
=head2 remove
$self->remove($name)
This removes a credentials entry. It will silently succeed if no such entry exists.
=head2 list
$self->list
This will list all credential entries.
=head2 recode
$self->recode($new_key)
This will recode all credential entries from the current key to the new one.
=head1 AUTHOR
Leon Timmermans <fawaka@gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2024 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
Keyboard Shortcuts
Global
s
Focus search bar
?
Bring up this help dialog
GitHub
gp
Go to pull requests
gi
go to github issues (only if github is preferred repository)