Manual Pages for UNIX Darwin command on man ASN1_STRING_set
MyWebUniversity

Manual Pages for UNIX Darwin command on man ASN1_STRING_set

ASN1STRINGlength(3) OpenSSL ASN1STRINGlength(3)

NAME

ASN1STRINGdup, ASN1STRINGcmp, ASN1STRINGset, ASN1STRINGlength,

ASN1STRINGlengthset, ASN1STRINGtype, ASN1STRINGdata -

ASN1STRING utility functions

SYNOPSIS

int ASN1STRINGlength(ASN1STRING *x); unsigned char * ASN1STRINGdata(ASN1STRING *x); ASN1STRING * ASN1STRINGdup(ASN1STRING *a); int ASN1STRINGcmp(ASN1STRING *a, ASN1STRING *b); int ASN1STRINGset(ASN1STRING *str, const void *data, int len); int ASN1STRINGtype(ASN1STRING *x); int ASN1STRINGtoUTF8(unsigned char **out, ASN1STRING *in);

DESCRIPTION

These functions allow an AASSNN11SSTTRRIINNGG structure to be manipulated. ASN1STRINGlength() returns the length of the content of xx. ASN1STRINGdata() 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. ASN1STRINGdup() returns a copy of the structure aa. ASN1STRINGcmp() compares aa and bb returning 0 if the two are identical. The string types and content are compared. ASN1STRINGset() 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). ASN1STRINGtype() returns the type of xx, using standard constants such as VVAASSNN11OOCCTTEETTSSTTRRIINNGG. ASN1STRINGtoUTF8() 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 OPENSSLfree(). NNOOTTEESS Almost all ASN1 types in OpenSSL are represented as an AASSNN11SSTTRRIINNGG structure. Other types such as AASSNN11OOCCTTEETTSSTTRRIINNGG are simply typedefed to AASSNN11SSTTRRIINNGG and the functions call the AASSNN11SSTTRRIINNGG equivalents. AASSNN11SSTTRRIINNGG is also used for some CCHHOOIICCEE types which consist entirely of primitive string types such as DDiirreeccttoorryySSttrriinngg and TTiimmee. These functions should nnoott be used to examine or modify AASSNN11IINNTTEEGGEERR or AASSNN11EENNUUMMEERRAATTEEDD types: the relevant IINNTTEEGGEERR or EENNUUMMEERRAATTEEDD utility functions should be used instead. In general it cannot be assumed that the data returned by ASN1STRINGdata() 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 ASN1STRINGset().

RETURN VALUES

SEE ALSO

ERRgeterror(3) HISTORY

0.9.7l 2002-10-20 ASN1STRINGlength(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™