Class CertificateCommand
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringconfigureDemoCert(String commonName) Generates new signed certificate.static StringconfigureDemoCert(String commonName, String[] subjectAltNames) Generates new signed certificate.static StringGenerates new signed certificate.static StringconfigureDemoCertWithDN(String[] dn, String[] subjectAltNames) Generates new signed certificate.protected static KeyStoreFilestatic voidPass in a string to use as the common name of the certificate to be generated.
-
Method Details
-
main
Pass in a string to use as the common name of the certificate to be generated. Exception thrown if 0 arguments or more than 2 argument (or more than 4 when -san is used).Arguments to this program are:
(-cn <cn>|-dn <dn>) [-san <tag:name,tag:name,...>]where: <cn> represents a fully qualified common name (e.g. "<FQDN>", where <FQDN> could be something like cluster.yoyo.com) <dn> represents a distinguished name as a comma-delimited string (e.g. "c=US, st=California, o=Yoyodyne, l=San Narciso, cn=<FQDN>") <tag:name,tag:name,...> represents optional subject alternative names to be added to the generated certificate (e.g. "DNS:<FQDN>,DNS:node1.<FQDN>,DNS:node2.<FQDN>"). The format for subject alternative names is similar to the OpenSSL X509 configuration format. Supported tags are: email - email subject URI - uniformed resource identifier RID - registered id DNS - hostname IP - ip address (V4 or V6) dirName - directory name- Parameters:
args- arguments to the certificate program (see above for description)
-
configureDemoCert
Generates new signed certificate. The input parameter is used as the certificate's common name.Postcondition is the server keystore is updated to include a private entry. The private entry has the new certificate chain that connects the server to the Demo CA. The matching private key is also stored in the entry.
- Parameters:
commonName- string to use as the common name in the new certificate.- Returns:
- the string used as the common name in the new certificate
-
configureDemoCert
Generates new signed certificate. The input parameter is used as the certificate's common name and optional subject alternative names.Postcondition is the server keystore is updated to include a private entry. The private entry has the new certificate chain that connects the server to the Demo CA. The matching private key is also stored in the entry.
- Parameters:
commonName- string to use as the common name in the new certificate.subjectAltNames- names in the formtag:name(format similar to OpenSSL X509 configuration)- Returns:
- the string used as the common name in the new certificate
-
configureDemoCertWithDN
Generates new signed certificate. The input parameter is the full set of attributes of the distinguished name for the cert. It must include a singleCNvalue for the common name.Postcondition is the server keystore is updated to include a private entry. The private entry has the new certificate chain that connects the server to the Demo CA. The matching private key is also stored in the entry.
- Parameters:
dn- String params in the formattrKey=attrValcomposing a distinguished name. e.g. invalid input: '{@code configureDemoCertWithDN(new String[] {"cn=John Whorfin", "o=Yoyodyne", "l=San Narciso", "st=California", "c=US")} @return the string used as the common name in the new certificate'
-
configureDemoCertWithDN
Generates new signed certificate. The input parameter is the full set of attributes of the distinguished name for the cert and optional subject alternative names. It must include a singleCNvalue for the common name.Postcondition is the server keystore is updated to include a private entry. The private entry has the new certificate chain that connects the server to the Demo CA. The matching private key is also stored in the entry.
- Parameters:
dn- String params in the formattrKey=attrValcomposing a distinguished name. e.g. invalid input: '{@code configureDemoCertWithDN(new String[] {"cn=John Whorfin", "o=Yoyodyne", "l=San Narciso", "st=California", "c=US"), null} @param subjectAltNames names in the form {@code tag:name} (format similar to OpenSSL X509 configuration) @return the string used as the common name in the new certificate'
-
getKeyStoreFile
-