All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.postgresql.util.internal.Unsafe Maven / Gradle / Ivy

There is a newer version: 42.7.3-yb-1
Show newest version
/*
 * 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;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy