static String readMgfHash(long seqRef) throws IOException {
        if (NativeCrypto.asn1_read_next_tag_is(seqRef, 1)) {
            long mgfRef = 0;
            long mgfSeqRef = 0;
            try {
                mgfRef = NativeCrypto.asn1_read_tagged(seqRef);
                mgfSeqRef = NativeCrypto.asn1_read_sequence(mgfRef);
                String mgfOid = NativeCrypto.asn1_read_oid(mgfSeqRef);
                if (!mgfOid.equals(MGF1_OID)) {
                    throw new IOException("Error reading ASN.1 encoding");
                }
                String mgfHash = getHashName(mgfSeqRef);
                if (!NativeCrypto.asn1_read_is_empty(mgfSeqRef)) {
                    throw new IOException("Error reading ASN.1 encoding");
                }
                return mgfHash;
            } finally {
                NativeCrypto.asn1_read_free(mgfSeqRef);
                NativeCrypto.asn1_read_free(mgfRef);
            }
        }
        return "SHA-1";
    }
AlgorithmParameters implementation for OAEP.  The only supported encoding format is ASN.1,
as specified in RFC 4055 section 4.1.
common/src/main/java/org/conscrypt/OAEPParameters.java