mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8291509: Minor cleanup could be done in sun.security
Reviewed-by: weijun
This commit is contained in:
parent
6beeb8471c
commit
4cec141a90
298 changed files with 2650 additions and 3262 deletions
|
@ -59,11 +59,10 @@ public final class PSSParameters extends AlgorithmParametersSpi {
|
|||
@Override
|
||||
protected void engineInit(AlgorithmParameterSpec paramSpec)
|
||||
throws InvalidParameterSpecException {
|
||||
if (!(paramSpec instanceof PSSParameterSpec)) {
|
||||
if (!(paramSpec instanceof PSSParameterSpec spec)) {
|
||||
throw new InvalidParameterSpecException
|
||||
("Inappropriate parameter specification");
|
||||
}
|
||||
PSSParameterSpec spec = (PSSParameterSpec) paramSpec;
|
||||
|
||||
String mgfName = spec.getMGFAlgorithm();
|
||||
if (!spec.getMGFAlgorithm().equalsIgnoreCase("MGF1")) {
|
||||
|
@ -223,12 +222,10 @@ public final class PSSParameters extends AlgorithmParametersSpi {
|
|||
public static byte[] getEncoded(PSSParameterSpec spec) throws IOException {
|
||||
|
||||
AlgorithmParameterSpec mgfSpec = spec.getMGFParameters();
|
||||
if (!(mgfSpec instanceof MGF1ParameterSpec)) {
|
||||
if (!(mgfSpec instanceof MGF1ParameterSpec mgf1Spec)) {
|
||||
throw new IOException("Cannot encode " + mgfSpec);
|
||||
}
|
||||
|
||||
MGF1ParameterSpec mgf1Spec = (MGF1ParameterSpec)mgfSpec;
|
||||
|
||||
DerOutputStream tmp = new DerOutputStream();
|
||||
DerOutputStream tmp2, tmp3;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue