Name
genkey
Synopsis
Generates a key-pair, adding them to a keystore file. This is
essentially a wrapper around the keytool -genkey
command. The keytool application is
included with the JDK, and manages private keys and public
certificates.
Attributes
-
alias(all, String, Y) The identity of the new keystore entry.
-
dname(all, String, *) The X.500 distinguished name associated with the alias.
-
keyalg(all, String, N) The algorithm used to generate the entry.
-
keypass(all, String, *) The password used to protect the private key.
-
keysize(all, String, N) The size of the generated key.
-
keystore(all, String, N) The name of the keystore file. Defaults to
.keystorein the user’s home directory.-
sigalg(all, String, N) The algorithm used to sign the certificate.
-
storepass(all, String, Y) The password used to protect the keystore.
-
storetype(all, String, N) The keystore type.
-
validity(all, String, N) Number of days the generated certificate is valid.
-
verbose(all, boolean, N) Verbose mode. Defaults to
false.
The dname attribute is only required if the
<dname> content is not specified.
keypass is required if the private key password is
different than the keystore password.
Content
- 0,1 nested
<dname>elements (all) Optionally used in place of the
dnameattribute. Contains 0-n nested<param>elements as shown in the example.
Example Usage
The following example generates a new keystore entry:
<genkey dname="CN=Eric Burke, OU=Authors, O=O'Reilly, L=Sebastopol, S=California, C=US" alias="ericb" storepass="aidansdaddy" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access