@SuppressWarnings("deprecation") // PSKKeyManager is deprecated, but in our own package
    private static PSKKeyManager findFirstPSKKeyManager(KeyManager[] kms) {
        for (KeyManager km : kms) {
            if (km instanceof PSKKeyManager) {
                return (PSKKeyManager)km;
            } else if (km != null) {
                try {
                    return DuckTypedPSKKeyManager.getInstance(km);
                } catch (NoSuchMethodException ignored) {
                    // This PSKKeyManager doesn't support the required methods, go to the next
                }
            }
        }
        return null;
    }
Returns X.509 key manager or null for none.
common/src/main/java/org/conscrypt/SSLParametersImpl.java