jdk/src/share/classes/com/sun/crypto/provider/SealedObjectForKeyProtector.java
changeset 16909 78a1749a43e2
parent 14317 1e855efb3783
equal deleted inserted replaced
16850:f6f6c2182678 16909:78a1749a43e2
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 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
    44 
    44 
    45     AlgorithmParameters getParameters() {
    45     AlgorithmParameters getParameters() {
    46         AlgorithmParameters params = null;
    46         AlgorithmParameters params = null;
    47         if (super.encodedParams != null) {
    47         if (super.encodedParams != null) {
    48             try {
    48             try {
    49                 params = AlgorithmParameters.getInstance("PBE", "SunJCE");
    49                 params = AlgorithmParameters.getInstance("PBE",
       
    50                     SunJCE.getInstance());
    50                 params.init(super.encodedParams);
    51                 params.init(super.encodedParams);
    51             } catch (NoSuchProviderException nspe) {
       
    52                 // eat.
       
    53             } catch (NoSuchAlgorithmException nsae) {
    52             } catch (NoSuchAlgorithmException nsae) {
    54                 //eat.
    53                 throw new RuntimeException(
    55             } catch (IOException ioe) {
    54                     "SunJCE provider is not configured properly");
    56                 //eat.
    55             } catch (IOException io) {
       
    56                 throw new RuntimeException("Parameter failure: "+
       
    57                     io.getMessage());
    57             }
    58             }
    58         }
    59         }
    59         return params;
    60         return params;
    60     }
    61     }
    61 }
    62 }