@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);
            int saltLength = 20;
            String hash = OAEPParameters.readHash(seqRef);
            String mgfHash = OAEPParameters.readMgfHash(seqRef);
            if (NativeCrypto.asn1_read_next_tag_is(seqRef, 2)) {
                long saltRef = 0;
                try {
                    saltRef = NativeCrypto.asn1_read_tagged(seqRef);
                    saltLength = (int) NativeCrypto.asn1_read_uint64(saltRef);
                } finally {
                    NativeCrypto.asn1_read_free(saltRef);
                }
            }
            if (NativeCrypto.asn1_read_next_tag_is(seqRef, 3)) {
                long trailerField;
                long trailerRef = 0;
                try {
                    trailerRef = NativeCrypto.asn1_read_tagged(seqRef);
                    trailerField = (int) NativeCrypto.asn1_read_uint64(trailerRef);
                } finally {
                    NativeCrypto.asn1_read_free(trailerRef);
                }
                // 1 is the only legal value for trailerField
                if (trailerField != 1) {
                    throw new IOException("Error reading ASN.1 encoding");
                }
            }

            if (!NativeCrypto.asn1_read_is_empty(seqRef)
                    || !NativeCrypto.asn1_read_is_empty(readRef)) {
                throw new IOException("Error reading ASN.1 encoding");
            }
            this.spec = new PSSParameterSpec(hash, "MGF1", new MGF1ParameterSpec(mgfHash),
                    saltLength, 1);
        } finally {
            NativeCrypto.asn1_read_free(seqRef);
            NativeCrypto.asn1_read_free(readRef);
        }
    }
AlgorithmParameters implementation for PSS.  The only supported encoding format is ASN.1
(with X.509 accepted as an alias), as specified in RFC 4055 section 3.1.
common/src/main/java/org/conscrypt/PSSParameters.java