< prev index next >

src/java.base/share/classes/sun/security/rsa/PSSParameters.java

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

@@ -101,11 +101,11 @@
                  AlgorithmId val = AlgorithmId.parse(d.data.getDerValue());
                  if (!val.getOID().equals(AlgorithmId.MGF1_oid)) {
                      throw new IOException("Only MGF1 mgf is supported");
                  }
                  AlgorithmId params = AlgorithmId.parse(
-                     new DerValue(val.getEncodedParams()));
+                         new DerValue(val.getEncodedParams()));
                  String mgfDigestName = params.getName();
                  switch (mgfDigestName) {
                  case "SHA-1":
                      mgfSpec = MGF1ParameterSpec.SHA1;
                      break;

@@ -125,10 +125,22 @@
                      mgfSpec = MGF1ParameterSpec.SHA512_224;
                      break;
                  case "SHA-512/256":
                      mgfSpec = MGF1ParameterSpec.SHA512_256;
                      break;
+                 case "SHA3-224":
+                     mgfSpec = MGF1ParameterSpec.SHA3_224;
+                     break;
+                 case "SHA3-256":
+                     mgfSpec = MGF1ParameterSpec.SHA3_256;
+                     break;
+                 case "SHA3-384":
+                     mgfSpec = MGF1ParameterSpec.SHA3_384;
+                     break;
+                 case "SHA3-512":
+                     mgfSpec = MGF1ParameterSpec.SHA3_512;
+                     break;
                  default:
                      throw new IOException
                          ("Unrecognized message digest algorithm " +
                          mgfDigestName);
                  }
< prev index next >