Encodes this ASN1Data into a DER-encoded String
value. The result is DER-encoded except for the possibility of indefinite
length forms. Indefinite length forms are not allowed in strict DER, so
strictly speaking the result of such an encoding would be a BER-encoding.
static VALUE
ossl_asn1data_to_der(VALUE self)
{
VALUE value = ossl_asn1_get_value(self);
if (rb_obj_is_kind_of(value, rb_cArray))
return ossl_asn1cons_to_der(self);
else {
if (RTEST(ossl_asn1_get_indefinite_length(self)))
ossl_raise(eASN1Error, "indefinite length form cannot be used " \
"with primitive encoding");
return ossl_asn1prim_to_der(self);
}
}