@@ -134,7 +134,11 @@ void validate(KeyStoreBuilder params) {
134134 }
135135 },
136136
137- /** PKCS#11 hardware token */
137+ /**
138+ * PKCS#11 hardware token. The keystore parameter specifies either the name of the provider defined
139+ * in <code>jre/lib/security/java.security</code> or the path to the
140+ * <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/security/p11guide.html#Config">SunPKCS11 configuration file</a>.
141+ */
138142 PKCS11 (false , true , true ) {
139143 @ Override
140144 void validate (KeyStoreBuilder params ) {
@@ -160,7 +164,13 @@ Provider getProvider(KeyStoreBuilder params) {
160164 }
161165 },
162166
163- /** OpenPGP card */
167+ /**
168+ * OpenPGP card. OpenPGP cards contain up to 3 keys, one for signing, one for encryption, and one for authentication.
169+ * All of them can be used for code signing (except encryption keys based on an elliptic curve). The alias
170+ * to select the key is either, <code>SIGNATURE</code>, <code>ENCRYPTION</code> or <code>AUTHENTICATION</code>.
171+ * This keystore can be used with a Nitrokey (non-HSM models) or a Yubikey. It doesn't require any external library
172+ * to be installed.
173+ */
164174 OPENPGP (false , false , false ) {
165175 @ Override
166176 void validate (KeyStoreBuilder params ) {
@@ -186,23 +196,36 @@ Provider getProvider(KeyStoreBuilder params) {
186196 }
187197 },
188198
189- /** OpenSC supported smart card */
199+ /**
200+ * OpenSC supported smart card.
201+ * This keystore requires the installation of <a href="https://github.com/OpenSC/OpenSC">OpenSC</a>.
202+ * If multiple devices are connected, the keystore parameter can be used to specify the name of the one to use.
203+ */
190204 OPENSC (false , true , true ) {
191205 @ Override
192206 Provider getProvider (KeyStoreBuilder params ) {
193207 return OpenSC .getProvider (params .keystore ());
194208 }
195209 },
196210
197- /** Nitrokey HSM */
211+ /**
212+ * Nitrokey HSM. This keystore requires the installation of <a href="https://github.com/OpenSC/OpenSC">OpenSC</a>.
213+ * Other Nitrokeys based on the OpenPGP card standard are also supported with this storetype, but an X.509
214+ * certificate must be imported into the Nitrokey (using the gnupg writecert command). Keys without certificates
215+ * are ignored. Otherwise the {@link #OPENPGP} type should be used.
216+ */
198217 NITROKEY (false , true , true ) {
199218 @ Override
200219 Provider getProvider (KeyStoreBuilder params ) {
201220 return OpenSC .getProvider (params .keystore () != null ? params .keystore () : "Nitrokey" );
202221 }
203222 },
204223
205- /** YubiKey PIV */
224+ /**
225+ * YubiKey PIV. This keystore requires the ykcs11 library from the <a href="https://developers.yubico.com/yubico-piv-tool/">Yubico PIV Tool</a>
226+ * to be installed at the default location. On Windows, the path to the library must be specified in the
227+ * <code>PATH</code> environment variable.
228+ */
206229 YUBIKEY (false , true , true ) {
207230 @ Override
208231 Provider getProvider (KeyStoreBuilder params ) {
@@ -218,7 +241,18 @@ Set<String> getAliases(KeyStore keystore) throws KeyStoreException {
218241 }
219242 },
220243
221- /** AWS KMS */
244+ /**
245+ * AWS Key Management Service (KMS). AWS KMS stores only the private key, the certificate must be provided
246+ * separately. The keystore parameter references the AWS region.
247+ *
248+ * <p>The AWS access key, secret key, and optionally the session token, are concatenated and used as
249+ * the storepass parameter; if the latter is not provided, Jsign attempts to fetch the credentials from
250+ * the environment variables (<code>AWS_ACCESS_KEY_ID</code>, <code>AWS_SECRET_ACCESS_KEY</code> and
251+ * <code>AWS_SESSION_TOKEN</code>) or from the IMDSv2 service when running on an AWS EC2 instance.</p>
252+ *
253+ * <p>In any case, the credentials must allow the following actions: <code>kms:ListKeys</code>,
254+ * <code>kms:DescribeKey</code> and <code>kms:Sign</code>.</p>
255+ * */
222256 AWS (false , false , false ) {
223257 @ Override
224258 void validate (KeyStoreBuilder params ) {
@@ -257,7 +291,11 @@ Provider getProvider(KeyStoreBuilder params) {
257291 }
258292 },
259293
260- /** Azure Key Vault */
294+ /**
295+ * Azure Key Vault. The keystore parameter specifies the name of the key vault, either the short name
296+ * (e.g. <code>myvault</code>), or the full URL (e.g. <code>https://myvault.vault.azure.net</code>).
297+ * The Azure API access token is used as the keystore password.
298+ */
261299 AZUREKEYVAULT (false , true , false ) {
262300 @ Override
263301 void validate (KeyStoreBuilder params ) {
@@ -275,7 +313,11 @@ Provider getProvider(KeyStoreBuilder params) {
275313 }
276314 },
277315
278- /** DigiCert ONE */
316+ /**
317+ * DigiCert ONE. Certificates and keys stored in the DigiCert ONE Secure Software Manager can be used directly
318+ * without installing the DigiCert client tools. The API key, the PKCS#12 keystore holding the client certificate
319+ * and its password are combined to form the storepass parameter: <code><api-key>|<keystore>|<password></code>.
320+ */
279321 DIGICERTONE (false , true , false ) {
280322 @ Override
281323 void validate (KeyStoreBuilder params ) {
@@ -291,7 +333,10 @@ Provider getProvider(KeyStoreBuilder params) {
291333 }
292334 },
293335
294- /** SSL.com eSigner */
336+ /**
337+ * SSL.com eSigner. The SSL.com username and password are used as the keystore password (<code><username>|<password></code>),
338+ * and the base64 encoded TOTP secret is used as the key password.
339+ */
295340 ESIGNER (false , true , false ) {
296341 @ Override
297342 void validate (KeyStoreBuilder params ) {
@@ -317,7 +362,11 @@ boolean reuseKeyStorePassword() {
317362 }
318363 },
319364
320- /** Google Cloud KMS */
365+ /**
366+ * Google Cloud KMS. Google Cloud KMS stores only the private key, the certificate must be provided separately.
367+ * The keystore parameter references the path of the keyring. The alias can specify either the full path of the key,
368+ * or only the short name. If the version is omitted the most recent one will be picked automatically.
369+ */
321370 GOOGLECLOUD (false , false , false ) {
322371 @ Override
323372 void validate (KeyStoreBuilder params ) {
@@ -344,7 +393,12 @@ Provider getProvider(KeyStoreBuilder params) {
344393 }
345394 },
346395
347- /** HashiCorp Vault secrets engine (GCP only) */
396+ /**
397+ * HashiCorp Vault secrets engine (GCP only). Since Google Cloud KMS stores only the private key, the certificate
398+ * must be provided separately. The keystore parameter references the URL of the HashiCorp Vault secrets engine
399+ * (<code>https://vault.example.com/v1/gcpkms</code>). The alias specifies the name of the key in Vault and the key version
400+ * in Google Cloud separated by a colon character (<code>mykey:1</code>).
401+ */
348402 HASHICORPVAULT (false , false , false ) {
349403 @ Override
350404 void validate (KeyStoreBuilder params ) {
0 commit comments