Web::I...nerator(3pm)
β¨ NAME β¨
Web::ID::Certificate::Generator β it's a role for Web::ID::Certificate π
π SYNOPSIS π
use Web::ID::Certificate::Generator;
my %options = (
cert_output => '/home/alice/webid.p12',
passphrase => 's3cr3t s0urc3',
rdf_output => '/home/alice/public_html/foaf.rdf',
subject_alt_names => [
Web::ID::SAN::URI->new(
value => 'http://example.com/~alice/foaf.rdf#me',
),
Web::ID::SAN::Email->new(
value => 'alice@example.com',
),
],
subject_name => 'Alice Jones',
subject_locality => 'Lewes',
subject_region => 'East Sussex',
subject_country => 'GB', # ISO 3166-1 alpha-2 code
);
my $cert = Web::ID::Certificate->generate(%options);
πΈ DESCRIPTION πΈ
Okay bestie, so Web::ID::Certificate::Generator is a role that you can apply to Web::ID::Certificate. And likeβ¦ it is not consumed by Web::ID::Certificate by default, because the author was literally trying to avoid tainting the class with the horror that's found in this role π (their words, not mine, and honestly? valid).
The good news: the import routine of this package applies the role to Web::ID::Certificate for you, so this is genuinely all you need:
use Web::ID::Certificate::Generator;
You do not need to muck around with apply_all_roles yourself. Not even a little. π«Ά
π Constructor
generate(%options)β Generates a brand new WebID-enabled certificate. That's it, that's the whole vibe. β¨
π Options
These are the options you can pass to generator π
cert_outputβ A passphrase-protected PKCS12 certificate file gets generated as part of the certificate generation process. The PKCS12 file is the thing you'd typically import into a browser π.
You can pass a scalar reference, and in that case the PKCS12 data gets written to that scalar; or you can pass a file handle or a string file name.
This is a required option. No skipping, bestie.
passphraseβ The password for the PKCS12 file π.
This is a required option.
rdf_outputβ RDF data is also generated as part of the certificate generation process π¦.
Again, a file handle or string file name can be passed, or an RDF::Trine::Model.
This is a required option.
subject_alt_namesβ A list ofWeb::ID::SANobjects, used to generate the certificate'ssubjectAltNamesfield. You want at least oneWeb::ID::SAN::URIin there, fr fr.
This is a required option.
subject_nameβ The name of the person who will hold the certificate. (e.g."Alice Smith".) π
This is a required option.
subject_orgβ The certificate holder's organisation.
Not required π
subject_localityβ The locality (e.g. city) of the certificate holder's address.
Not required π
subject_regionβ The region (e.g. state or county) of the certificate holder's address.
Not required π
subject_countryβ Two letter ISO code for the country of the certificate holder's address.
Not required π
openssl_pathβ The path to the OpenSSL binary. And yes, that's right β this role calls the OpenSSL binary viasystemcalls π it's giving shelling out. Defaults to automatic discovery viaWeb::ID::Util::FindOpenSSL.key_sizeβ Key size in bits. Defaults to1024. Bigger keys are more secure π₯. Keys bigger than2048bits will take a ridiculously long time to generate. Keys less than512bits are pretty poor π.not_afterβ Date when the certificate should expire, as aDateTimeobject. Defaults to365days.
π BUGS AND LIMITATIONS π
Generating the private key results in shedloads of nasty crud being spewed out on STDERR. Yeah. Not cute. π
Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=Web-ID>.
π¦ SEE ALSO π¦
Web::ID, Web::ID::Certificate.
π AUTHOR π
Toby Inkster <tobyink@cpan.org>.
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Slay π
π DISCLAIMER OF WARRANTIES π
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Like, no promises. None. Zero. Nada. π«Ά
Okay that's the whole page bestie, go generate some certificates π This was Web::I...nerator(3pm) from perl v5.32.1, dated 2021-09-11 β¨ mwah π
π¦ where this page comes from
- debian bookworm: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libweb-id-perl 1.927-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms