equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
176 // see JCE spec |
176 // see JCE spec |
177 protected AlgorithmParameters engineGetParameters() { |
177 protected AlgorithmParameters engineGetParameters() { |
178 if (spec != null) { |
178 if (spec != null) { |
179 try { |
179 try { |
180 AlgorithmParameters params = |
180 AlgorithmParameters params = |
181 AlgorithmParameters.getInstance("OAEP", "SunJCE"); |
181 AlgorithmParameters.getInstance("OAEP", |
|
182 SunJCE.getInstance()); |
182 params.init(spec); |
183 params.init(spec); |
183 return params; |
184 return params; |
184 } catch (NoSuchAlgorithmException nsae) { |
185 } catch (NoSuchAlgorithmException nsae) { |
185 // should never happen |
186 // should never happen |
186 throw new RuntimeException("Cannot find OAEP " + |
187 throw new RuntimeException("Cannot find OAEP " + |
187 " AlgorithmParameters implementation in SunJCE provider"); |
188 " AlgorithmParameters implementation in SunJCE provider"); |
188 } catch (NoSuchProviderException nspe) { |
|
189 // should never happen |
|
190 throw new RuntimeException("Cannot find SunJCE provider"); |
|
191 } catch (InvalidParameterSpecException ipse) { |
189 } catch (InvalidParameterSpecException ipse) { |
192 // should never happen |
190 // should never happen |
193 throw new RuntimeException("OAEPParameterSpec not supported"); |
191 throw new RuntimeException("OAEPParameterSpec not supported"); |
194 } |
192 } |
195 } else { |
193 } else { |