8243424: Signature and SignatureSpi get parameter methods may return null when unsupported

Reviewed-by: mullan
This commit is contained in:
Anthony Scarpino 2020-06-08 10:45:58 -07:00
parent a043bd0ff8
commit 785b914282
2 changed files with 18 additions and 14 deletions

View file

@ -1012,13 +1012,15 @@ public abstract class Signature extends SignatureSpi {
/** /**
* Returns the parameters used with this signature object. * Returns the parameters used with this signature object.
* *
* <p> If this signature has been previously initialized with parameters * <p> If this signature has been initialized with parameters
* (by calling the {@code setParameter} method), this method returns * (by calling {@link #setParameter(AlgorithmParameterSpec)} or
* the same parameters. If this signature has not been initialized with * {@link #setParameter(String, Object)}) and the underlying signature
* parameters, this method may return a combination of default and * implementation supports returning the parameters as
* randomly generated parameter values if the underlying * {@code AlgorithmParameters}, this method returns the same parameters.
* signature implementation supports it and can successfully generate * If the parameters were not set, this method may return a combination
* them. Otherwise, {@code null} is returned. * of default and randomly generated parameter values if the
* underlying signature implementation supports it and can successfully
* generate them. Otherwise, {@code null} is returned.
* *
* @return the parameters used with this signature, or {@code null} * @return the parameters used with this signature, or {@code null}
* *

View file

@ -387,13 +387,15 @@ public abstract class SignatureSpi {
* <p>This method is overridden by providers to return the parameters * <p>This method is overridden by providers to return the parameters
* used with this signature engine. * used with this signature engine.
* *
* <p> If this signature engine has been previously initialized with * <p> If this signature engine has been initialized with parameters
* parameters (by calling the {@code engineSetParameter} method), this * (by calling {@link #engineSetParameter(AlgorithmParameterSpec)} or
* method returns the same parameters. If this signature engine has not been * {@link #engineSetParameter(String, Object)}) and the underlying signature
* initialized with parameters, this method may return a combination of * implementation supports returning the parameters as
* default and randomly generated parameter values if the underlying * {@code AlgorithmParameters}, this method returns the same parameters.
* signature implementation supports it and can successfully generate * If the parameters were not set, this method may return a combination
* them. Otherwise, {@code null} is returned. * of default and randomly generated parameter values if the
* underlying signature implementation supports it and can successfully
* generate them. Otherwise, {@code null} is returned.
* *
* @return the parameters used with this signature engine, or {@code null} * @return the parameters used with this signature engine, or {@code null}
* *