ATMI C Function Reference
tpimport()
—Converts an externalized representation of a message buffer into a typed message buffer.
#include <atmi.h>
int tpimport(char *istr
, longilen
, char **obuf
, long *olen
,
longflags
)
tpimport()
converts an externalized representation of a message buffer into a typed message buffer. An externalized representation is a message buffer that does not include any BEA Tuxedo ATMI header information that is normally added to a message buffer just before the buffer is transmitted. A process converts a typed message buffer into an externalized representation by calling the tpexport()
function.
Any digital signatures associated with istr
are verified when the buffer is imported, and are available for examination after importing via tpenvelope()
.
If the istr
buffer representation is encrypted, the importing process must have access to a valid private key for decryption. Decryption is performed automatically during the importing process.
If TPEX_STRING
is not set in flags
, then ilen
contains the length of the binary data contained in istr
. If ilen
is 0, istr
is assumed to point to a NULL-terminated string, and the TPEX_STRING
flag is inferred.
*obuf
must point to a valid typed message buffer either (1) previously allocated by a process calling tpalloc()
or (2) delivered by the system to a receiving process. The buffer will be reallocated as necessary to accommodate the result, and its buffer type or subtype may change.
*olen
is set to the amount of valid data contained in the output buffer. If olen
is NULL on input, it is ignored.
The flags
argument should be set to TPEX_STRING
if the input externalized representation is in string format (base 64 encoded). Otherwise, the input is in binary format of length ilen
.
On failure, this function returns -1 and sets tperrno
to indicate the error condition.
Invalid arguments were given. For example, the value of istr
is NULL or the flags
parameter is not set correctly.
Permission failure. The cryptographic service provider was not able to access a private key necessary for decryption.
A protocol failure occurred. The failure involves an invalid data format in istr
or a digital signature that failed verification.