src/java.base/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java
branchJDK-8145252-TLS13-branch
changeset 56542 56aaa6cb3693
parent 47216 71c04702a3d5
child 56646 e57205a6e4ee
equal deleted inserted replaced
56541:92cbbfc996f3 56542:56aaa6cb3693
     1 /*
     1 /*
     2  * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1999, 2018, 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
    89                 UnrecoverableKeyException {
    89                 UnrecoverableKeyException {
    90             if (ks == null) {
    90             if (ks == null) {
    91                 keyManager = new X509KeyManagerImpl(
    91                 keyManager = new X509KeyManagerImpl(
    92                         Collections.<Builder>emptyList());
    92                         Collections.<Builder>emptyList());
    93             } else {
    93             } else {
    94                 if (SunJSSE.isFIPS() && (ks.getProvider() != SunJSSE.cryptoProvider)) {
    94                 if (SunJSSE.isFIPS() &&
    95                     throw new KeyStoreException("FIPS mode: KeyStore must be "
    95                         (ks.getProvider() != SunJSSE.cryptoProvider)) {
    96                         + "from provider " + SunJSSE.cryptoProvider.getName());
    96                     throw new KeyStoreException(
       
    97                         "FIPS mode: KeyStore must be " +
       
    98                         "from provider " + SunJSSE.cryptoProvider.getName());
    97                 }
    99                 }
    98                 try {
   100                 try {
    99                     Builder builder = Builder.newInstance(ks,
   101                     Builder builder = Builder.newInstance(ks,
   100                         new PasswordProtection(password));
   102                         new PasswordProtection(password));
   101                     keyManager = new X509KeyManagerImpl(builder);
   103                     keyManager = new X509KeyManagerImpl(builder);