#include
int ASN1_STRING_length(ASN1_STRING *x); unsigned char * ASN1_STRING_data(ASN1_STRING *x);
ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a);
int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
int ASN1_STRING_type(ASN1_STRING *x);
int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
_A_S_N_1___S_T_R_I_N_G___l_e_n_g_t_h_(_) returns the length of the content of xx.
_A_S_N_1___S_T_R_I_N_G___d_a_t_a_(_) returns an internal pointer to the data of xx. Since this is an internal pointer it should nnoott be freed or modified in any way.
_A_S_N_1___S_T_R_I_N_G___d_u_p_(_) returns a copy of the structure aa.
_A_S_N_1___S_T_R_I_N_G___c_m_p_(_) compares aa and bb returning 0 if the two are identical. The string types and content are compared.
_A_S_N_1___S_T_R_I_N_G___s_e_t_(_) sets the data of string ssttrr to the buffer ddaattaa or length lleenn. The supplied data is copied. If lleenn is -1 then the length is determined by strlen(data).
_A_S_N_1___S_T_R_I_N_G___t_y_p_e_(_) returns the type of xx, using standard constants such as VV__AASSNN11__OOCCTTEETT__SSTTRRIINNGG.
_A_S_N_1___S_T_R_I_N_G___t_o___U_T_F_8_(_) converts the string iinn to UTF8 format, the converted data is allocated in a buffer in **oouutt. The length of oouutt is returned or a negative error code. The buffer **oouutt should be free using _O_P_E_N_S_S_L___f_r_e_e_(_).
These functions should nnoott be used to examine or modify AASSNN11__IINNTTEEGGEERR or AASSNN11__EENNUUMMEERRAATTEEDD types: the relevant IINNTTEEGGEERR or EENNUUMMEERRAATTEEDD utility functions should be used instead.
In general it cannot be assumed that the data returned by _A_S_N_1___S_T_R_I_N_G___d_a_t_a_(_) is null terminated or does not contain embedded nulls. The actual format of the data will depend on the actual string type itself: for example for and IA5String the data will be ASCII, for a BMPString two bytes per character in big endian format, UTF8String will be in UTF8 format.
Similar care should be take to ensure the data is in the correct format when calling _A_S_N_1___S_T_R_I_N_G___s_e_t_(_).