|
NAMEi2a_ASN1_STRING ,
i2a_ASN1_INTEGER ,
i2a_ASN1_ENUMERATED ,
a2i_ASN1_STRING ,
a2i_ASN1_INTEGER ,
a2i_ASN1_ENUMERATED —
hexadecimal dump of an ASN.1 string
SYNOPSIS#include <openssl/asn1.h>
int
int
int
int
int
int
DESCRIPTIONThe functionsi2a_ASN1_STRING (),
i2a_ASN1_INTEGER (), and
i2a_ASN1_ENUMERATED () write a hexadecimal
representation of a to out_bio.
The type argument is ignored.
Each byte of ASN1_STRING_get0_data(3) is written as a number consisting of two upper-case hexadecimal digits. After each group of 70 digits, a backslash and a linefeed are inserted before the next digit. If the
ASN1_STRING_length(3)
of a is 0, instead a pair of zero digits
(“00”) is written by
If a represents a negative integer,
The functions On every input line, the trailing newline character and an optional carrier return character character preceding it are ignored. The trailing newline need not be present on the last line. If there is a backslash character before the newline character, parsing is continued on the next input line. At least one pair of input digits is required by
These functions are able to parse the output of
Parsing fails if an input line contains an odd number of input digits or if memory allocation fails. These functions use the buffer provided by the caller and assume it is at least size bytes long. It is unspecified what the buffer contains after the functions return. RETURN VALUESThe functionsi2a_ASN1_STRING (),
i2a_ASN1_INTEGER (), and
i2a_ASN1_ENUMERATED () return the number of bytes
written or -1 if
BIO_write(3)
fails. In particular, they all return 0 when a is a
NULL pointer.
i2a_ASN1_STRING () returns 1 for an empty string or an
even number greater than 1 for a string that is not empty.
i2a_ASN1_INTEGER () returns an even number greater than
1 for positive input or an odd number greater than 2 for negative input.
i2a_ASN1_ENUMERATED () always returns a non-negative
even number when successful.
The functions SEE ALSOASN1_STRING_length(3), ASN1_STRING_new(3), ASN1_STRING_print_ex(3), i2a_ASN1_OBJECT(3)HISTORYi2a_ASN1_INTEGER () and
a2i_ASN1_INTEGER () first appeared in SSLeay 0.6.0.
i2a_ASN1_STRING () and
a2i_ASN1_STRING () first appeared in SSLeay 0.6.5.
a2i_ASN1_STRING () has been part of the public API
since SSLeay 0.6.5 and i2a_ASN1_STRING () since SSLeay
0.8.0. These functions have been available since OpenBSD
2.4.
BUGSIf the first call to BIO_gets(3) does not return any data, even if that is caused by a fatal I/O error, if the BIO type does not support the “gets” operation, or if it is caused by the BIO being non-blocking,a2i_ASN1_STRING () immediately succeeds and returns an
empty out_string.
If The functions
Visit the GSP FreeBSD Man Page Interface. |