@@ -518,11 +518,11 @@ public final void initVerify(PublicKey publicKey)
518518 * of this call.
519519 *
520520 * @param publicKey the public key of the identity whose signature is
521- * going to be verified.
522- * @param params the parameters used for verifying this signature.
521+ * going to be verified
522+ * @param params the parameters used for verifying this signature object
523523 *
524- * @throws InvalidKeyException if the key is invalid.
525- * @throws InvalidAlgorithmParameterException if the params is invalid.
524+ * @throws InvalidKeyException if the key is invalid
525+ * @throws InvalidAlgorithmParameterException if the params is invalid
526526 */
527527 final void initVerify (PublicKey publicKey , AlgorithmParameterSpec params )
528528 throws InvalidKeyException , InvalidAlgorithmParameterException {
@@ -598,13 +598,13 @@ public final void initVerify(Certificate certificate)
598598 * {@code InvalidKeyException} is thrown.
599599 *
600600 * @param certificate the certificate of the identity whose signature is
601- * going to be verified.
602- * @param params the parameters used for verifying this signature.
601+ * going to be verified
602+ * @param params the parameters used for verifying this signature object
603603 *
604604 * @throws InvalidKeyException if the public key in the certificate
605605 * is not encoded properly or does not include required parameter
606- * information or cannot be used for digital signature purposes.
607- * @throws InvalidAlgorithmParameterException if the params is invalid.
606+ * information or cannot be used for digital signature purposes
607+ * @throws InvalidAlgorithmParameterException if the params is invalid
608608 *
609609 * @since 13
610610 */
@@ -647,9 +647,9 @@ public final void initSign(PrivateKey privateKey)
647647 * of this call.
648648 *
649649 * @param privateKey the private key of the identity whose signature
650- * is going to be generated.
650+ * is going to be generated
651651 *
652- * @param random the source of randomness for this signature.
652+ * @param random the source of randomness for this signature object
653653 *
654654 * @throws InvalidKeyException if the key is invalid.
655655 */
@@ -670,11 +670,11 @@ public final void initSign(PrivateKey privateKey, SecureRandom random)
670670 * of this call.
671671 *
672672 * @param privateKey the private key of the identity whose signature
673- * is going to be generated.
674- * @param params the parameters used for generating signature.
675- * @param random the source of randomness for this signature.
673+ * is going to be generated
674+ * @param params the parameters used for generating signature
675+ * @param random the source of randomness for this signature object
676676 *
677- * @throws InvalidKeyException if the key is invalid.
677+ * @throws InvalidKeyException if the key is invalid
678678 * @throws InvalidAlgorithmParameterException if the params is invalid
679679 */
680680 final void initSign (PrivateKey privateKey ,
@@ -967,11 +967,11 @@ public String toString() {
967967 * naming scheme for each parameter is desirable but left unspecified
968968 * at this time.
969969 *
970- * @param param the string identifier of the parameter.
971- * @param value the parameter value.
970+ * @param param the string identifier of the parameter
971+ * @param value the parameter value
972972 *
973973 * @throws InvalidParameterException if {@code param} is an
974- * invalid parameter for this signature algorithm engine ,
974+ * invalid parameter for this signature object ,
975975 * the parameter is already set
976976 * and cannot be set again, a security exception occurs, and so on.
977977 *
@@ -988,12 +988,12 @@ public final void setParameter(String param, Object value)
988988 }
989989
990990 /**
991- * Initializes this signature engine with the specified parameter set .
991+ * Initializes this signature object with the specified parameter values .
992992 *
993- * @param params the parameters
993+ * @param params the parameter values
994994 *
995- * @throws InvalidAlgorithmParameterException if the given parameters
996- * are inappropriate for this signature engine
995+ * @throws InvalidAlgorithmParameterException if the given parameter values
996+ * are inappropriate for this signature object
997997 *
998998 * @see #getParameters
999999 */
@@ -1005,17 +1005,20 @@ public final void setParameter(AlgorithmParameterSpec params)
10051005 /**
10061006 * Returns the parameters used with this signature object.
10071007 *
1008- * <p> If this signature has been initialized with parameters
1009- * (by calling {@link #setParameter(AlgorithmParameterSpec)} or
1010- * {@link #setParameter(String, Object)}) and the underlying signature
1011- * implementation supports returning the parameters as
1012- * {@code AlgorithmParameters}, this method returns the same parameters.
1013- * If the parameters were not set, this method may return a combination
1014- * of default and randomly generated parameter values if the
1015- * underlying signature implementation supports it and can successfully
1016- * generate them. Otherwise, {@code null} is returned.
1017- *
1018- * @return the parameters used with this signature, or {@code null}
1008+ * <p>The returned parameters may be the same that were used to initialize
1009+ * this signature object, or may contain additional default or random
1010+ * parameter values used by the underlying signature scheme. If the required
1011+ * parameters were not supplied and can be generated by the signature
1012+ * object, the generated parameters are returned; otherwise {@code null} is
1013+ * returned.
1014+ *
1015+ * <p>However, if the signature scheme does not support returning
1016+ * the parameters as {@code AlgorithmParameters}, {@code null} is always
1017+ * returned.
1018+ *
1019+ * @return the parameters used with this signature object, or {@code null}
1020+ * @throws UnsupportedOperationException if the provider does not support
1021+ * this method
10191022 *
10201023 * @see #setParameter(AlgorithmParameterSpec)
10211024 * @since 1.4
0 commit comments