org.postgresql.util.internal.Unsafe Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdbc-yugabytedb Show documentation
Show all versions of jdbc-yugabytedb Show documentation
Java JDBC 4.2 (JRE 8+) driver for YugaByte SQL database
/*
* Copyright (c) 2021, PostgreSQL Global Development Group
* See the LICENSE file in the project root for more information.
*/
package org.postgresql.util.internal;
/**
* This class is excluded from {@code forbidden-apis} check.
* @see Extend
* suppression configuration to be more fine grained
*/
public class Unsafe {
public static boolean credentialCacheExists() {
try {
@SuppressWarnings({"nullness"})
sun.security.krb5.Credentials credentials =
sun.security.krb5.Credentials.acquireTGTFromCache(null, null);
return credentials != null;
} catch (Exception ex) {
return false;
}
}
}