Sortix volatile manual
This manual documents Sortix volatile, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
X509_NAME_add_entry_by_txt, X509_NAME_add_entry_by_OBJ, X509_NAME_add_entry_by_NID, X509_NAME_add_entry, X509_NAME_delete_entry — X509_NAME modification functionsSYNOPSIS
#include <openssl/x509.h>X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, const unsigned char *bytes, int len, int loc, int set);
X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len, int loc, int set);
X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, const unsigned char *bytes, int len, int loc, int set);
X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, int set);
X509_NAME_delete_entry(X509_NAME *name, int loc);
DESCRIPTION
X509_NAME_add_entry_by_txt(), X509_NAME_add_entry_by_OBJ(), and X509_NAME_add_entry_by_NID() add a field whose name is defined by a string field, an object obj or a NID nid, respectively. The field value to be added is in bytes of length len. If len is -1 then the field length is calculated internally using strlen(bytes).RETURN VALUES
X509_NAME_add_entry_by_txt(), X509_NAME_add_entry_by_OBJ(), X509_NAME_add_entry_by_NID(), and X509_NAME_add_entry() return 1 for success or 0 if an error occurred.EXAMPLES
Create an X509_NAME structure:C=UK, O=Disorganized Organization, CN=Joe Bloggs X509_NAME *nm; nm = X509_NAME_new(); if (nm == NULL) /* Some error */ if (!X509_NAME_add_entry_by_txt(nm, "C", MBSTRING_ASC, "UK", -1, -1, 0)) /* Error */ if (!X509_NAME_add_entry_by_txt(nm, "O", MBSTRING_ASC, "Disorganized Organization", -1, -1, 0)) /* Error */ if (!X509_NAME_add_entry_by_txt(nm, "CN", MBSTRING_ASC, "Joe Bloggs", -1, -1, 0)) /* Error */