GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
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.

2022-05-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.