1 package make::gnutlscert;
5 @EXPORT = qw(make_gnutls_cert);
10 open (FH, ">certtool.template");
12 my $org = promptstring_s("Please enter the organization name", "My IRC Network");
13 my $unit = promptstring_s("Please enter the unit Name", "Server Admins");
14 my $state = promptstring_s("Pleae enter your state (two letter code)", "CA");
15 my $country = promptstring_s("Please enter your country", "Oompa Loompa Land");
16 my $commonname = promptstring_s("Please enter the certificate common name (hostname)", "irc.mynetwork.com");
17 my $email = promptstring_s("Please enter a contact email address", "oompa\@loompa.com");
19 # X.509 Certificate options
23 # The organization of the subject.
26 # The organizational unit of the subject.
29 # The locality of the subject.
32 # The state of the certificate owner.
35 # The country of the subject. Two letter code.
38 # The common name of the certificate owner.
41 # A user id of the certificate owner.
44 # If the supported DN OIDs are not adequate you can set
46 # For example set the X.520 Title and the X.520 Pseudonym
47 # by using OID and string pairs.
48 #dn_oid = "2.5.4.12" "Dr." "2.5.4.65" "jackal"
50 # This is deprecated and should not be used in new
52 # pkcs9_email = "none\@none.org"
54 # The serial number of the certificate
57 # In how many days, counting from today, this certificate will expire.
62 # A dnsname in case of a WWW server.
63 #dns_name = "www.none.org"
65 # An IP address in case of a server.
66 #ip_address = "192.168.1.1"
68 # An email in case of a person
71 # An URL that has CRLs (certificate revocation lists)
72 # available. Needed in CA certificates.
73 #crl_dist_points = "http://www.getcrl.crl/getcrl/"
75 # Whether this is a CA certificate or not
78 # Whether this certificate will be used for a TLS client
81 # Whether this certificate will be used for a TLS server
84 # Whether this certificate will be used to sign data (needed
85 # in TLS DHE ciphersuites).
88 # Whether this certificate will be used to encrypt data (needed
89 # in TLS RSA ciphersuites). Note that it is prefered to use different
90 # keys for encryption and signing.
93 # Whether this key will be used to sign other certificates.
96 # Whether this key will be used to sign CRLs.
99 # Whether this key will be used to sign code.
102 # Whether this key will be used to sign OCSP data.
105 # Whether this key will be used for time stamping.
109 system("certtool --generate-privkey --outfile key.pem");
110 system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem --template certtool.template");
111 unlink("certtool.template");