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.
*
* <p> If this signature has been previously initialized with parameters
* (by calling the {@code setParameter} method), this method returns
* the same parameters. If this signature has not been initialized with
* parameters, this method may return a combination of default and
* randomly generated parameter values if the underlying
* signature implementation supports it and can successfully generate
* them. Otherwise, {@code null} is returned.
* <p> If this signature has been initialized with parameters
* (by calling {@link #setParameter(AlgorithmParameterSpec)} or
* {@link #setParameter(String, Object)}) and the underlying signature
* implementation supports returning the parameters as
* {@code AlgorithmParameters}, this method returns the same parameters.
* If the parameters were not set, this method may return a combination
* 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}
*

View file

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