public static OpenSSLX509Certificate fromX509DerInputStream(InputStream is)
            throws ParsingException {
        final OpenSSLBIOInputStream bis = new OpenSSLBIOInputStream(is, true);

        try {
            final long certCtx = NativeCrypto.d2i_X509_bio(bis.getBioContext());
            if (certCtx == 0) {
                return null;
            }
            return new OpenSSLX509Certificate(certCtx);
        } catch (Exception e) {
            throw new ParsingException(e);
        } finally {
            bis.release();
        }
    }
An implementation of {@link X509Certificate} based on BoringSSL.
common/src/main/java/org/conscrypt/OpenSSLX509Certificate.java