]> Raphaƫl G. Git Repositories - acme/blob - gencert
Add doc
[acme] / gencert
1 #! /usr/bin/perl
2
3 # Best practice
4 use strict;
5 use warnings;
6
7 # Load acme
8 use acme;
9
10 # Load POSIX
11 use POSIX qw(EXIT_SUCCESS EXIT_FAILURE);
12
13 #XXX: debug
14 use Data::Dumper;
15
16 # Show usage
17 if (scalar(@ARGV) < 2) {
18 print "Usage: $0 user\@example.com www.example.com [example.com] [...]\n";
19 exit EXIT_FAILURE;
20 }
21
22 # Create new object
23 my $acme = acme->new(shift @ARGV, @ARGV);
24
25 # Prepare environement
26 $acme->prepare();
27
28 # Generate required keys
29 $acme->genKeys();
30
31 # Generate csr
32 $acme->genCsr();
33
34 # Directory
35 $acme->directory();
36
37 # Register
38 $acme->register();
39
40 # Authorize
41 $acme->authorize();
42
43 # Issue
44 $acme->issue();
45
46 # Exit with success
47 exit EXIT_SUCCESS;
48