ATMI C Function Reference
tpexport()
—Converts a typed message buffer into an exportable, machine-independent string representation, that includes digital signatures and encryption envelopes.
#include <atmi.h>
int tpexport(char *ibuf
, longilen
, char *ostr
, long *olen
,
longflags
)
tpexport()
converts a typed message buffer into an externalized representation. 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.
The externalized representation may be transmitted between processes, machines, or BEA Tuxedo ATMI applications via any communication mechanism. It may be archived on permanent storage, and remains valid after a system shutdown and reboot.
An externalized representation includes:
ibuf
. They are verified later when the buffer is imported.ibuf
. The buffer content remains protected by encryption. Only specified recipients with access to a valid private key for decryption may later import the buffer.ibuf
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. ilen
specifies how much of ibuf
to export. Note that if ibuf
points to a buffer type for which a length need not be specified (for example, an FML
fielded buffer), then ilen
is ignored (and may be 0).
ostr
is a pointer to the output area that will hold an externalized representation of the buffer's content and associated properties. If TPEX_STRING
is set in flags
, then the externalized format will be a string type. Otherwise, the output length is determined by *olen
and may contain embedded NULL bytes.
On input, *olen
specifies the maximum storage size available at ostr
. On output *olen
is set to the actual number of bytes written to ostr
(including a terminating NULL character if TPEX_STRING
is set in flags
).
The flags
argument may be set to TPEX_STRING
if string format (base 64 encoded) is desired for the output buffer. Otherwise, the output will be binary.
On failure, this function returns -1 and sets tperrno
to indicate the error condition.
Invalid arguments were given. For example, the value of ibuf
is NULL or the value of flags
is not set correctly.
Permission failure. The cryptographic service provider was not able to access a private key necessary to produce a digital signature.