jdk/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java
changeset 15010 ec6b49ce42b1
parent 12685 8a448b5b9006
child 17918 37620367ceb7
equal deleted inserted replaced
15009:bcb241432928 15010:ec6b49ce42b1
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2012, 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
    87         }
    87         }
    88         if (params == null) {
    88         if (params == null) {
    89             // generate default for salt and iteration count if necessary
    89             // generate default for salt and iteration count if necessary
    90             if (salt == null) {
    90             if (salt == null) {
    91                 salt = new byte[20];
    91                 salt = new byte[20];
    92                 SunJCE.RANDOM.nextBytes(salt);
    92                 SunJCE.getRandom().nextBytes(salt);
    93             }
    93             }
    94             if (iCount == 0) iCount = 100;
    94             if (iCount == 0) iCount = 100;
    95         } else if (!(params instanceof PBEParameterSpec)) {
    95         } else if (!(params instanceof PBEParameterSpec)) {
    96             throw new InvalidAlgorithmParameterException
    96             throw new InvalidAlgorithmParameterException
    97                 ("PBEParameterSpec type required");
    97                 ("PBEParameterSpec type required");