![]() |
![]()
| ![]() |
![]()
OpenXPKI::Template::Plugin::UtilsPlugin for Template::Toolkit providing some string manipulation functions. How to useYou need to load the plugin into your template before using it. As we do not export the methods, you need to address them with the plugin name, e.g. [% USE Utils %] [% Utils.ascii_to_hex(value) %] Will output the converted string. Methodsuuid Generate a UUID v3 string (e.g. 4162F712-1DD2-11B2-B17E-C09EFE1DC403) This is simply a wrapper around Data::UUID->gen_str. ascii_to_hex Convert a ascii string to its hexadecimal representation, e.g. "OpenXPKI" becomes 4f70656e58504b49. to_base64 ( text ) Encode the given (binary) data using Base64 encoding, output is without linebreaks or spaces. sha256 ( text, secret ) Return the sha256 digest of the given input data in hexadecimal representation. If the second argument is given it is used as secret key to calculate sha256 HMAC instead of a plain digest. dnProvides the same functionality as Certificate.dn but expects the subject DN to parse as string in the first argument. Returns the DN as parsed hash, if second parameter is given returns the named part as string. Note: In case the named property has more than one item, only the first one is returned!
|