private static long writeAlgorithmIdentifier(long container, String oid) throws IOException {
        long seqRef = 0;
        try {
            seqRef = NativeCrypto.asn1_write_sequence(container);
            NativeCrypto.asn1_write_oid(seqRef, oid);
        } catch (IOException e) {
            NativeCrypto.asn1_write_free(seqRef);
            throw e;
        }
        return seqRef;
    }
Writes an ASN.1 AlgorithmIdentifier structure into container, which looks like
<pre>
SEQUENCE
  OBJECT IDENTIFIER
  PARAMS (based on the particular algorithm)
</pre>
This method returns a reference to the sequence such that the params may be added to it.
The reference needs to be freed with asn1_write_free once it's used.
common/src/main/java/org/conscrypt/OAEPParameters.java