 |
|
| |
OpenXPKI::Template::Plugin::RandomPassword(3) |
User Contributed Perl Documentation |
OpenXPKI::Template::Plugin::RandomPassword(3) |
This module implements a Template Toolkit plugin that generates randomly
generated passwords in RFC2307 syntax. The used alphabet is Base64.
In your template, use the following line at the beginning of the file to load
the plugin:
[% USE password = RandomPassword -%]
After doing so, you can use the class like this:
...
<digest>[% password.generate(scheme => 'ssha', callback => 'sub { print STDERR "*** NOTE: Password for user <John Doe> is: $_\n" }') %]</digest>
...
This invocation will call the generate() method on the
template's password instance variable. It passes the named parameters
'scheme' and 'callback' to the function. The return value of the method is
rendered into the template output.
Generates a random password and returns the encrypted value.
Named parameters:
- scheme
- Required. Specifies the password scheme to use.
The special value none outputs the generated password
as is (without a scheme prefix). Anything else will be handled by
OpenXPKI::Password and print the generated hashed password.
The recommended scheme is 'ssha'.
- bytes
- The number of random bytes, default is 9, which generates a 12 bas63
characters. Note: If this number is not a multiple of 3 you will have
padding characters to fill up to a valid base64 word.
- callback
- Optional. String containing a valid Perl closure subroutine. The closure
is called after generating the password with two parameters. The first
parameter is the unencrypted password, the second one is the encrypted
value.
$_ will contain the unencrypted
password.
Visit the GSP FreeBSD Man Page Interface. Output converted with ManDoc.
|