@SuppressWarnings({"LiteralClassName", "unchecked"})
    static AlgorithmParameterSpec fromGCMParameters(AlgorithmParameters params) {
        Class<?> gcmSpecClass;
        try {
            gcmSpecClass = Class.forName("javax.crypto.spec.GCMParameterSpec");
        } catch (ClassNotFoundException e) {
            gcmSpecClass = null;
        }

        if (gcmSpecClass != null) {
            try {
                return params.getParameterSpec((Class) gcmSpecClass);
            } catch (InvalidParameterSpecException e) {
                return null;
            }
        }
        return null;
    }
Convert from an opaque AlgorithmParameters to the platform's GCMParameterSpec.
android/src/main/java/org/conscrypt/Platform.java