App-sslmaker

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

                passphrase => "/path/to/passphrase.txt",
                extensions => "v3_ca", # default: usr_cert
              });

This method will sign a `csr` file generated by ["make\_csr"](#make_csr). `ca_key` and
`passphrase` is the same values as you would provide ["make\_key"](#make_key) and
`ca_cert` is the output from ["make\_cert"](#make_cert).

The returned `$asset` is a [Path::Tiny](https://metacpan.org/pod/Path%3A%3ATiny) object which holds the generated
certificate. It is possible to specify the location of this object by
passing on `cert` to this method.

## subject

    $self = $self->subject(@subjects);
    $self = $self->subject("/C=NO/ST=Oslo/L=Oslo/O=Example/OU=Prime/emailAddress=admin@example.com", ...);
    $str = $self->subject;

Holds the default subject field for the certificate. Can be set by passing in a
list of subject strings, hashes or paths to certificate files. The list will
get merged, soo the last one overrides the one before.

## with\_config

    $any = $self->with_config($method => \%args);

Used to call a [method](#methods) with a temp ["openssl.cnf"](#openssl-cnf)
file. The `%stash` in the template will be constructed from the `%args`,
which is also passed on to the next `$method`. Example:

    $asset = $self->with_config(make_key => {
                home       => "/path/to/pki",
                passphrase => "/path/to/pki/private/passphrase.txt",
                bits       => 8192,
             });

The config file will be removed when `$self` go out of scope.

An alternative to this method is to set the `OPENSSL_CONF` environment
variable before calling `$method`:

    local $ENV{OPENSSL_CONF} = "/path/to/openssl.cnf";
    $asset = $self->make_key({...});

# TEMPLATES

["render\_to\_file"](#render_to_file) can render these templates, which is bundled with this module:

- crlnumber

    Creates a file which stores the SSL CRL number. If `n` is present in
    `%stash`, it will be used as the start number, which defaults to 1000.

- index.txt

    This is currently just an empty file.

- nginx.config

    Used to render an example nginx config. `%stash` should contain `cert`,
    `client_certificate`, `crl`, `key`, `server_name` and `verify_client`.

- openssl.cnf

    Creates a config file for openssl. TODO: Descrive stash values.

- serial

    Creates a file which stores the SSL serial number. If `n` is present in
    `%stash`, it will be used as the start number, which defaults to 1000.

# COPYRIGHT AND LICENCE

## Code

Copyright (C) Jan Henning Thorsen

The code is free software, you can redistribute it and/or modify it under the
terms of the Artistic License version 2.0.

## Documentation

Documentation is licensed under the terms of Creative Commons
Attribution-ShareAlike 3.0 Unported license.

The documentation is put together by Jan Henning Thorsen, with citations from
Jamie Nguyen's website [https://jamielinux.com/](https://jamielinux.com/).

# AUTHOR

Jan Henning Thorsen - `jhthorsen@cpan.org`



( run in 0.824 second using v1.01-cache-2.11-cpan-39bf76dae61 )