@Override
    protected void engineInit(byte[] bytes) throws IOException {
        long readRef = 0;
        long seqRef = 0;
        try {
            readRef = NativeCrypto.asn1_read_init(bytes);
            seqRef = NativeCrypto.asn1_read_sequence(readRef);
            PSource.PSpecified pSpecified = PSource.PSpecified.DEFAULT;
            String hash = readHash(seqRef);
            String mgfHash = readMgfHash(seqRef);
            if (NativeCrypto.asn1_read_next_tag_is(seqRef, 2)) {
                long pSourceRef = 0;
                long pSourceSeqRef = 0;
                try {
                    pSourceRef = NativeCrypto.asn1_read_tagged(seqRef);
                    pSourceSeqRef = NativeCrypto.asn1_read_sequence(pSourceRef);
                    String pSourceOid = NativeCrypto.asn1_read_oid(pSourceSeqRef);
                    if (!pSourceOid.equals(PSPECIFIED_OID)) {
                        throw new IOException("Error reading ASN.1 encoding");
                    }
                    pSpecified = new PSource.PSpecified(
                            NativeCrypto.asn1_read_octetstring(pSourceSeqRef));
                    if (!NativeCrypto.asn1_read_is_empty(pSourceSeqRef)) {
                        throw new IOException("Error reading ASN.1 encoding");
                    }
                } finally {
                    NativeCrypto.asn1_read_free(pSourceSeqRef);
                    NativeCrypto.asn1_read_free(pSourceRef);
                }
            }

            if (!NativeCrypto.asn1_read_is_empty(seqRef)
                    || !NativeCrypto.asn1_read_is_empty(readRef)) {
                throw new IOException("Error reading ASN.1 encoding");
            }
            this.spec = new OAEPParameterSpec(hash, "MGF1", new MGF1ParameterSpec(mgfHash),
                    pSpecified);
        } finally {
            NativeCrypto.asn1_read_free(seqRef);
            NativeCrypto.asn1_read_free(readRef);
        }
    }
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