Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
NAME
ASN1_mbstring_copy, ASN1_mbstring_ncopy, ASN1_STRING_set_by_NID, ASN1_STRING_set_default_mask, ASN1_STRING_set_default_mask_asc, ASN1_STRING_get_default_mask, ASN1_tag2bit — copy a multibyte string into an ASN.1 string objectSYNOPSIS
#include <openssl/asn1.h>ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int inbytes, int inform, unsigned long mask);
ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int inbytes, int inform, unsigned long mask, long minchars, long maxchars);
ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inbytes, int inform, int nid);
ASN1_STRING_set_default_mask(unsigned long mask);
ASN1_STRING_set_default_mask_asc(const char *maskname);
ASN1_STRING_get_default_mask(void);
ASN1_tag2bit(int tag);
DESCRIPTION
ASN1_mbstring_copy() interprets inbytes bytes starting at in as a multibyte string and copies it to *out, optionally changing the encoding. If the inbytes argument is negative, the strlen(3) of in is used instead.inform | encoding |
MBSTRING_ASC | ISO-Latin-1 |
MBSTRING_BMP | UTF-16 |
MBSTRING_UNIV | UTF-32 |
MBSTRING_UTF8 | UTF-8 |
bit in mask | acceptable output type | default |
B_ASN1_PRINTABLESTRING | ASN1_PRINTABLESTRING | yes |
B_ASN1_IA5STRING | ASN1_IA5STRING | no |
B_ASN1_T61STRING | ASN1_T61STRING | yes |
B_ASN1_BMPSTRING | ASN1_BMPSTRING | yes |
B_ASN1_UNIVERSALSTRING | ASN1_UNIVERSALSTRING | no |
any other bit | ASN1_UTF8STRING | yes |
mask constant | PRI | IA5 | T61 | BMP | UNI | UTF8 |
B_ASN1_DIRECTORYSTRING | yes | no | yes | yes | yes | yes |
DIRSTRING_TYPE | yes | no | yes | yes | no | yes |
PKCS9STRING_TYPE | yes | yes | yes | yes | no | yes |
- If out is NULL, a new output object is allocated and returned instead of skipping the copying.
- If nid has a global string table entry that can be retrieved with ASN1_STRING_TABLE_get(3), mask, minchars, and maxchars are taken from that string table entry. For some values of nid, an additional global mask is AND'ed into the mask before using it. The default value of the global mask is B_ASN1_UTF8STRING.
- If nid has no global string table entry, B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING is used instead of the mask taken from the table, and the global mask is also AND'ed into it.
- Even though success and failure happen in the same situations, the return value is different. ASN1_STRING_type(3) can be used to determine the type of the return value.
maskname | mask |
“default” | anything |
“nombstr” | anything except B_ASN1_BMPSTRING | B_ASN1_UTF8STRING |
“pkix” | anything except B_ASN1_T61STRING |
“utf8only” | B_ASN1_UTF8STRING |
tag | return value |
V_ASN1_BIT_STRING | B_ASN1_BIT_STRING |
V_ASN1_BMPSTRING | B_ASN1_BMPSTRING |
V_ASN1_BOOLEAN | 0 |
V_ASN1_ENUMERATED | B_ASN1_UNKNOWN |
V_ASN1_EOC | 0 |
V_ASN1_EXTERNAL | B_ASN1_UNKNOWN |
V_ASN1_GENERALIZEDTIME | B_ASN1_GENERALIZEDTIME |
V_ASN1_GENERALSTRING | B_ASN1_GENERALSTRING |
V_ASN1_GRAPHICSTRING | B_ASN1_GRAPHICSTRING |
V_ASN1_IA5STRING | B_ASN1_IA5STRING |
V_ASN1_INTEGER | 0 |
V_ASN1_ISO64STRING | B_ASN1_ISO64STRING |
V_ASN1_NULL | 0 |
V_ASN1_NUMERICSTRING | B_ASN1_NUMERICSTRING |
V_ASN1_OBJECT | 0 |
V_ASN1_OBJECT_DESCRIPTOR | B_ASN1_UNKNOWN |
V_ASN1_OCTET_STRING | B_ASN1_OCTET_STRING |
V_ASN1_PRINTABLESTRING | B_ASN1_PRINTABLESTRING |
V_ASN1_REAL | B_ASN1_UNKNOWN |
V_ASN1_SEQUENCE | B_ASN1_SEQUENCE |
V_ASN1_SET | 0 |
V_ASN1_T61STRING | B_ASN1_T61STRING |
V_ASN1_TELETEXSTRING | B_ASN1_TELETEXSTRING |
V_ASN1_UNDEF | 0 |
V_ASN1_UNIVERSALSTRING | B_ASN1_UNIVERSALSTRING |
V_ASN1_UTCTIME | B_ASN1_UTCTIME |
V_ASN1_UTF8STRING | B_ASN1_UTF8STRING |
V_ASN1_VIDEOTEXSTRING | B_ASN1_VIDEOTEXSTRING |
V_ASN1_VISIBLESTRING | B_ASN1_VISIBLESTRING |
11, 13, 14, 15, 29 | B_ASN1_UNKNOWN |
other (< 0, > 30) | 0 |