Keytool Maven Plugin

This plugin provides the capability to manipulate keys and keystores and acts as a wrapper of the keytool command.

Goals Overview

Keytool compatibility with jdk

Keytool does not have same operations available for any jdk, see here list of restrictions for older jdk:

  • importKeystore works only since jdk 1.6
  • generateCertificate works only since jdk 1.7
  • printCertificateRequest works only since jdk 1.7
  • printCRFile works only since jdk 1.7

    Since version 1.3, goals will failed for unsupported operations.

Deprecated goals

In version 1.2, a lots of new goals were introduced (MKEYTOOL-19) to perform all possible task available in the keytool command.

Note also that new goals are not attached to any phase, so you will have to set explicitly the phase on which attach executions of goals.

As the new goals can set all parameters than older one, we prefer to deprecate the old one... Please use the new mojo (old one will be at next major release removed).

  • Deprecated since 1.2 keytool:genkey generates a keystore replaced by generateKeyPair.
  • Deprecated since 1.2 keytool:export reads a certificate from a keystore and stores it in a file replaced by exportCertificate
  • Deprecated since 1.2 keytool:import reads a certificate from a file and stores it in a keystore replaced by importCertificate.

Usage

Instructions on how to use the Keytool Plugin can be found on the usage page.