ASN1_STRING_NEW(3)

NAME
ASN1_STRING_new, ASN1_STRING_type_new, ASN1_STRING_free, ASN1_OCTET_STRING_new, ASN1_OCTET_STRING_free, ASN1_BIT_STRING_new, ASN1_BIT_STRING_free, ASN1_INTEGER_new, ASN1_INTEGER_free, ASN1_ENUMERATED_new, ASN1_ENUMERATED_free, ASN1_UTF8STRING_new, ASN1_UTF8STRING_free, ASN1_IA5STRING_new, ASN1_IA5STRING_free, ASN1_UNIVERSALSTRING_new, ASN1_UNIVERSALSTRING_free, ASN1_BMPSTRING_new, ASN1_BMPSTRING_free, ASN1_GENERALSTRING_new, ASN1_GENERALSTRING_free, ASN1_T61STRING_new, ASN1_T61STRING_free, ASN1_VISIBLESTRING_new, ASN1_VISIBLESTRING_free, ASN1_PRINTABLESTRING_new, ASN1_PRINTABLESTRING_free, ASN1_PRINTABLE_new, ASN1_PRINTABLE_free, DIRECTORYSTRING_new, DIRECTORYSTRING_free, DISPLAYTEXT_new, DISPLAYTEXT_free, ASN1_GENERALIZEDTIME_new, ASN1_GENERALIZEDTIME_free, ASN1_UTCTIME_new, ASN1_UTCTIME_free, ASN1_TIME_new, ASN1_TIME_free - allocate and free ASN1_STRING objects

SYNOPSIS
#include <openssl/asn1.h>
ASN1_STRING *
ASN1_STRING_new(void);
ASN1_STRING *
ASN1_STRING_type_new(int type);
void
ASN1_STRING_free(ASN1_STRING *a);
ASN1_OCTET_STRING *
ASN1_OCTET_STRING_new(void);
void
ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a);
ASN1_BIT_STRING *
ASN1_BIT_STRING_new(void);
void
ASN1_BIT_STRING_free(ASN1_BIT_STRING *a);
ASN1_INTEGER *
ASN1_INTEGER_new(void);
void
ASN1_INTEGER_free(ASN1_INTEGER *a);
ASN1_ENUMERATED *
ASN1_ENUMERATED_new(void);
void
ASN1_ENUMERATED_free(ASN1_ENUMERATED *a);
ASN1_UTF8STRING *
ASN1_UTF8STRING_new(void);
void
ASN1_UTF8STRING_free(ASN1_UTF8STRING *a);
ASN1_IA5STRING *
ASN1_IA5STRING_new(void);
void
ASN1_IA5STRING_free(ASN1_IA5STRING *a);
ASN1_UNIVERSALSTRING *
ASN1_UNIVERSALSTRING_new(void);
void
ASN1_UNIVERSALSTRING_free(ASN1_UNIVERSALSTRING *a);
ASN1_BMPSTRING *
ASN1_BMPSTRING_new(void);
void
ASN1_BMPSTRING_free(ASN1_BMPSTRING *a);
ASN1_GENERALSTRING *
ASN1_GENERALSTRING_new(void);
void
ASN1_GENERALSTRING_free(ASN1_GENERALSTRING *a);
ASN1_T61STRING *
ASN1_T61STRING_new(void);
void
ASN1_T61STRING_free(ASN1_T61STRING *a);
ASN1_VISIBLESTRING *
ASN1_VISIBLESTRING_new(void);
void
ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a);
ASN1_PRINTABLESTRING *
ASN1_PRINTABLESTRING_new(void);
void
ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a);
ASN1_STRING *
ASN1_PRINTABLE_new(void);
void
ASN1_PRINTABLE_free(ASN1_STRING *a);
ASN1_STRING *
DIRECTORYSTRING_new(void);
void
DIRECTORYSTRING_free(ASN1_STRING *a);
ASN1_STRING *
DISPLAYTEXT_new(void);
void
DISPLAYTEXT_free(ASN1_STRING *a);
ASN1_GENERALIZEDTIME *
ASN1_GENERALIZEDTIME_new(void);
void
ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a);
ASN1_UTCTIME *
ASN1_UTCTIME_new(void);
void
ASN1_UTCTIME_free(ASN1_UTCTIME *a);
ASN1_TIME *
ASN1_TIME_new(void);
void
ASN1_TIME_free(ASN1_TIME *a);

DESCRIPTION
The ASN1_STRING object can represent a variety of ASN.1 built-in types. It can store a type and a value.

All the *_new() functions allocate and initialize an empty ASN1_STRING object. The following table shows the type assigned to the new object, and which ASN.1 type it represents.
constructor function | OpenSSL type | ASN.1 type
 |
ASN1_STRING_new() | V_ASN1_OCTET_STRING
ASN1_STRING_type_new() | type argument
 |
ASN1_OCTET_STRING_new() | V_ASN1_OCTET_STRING | OCTET STRING
ASN1_BIT_STRING_new() | V_ASN1_BIT_STRING | BIT STRING
ASN1_INTEGER_new() | V_ASN1_INTEGER | INTEGER
ASN1_ENUMERATED_new() | V_ASN1_ENUMERATED | ENUMERATED
 |
ASN1_UTF8STRING_new() | V_ASN1_UTF8STRING | UTF8String
ASN1_IA5STRING_new() | V_ASN1_IA5STRING | IA5String
 |
ASN1_UNIVERSALSTRING_new() | V_ASN1_UNIVERSALSTRING | UniversalString
ASN1_BMPSTRING_new() | V_ASN1_BMPSTRING | BMPString
ASN1_GENERALSTRING_new() | V_ASN1_GENERALSTRING | GeneralString
ASN1_T61STRING_new() | V_ASN1_T61STRING | T61String
ASN1_VISIBLESTRING_new() | V_ASN1_VISIBLESTRING | VisibleString
ASN1_PRINTABLESTRING_new() | V_ASN1_PRINTABLESTRING | PrintableString
 |
ASN1_PRINTABLE_new() | V_ASN1_UNDEF
DIRECTORYSTRING_new() | V_ASN1_UNDEF
DISPLAYTEXT_new() | V_ASN1_UNDEF
 |
ASN1_GENERALIZEDTIME_new() | V_ASN1_GENERALIZEDTIME | GeneralizedTime
ASN1_UTCTIME_new() | V_ASN1_UTCTIME | UTCTime
ASN1_TIME_new() | V_ASN1_UNDEF | TIME

All the *_free functions free a including any data contained in it. If a is a NULL pointer, no action occurs.

RETURN VALUES
All the *_new functions return the new ASN1_STRING object or NULL if an error occurs.

SEE ALSO
ASN1_time_parse(3), ASN1_TIME_set(3), d2i_ASN1_OCTET_STRING(3), ERR_get_error(3)

BUGS
ASN1_OCTET_STRING, ASN1_BIT_STRING, ASN1_INTEGER, ASN1_ENUMERATED, ASN1_UTF8STRING, ASN1_IA5STRING, ASN1_UNIVERSALSTRING, ASN1_BMPSTRING, ASN1_GENERALSTRING, ASN1_T61STRING, ASN1_VISIBLESTRING, ASN1_PRINTABLESTRING, ASN1_GENERALIZEDTIME, ASN1_UTCTIME, and ASN1_TIME are merely typedef aliases of ASN1_STRING and provide no type safety whatsoever.