Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2021, Huawei Technologies Co., Ltd. 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. Huawei designates this
* particular file as subject to the "Classpath" exception as provided
* by Huawei in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please visit https://gitee.com/openeuler/bgmprovider if you need additional
* information or have any questions.
*/
package org.openeuler.sun.security.ssl;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.Principal;
import java.security.PrivilegedAction;
public class KrbClientKeyExchangeHelper {
private static final String KRB5_CLASS_NAME =
"sun.security.ssl.krb5.KrbClientKeyExchangeHelperImpl";
private static final Class> krb5Class = AccessController.doPrivileged(
new PrivilegedAction>() {
@Override
public Class> run() {
try {
return Class.forName(KRB5_CLASS_NAME, true, null);
} catch (ClassNotFoundException cnf) {
return null;
}
}
});
private static Method initRreMaster;
private static Method initEncodedTicket;
private static Method getEncodedTicket;
private static Method getEncryptedPreMasterSecret;
private static Method getPlainPreMasterSecret;
private static Method getPeerPrincipal;
private static Method getLocalPrincipal;
private static Exception exception;
private Object krb5Instance;
static {
AccessController.doPrivileged(new PrivilegedAction