29 #include "ms_example.h"
30 #include <seclabel_api.h>
31 #include <isode/base/compat.h>
33 #define XML_BUFSIZE 1024
35 int num_unsigned_rcvd;
36 int num_unverified_rcvd;
37 int num_verified_rcvd;
38 int num_messages_rcvd ;
39 int num_reports_rcvd ;
42 static char *optstr =
"u37m:d:p:w:M:D:P:W:e:b:x:EY:U:I";
44 static void usage(
void);
48 struct X400msSession *sp
51 static void setup_default_new_sec_env(
52 struct X400msSession *sp,
53 char *sec_trusted_cert_dir
56 static void setup_default_old_sec_env(
57 struct X400msSession *sp,
63 static void report_msg_token_info(
64 struct X400Recipient *rp
67 static int get_sec_label(
68 struct X400msMessage *mp
71 static void print_sec_label(
72 unsigned char slab_buffer[],
77 struct X400Recipient *rp
80 static int get_4406_info(
81 struct X400msMessage *mp
84 static void show_recip_certificate (
85 struct X400Recipient *rp,
89 static void show_message_certificate (
90 struct X400msMessage *mp,
93 static void show_certificate (
94 struct X400Certificate *cert,
97 static int handle_ipn(
98 struct X400msMessage *mp
101 static int handle_msg(
102 struct X400msSession *sp,
103 struct X400msMessage *mp
107 struct X400msSession *sp,
108 struct X400msMessage *mp,
109 struct X400msMessage **ipn
112 static int do_report(
113 struct X400msSession *sp,
114 struct X400msMessage *mp
130 struct X400msSession *sp;
136 if (get_args(argc, argv, optstr)) {
141 printf(
"Connection type (0 = P7, 1 = P3 submit only, 2 = P3 both directions) [%d]: ", x400_contype);
142 contype = ic_fgetc(x400_contype, stdin);
144 ic_fgetc(x400_contype, stdin);
146 if ( contype <
'0' ||
'2' < contype )
147 contype = x400_contype;
152 def_oraddr = x400_ms_user_addr;
153 def_dn = x400_ms_user_dn;
154 def_pa = x400_ms_presentation_address;
157 def_oraddr = x400_mta_user_addr;
158 def_dn = x400_mta_user_dn;
159 def_pa = x400_mta_presentation_address;
162 printf(
"Your ORAddress [%s] > ", def_oraddr);
163 ic_fgets(orn,
sizeof orn, stdin);
165 if (orn[strlen(orn) - 1] ==
'\n')
166 orn[strlen(orn) - 1] =
'\0';
169 strcpy(orn, def_oraddr);
172 printf(
"Password [%s]: ",
173 contype == 0 ? x400_p7_password : x400_p3_password);
174 if (ic_fgets(buffer,
sizeof buffer, stdin) == NULL)
177 if (buffer[strlen(buffer) - 1] ==
'\n')
178 buffer[strlen(buffer) - 1] =
'\0';
179 if (buffer[0] ==
'\0')
180 strcpy(buffer, contype == 0 ? x400_p7_password : x400_p3_password);
182 printf(
"Presentation Address [%s] > ", def_pa);
183 ic_fgets(pa,
sizeof pa, stdin);
185 if (pa[strlen(pa) - 1] ==
'\n')
186 pa[strlen(pa) - 1] =
'\0';
191 status =
X400msOpen(contype, orn, def_dn, buffer, pa, &nummsg, &sp);
193 fprintf(stderr,
"Error in Open: %s\n",
X400msError(status));
201 printf (
"no messages - waiting for a message to be delivered.....\n");
204 printf(
"%d messages waiting\n", nummsg);
207 status = get_msg(sp);
209 fprintf(stderr,
"Error in getting msg: %s\n",
213 fprintf(stderr,
"got first\n");
216 fprintf(stderr,
"================================================\n");
217 status = get_msg(sp);
219 fprintf(stderr,
"Error in getting msg: %s\n",
223 }
while (until_no_more_msgs);
226 printf(
"%d num_messages_rcvd\n", num_messages_rcvd);
227 printf(
"%d num_reports_rcvd\n", num_reports_rcvd);
228 printf(
"%d num_unsigned_rcvd\n", num_unsigned_rcvd);
229 printf(
"%d num_unverified_rcvd\n", num_unverified_rcvd);
230 printf(
"%d num_verified_rcvd\n", num_verified_rcvd);
231 printf(
"%d num_ipns_rcvd\n", num_ipns_rcvd);
237 struct X400msSession *sp
244 struct X400msMessage *mp;
247 printf(
"Waiting for new messages for 10 seconds\n");
250 fprintf(stderr,
"Error from Wait: %s\n",
X400msError(status));
253 printf(
"%d num_messagese_rcvd\n", num_messages_rcvd);
254 printf(
"%d num_reports_rcvd\n", num_reports_rcvd);
255 printf(
"%d num_unsigned_rcvd\n", num_unsigned_rcvd);
256 printf(
"%d num_unverified_rcvd\n", num_unverified_rcvd);
257 printf(
"%d num_verified_rcvd\n", num_verified_rcvd);
274 if (use_new_sec_env) {
275 setup_default_new_sec_env(sp, trusted_ca_certs_dir);
277 setup_default_old_sec_env(sp, security_id, identity_dn, passphrase);
287 printf(
"Getting message\n");
292 fprintf(stderr,
"MsgGet successfully got message\n");
295 fprintf(stderr,
"Error from MsgGet: %s\n",
X400msError(status));
306 status = do_report(sp, mp);
316 fprintf(stderr,
"Error from MsgGetIntParam (X400_N_IS_IPN): %s\n",
319 printf(
"Type of Message: %d\n", intparam);
324 printf(
"Received an IPN\n");
332 num_messages_rcvd++ ;
333 status = handle_msg(sp, mp);
335 fprintf(stderr,
"Error from handle_msg: %s\n",
340 struct X400msMessage *ipn;
341 status = send_ipn(sp, mp, &ipn);
343 fprintf(stderr,
"Error from send_ipn: %s\n",
349 fprintf(stderr,
"Error from X400msMsgDelete (subject message)%s\n",
355 fprintf(stderr,
"Error from X400msMsgDelete (IPN)%s\n",
363 fprintf(stderr,
"Error from X400msMsgDelete (IPN)%s\n",
371 static int do_report(
372 struct X400msSession *sp,
373 struct X400msMessage *mp
379 char recipient_str[BUFSIZ];
382 struct X400Recipient *rp;
388 fprintf(stderr,
"Got a report (printing only some attributes)\n");
392 buffer,
sizeof buffer, &length);
394 fprintf(stderr,
"Error from MsgGetStrParam: %s\n",
400 printf(
"Subject Identifier: %.*s\n", (
int)length, buffer);
408 fprintf(stderr,
"Error from RecipGet: %s\n",
418 sizeof recipient_str, &length);
420 fprintf(stderr,
"Error from RecipGetStrParam: %s\n",
427 printf(
"Delivery Report for recipient %d: %.*s\n", n,
428 (
int)length, recipient_str);
433 buffer,
sizeof buffer, &length);
437 printf(
"Delivery Time: %.*s\n", (
int)length, buffer);
441 printf(
"Negative Delivery Report for recipient %d: %.*s\n", n,
442 (
int)length, recipient_str);
446 buffer,
sizeof buffer,
449 fprintf(stderr,
"Error from RecipGetStrParam: %s\n",
453 printf(
"Supplementary Info: %.*s\n", (
int)length, buffer);
460 fprintf(stderr,
"Error from RecipGetIntParam: %s\n",
463 printf(
"Non-Delivery Reason: %d\n", intparam);
470 fprintf(stderr,
"Error from RecipGetIntParam: %s\n",
473 printf(
"Non-Delivery Diagnostic: %d\n", intparam);
479 fprintf(stderr,
"Error from X400msMsgDelete: %s\n",
485 static int handle_ipn(
486 struct X400msMessage *mp
489 struct X400Recipient *rp;
499 buffer,
sizeof buffer, &length);
501 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_OR_ADDRESS): %s\n",
504 printf(
"IPN Originator: %.*s\n", (
int)length, buffer);
510 fprintf(stderr,
"Error from X400msRecipGet (X400_RECIP_ENVELOPE): %s\n",
514 buffer,
sizeof buffer, &length);
516 fprintf(stderr,
"Error from X400RecipGetStrParam (X400_S_OR_ADDRESS): %s\n",
520 buffer[length] =
'\0';
521 printf(
"IPN Recipient: %.*s\n", (
int)length, buffer);
528 buffer,
sizeof buffer, &length);
530 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_SUBJECT_IPM): %s\n",
533 printf(
"Subject Message Identifier: %.*s\n", (
int)length, buffer);
538 buffer,
sizeof buffer, &length);
540 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_CONVERSION_EITS): %s\n",
X400msError(status));
542 printf(
"conversion EITs: %.*s\n", (
int)length, buffer);
549 printf(
" non-receipt reason: %d\n", intparam);
551 fprintf(stderr,
"Error getting non-receipt reason: %s\n",
559 printf(
"discard reason: %d\n", intparam);
561 fprintf(stderr,
"Error getting discard reason: %s\n",
567 buffer,
sizeof buffer, &length);
569 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_AUTOFORWARD_COMMENT): %s\n",
572 printf(
"autoforward comment: %.*s\n", (
int)length, buffer);
577 buffer,
sizeof buffer, &length);
579 fprintf(stderr,
"Error from MsgGetStrParam(X400_S_RECEIPT_TIME): %s\n",
582 printf(
" Time of receipt: (UTCTime format): %.*s\n", (
int)length, buffer);
589 printf(
" Acknowledgement mode: (0 - manual; 1 -automatic): %d\n",
592 fprintf(stderr,
"Error getting Acknowledgement mode: %s\n",
598 buffer,
sizeof buffer, &length);
600 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_SUPP_RECEIPT_INFO): %s\n",
607 printf(
" Supplementary information: %.*s\n", (
int)length, buffer);
612 "Error from MsgGetIntParam (X400_N_CONTENT_TYPE,): %s\n",
615 printf(
"Content Type: %d\n", intparam);
624 static int handle_msg(
625 struct X400msSession *sp,
626 struct X400msMessage *mp
633 struct X400Recipient *rp;
641 fprintf(stderr,
"Error from MsgGetIntParam: %s\n",
644 printf(
"Size of Message: %d\n", intparam);
650 "Error from MsgGetIntParam (X400_N_CONTENT_TYPE,): %s\n",
653 printf(
"Content Type: %d\n", intparam);
658 buffer,
sizeof buffer, &length);
660 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_EXTERNAL_CONTENT_TYPE): %s\n",
663 printf(
"External Content Type: %.*s\n", (
int)length, buffer);
668 buffer,
sizeof buffer, &length);
670 fprintf(stderr,
"Error from MsgGetStrParam: %s\n",
676 printf(
"Message Identifier: %.*s\n", (
int)length, buffer);
683 buffer,
sizeof buffer, &length);
685 fprintf(stderr,
"Error from MsgGetStrParam: %s\n",
691 printf(
"Originator: %.*s\n", (
int)length, buffer);
699 fprintf(stderr,
"Error from RecipGet (envelope): %s\n",
708 buffer,
sizeof buffer, &length);
710 printf(
"Env Recipient %d: %.*s\n", n, (
int)length, buffer);
717 printf(
"Recipient proof of delivery request is %d\n", intparam);
719 fprintf(stderr,
"Error getting proof of delivery request: %s\n",
727 report_msg_token_info(rp);
739 fprintf(stderr,
"Error from RecipGet (primary): %s\n",
X400msError(status));
746 buffer,
sizeof buffer, &length);
748 printf(
"Primary Recipient %d: %.*s\n", n, (
int)length, buffer);
753 printf(
"Primary Recipient Precedence %d\n", intparam);
755 fprintf(stderr,
"Error getting Primary Recipient Precedence : %s\n",
X400msError(status));
762 buffer,
sizeof buffer, &length);
764 printf(
"Subject: %.*s\n", (
int)length, buffer);
768 buffer,
sizeof buffer, &length);
770 printf(
"Text:\n%.*s\n", (
int)length, buffer);
772 printf(
"No IA5 Text content (%d: %s)\n", status,
X400msError(status));
775 printf(
"Getting body parts\n");
783 struct X400msSession *sp,
784 struct X400msMessage *mp,
785 struct X400msMessage **ipn
791 fprintf (stderr,
"x400msMsgNew returned error: %s\n",
798 fprintf(stderr,
"Error from X400msMakeIPN: %s\n",
806 fprintf (stderr,
"x400msMsgSend returned error: %s\n",
810 printf(
"IPN submitted successfully\n");
824 static void setup_default_new_sec_env(
825 struct X400msSession *sp,
826 char *local_trusted_ca_certs_dir
832 printf(
" Adding %s as trusted CA cert dir\n", trusted_ca_certs_dir);
834 local_trusted_ca_certs_dir, -1);
836 fprintf (stderr,
"X400msSetStrDefault returned error: %s\n",
853 static void setup_default_old_sec_env(
854 struct X400msSession *sp,
873 fprintf (stderr,
"X400msSetStrDefault returned error: %s\n",
881 fprintf (stderr,
"X400msSetStrDefault returned error: %s\n",
888 static void report_msg_token_info(
889 struct X400Recipient *rp
900 fprintf(stderr,
"No MessageToken present in recipient\n");
904 fprintf(stderr,
"Error from RecipGetIntParam: %s (%d)\n",
907 fprintf(stderr,
"Message Token status not available\n");
910 "Message Token status %d \n", param);
915 fprintf(stderr,
"Token OK (%d)\n", param);
920 "Message Token validation cannot take place because the security environment is invalid (%d):\n",
932 "Message Token validation failed (%d): %s\n",
937 "Unexpected Message Token validation result (%d): %s\n",
948 buffer,
sizeof buffer, &length);
950 fprintf(stderr,
"Error from RecipGetStrParam: %s\n",
953 fprintf(stderr,
"recipient in token not available\n");
956 "Message Token(%u): recipient in Token '%.*s'\n",
957 (
unsigned)length, (
int)length, buffer);
962 buffer,
sizeof buffer, &length);
964 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
967 fprintf(stderr,
"Message Token DER not available\n");
970 "Message Token DER available (%u bytes)\n", (
unsigned)length);
976 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
979 fprintf(stderr,
"Message Token seq num not available\n");
982 "Message Token seq num %d \n", param);
987 buffer,
sizeof buffer, &length);
989 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
992 fprintf(stderr,
"Message Token Security Label DER not available\n");
995 "Message Token Security Label DER available (%u bytes)\n", (
unsigned)length);
996 fprintf(stderr,
"Security Label from Message Token is:\n");
997 print_sec_label((
unsigned char *)buffer, length);
1004 printf(
"No Content Integrity Check in token\n");
1006 printf(
"Error from RecipGetIntParam: %s\n",
X400msError(status));
1013 printf(
"Content Integrity Check in token succeeded\n");
1016 printf(
"Content Integrity Check in token error (%d): %s\n",
1023 buffer,
sizeof buffer, &length);
1025 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
1028 fprintf(stderr,
"Message Token Content Integrity Check DER not available\n");
1031 "Message Token Content Integrity Check DER available (%u bytes)\n",
1042 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
1045 fprintf(stderr,
"Message Token proof of delivery status not available\n");
1048 "Message Token proof of delivery status %d \n", param);
1054 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
1057 fprintf(stderr,
"Message Token security label status not available\n");
1060 "Message Token security label status %d \n", param);
1066 fprintf(stderr,
"Error from RecipGetStrParam: %s (%d)\n",
1069 fprintf(stderr,
"Message Token recip status not available\n");
1072 "Message Token recip status %d \n", param);
1080 static int get_sec_label(
1081 struct X400msMessage *mp
1084 unsigned char slab_buffer[XML_BUFSIZE];
1094 printf(
"No security label\n");
1096 fprintf(stderr,
"Failed to fetch security label: %d",status);
1099 fprintf(stderr,
"Security Label from envelope is:\n");
1100 print_sec_label(slab_buffer, length);
1105 static void print_sec_label(
1106 unsigned char slab_buffer[],
1111 char xml_buffer[XML_BUFSIZE];
1114 status = SecLabelInit(
"Example program");
1115 if (status != SECLABEL_E_NOERROR) {
1116 fprintf(stderr,
"SecLabelInit returned error %d\n", status);
1120 status = SecLabelPrint(slab_buffer,
1125 if (status != SECLABEL_E_NOERROR) {
1126 fprintf(stderr,
"SecLabelParse returned error %d\n", status);
1131 printf(
"Got security label:%s\n", xml_buffer);
1136 struct X400Recipient *rp
1139 char buffer[BUFSIZ];
1140 int status, cic_status;
1148 printf(
"No Content Integrity Check in recipient\n");
1151 printf(
"Error from RecipGetIntParam: %s\n",
X400msError(cic_status));
1158 printf(
"Content Integrity Check succeeded\n");
1161 printf(
"Content Integrity Check error (%d): %s\n",
1168 buffer,
sizeof buffer, &length);
1170 fprintf(stderr,
"Error getting recipient cic: %s\n",
1173 printf(
"Content Integrity Check found in recipient (%d)\n",
1185 static int get_4406_info(
1186 struct X400msMessage *mp
1192 char buffer[BUFSIZ];
1197 printf(
"4406 Status (X400_N_S4406_STATUS) absent so not PCT: %s\n",
X400msError(status));
1201 fprintf(stderr,
"Error from MsgGetIntParam (X400_N_S4406_STATUS): %s\n",
1204 printf(
"4406 Status(X400_N_S4406_STATUS): %d\n", intparam);
1214 fprintf(stderr,
"Error from MsgGetIntParam (X400_N_S4406): %s\n",
1217 printf(
"4406 (X400_N_S4406): %d\n", intparam);
1222 buffer,
sizeof buffer, &length);
1224 fprintf(stderr,
"Error from MsgGetStrParam (X400_S_S4406_STATUS_DETAIL): %s\n",
1228 printf(
"S4406 Status Detail (X400_S_S4406_STATUS_DETAIL): %.*s\n", (
int)length, buffer);
1230 show_message_certificate (mp,
"S4406");
1236 static void show_message_certificate (
1237 struct X400msMessage *mp,
1238 const char *tag ARGNOTUSED)
1241 struct X400Certificate *cert;
1245 fprintf (stderr,
"Error getting S4406 certificate: %s\n",
1249 show_certificate(cert,
"X400_N_S4406_CERTIFICATE");
1253 static void show_recip_certificate (
1254 struct X400Recipient *rp,
1259 struct X400Certificate *cert;
1263 fprintf (stderr,
"Error getting %s certificate: %s\n",
1267 show_certificate(cert, tag);
1271 static void show_certificate (
1272 struct X400Certificate *cert,
1276 char buffer[BUFSIZ];
1282 buffer,
sizeof buffer, &length);
1284 fprintf(stderr,
"Error getting subject of cert used for %s: %s\n",
1287 printf(
"Subject of Cert used to verify %s (%.*s)\n",
1288 tag, (
int)length, buffer);
1293 buffer,
sizeof buffer, &length);
1295 fprintf(stderr,
"Error getting issuer of cert used for %s: %s\n",
1298 printf(
"Issuer of Cert used to verify %s (%.*s)\n",
1299 tag, (
int)length, buffer);
1305 buffer,
sizeof buffer, &length);
1307 fprintf(stderr,
"Error getting serial num of cert used for %s: %s\n",
1310 printf(
"Serial Num of Cert used to verify %s (%.*s)\n",
1311 tag, (
int)length, buffer);
1316 buffer,
sizeof buffer, &length);
1318 fprintf(stderr,
"Error getting cert der used for %s: %s\n",
1322 "Returned Cert used to verify %s (%d)\n",
1328 buffer,
sizeof buffer, &length);
1331 fprintf(stderr,
"No ORaddress subject alt. name\n");
1333 fprintf(stderr,
"Error from CertGetStrParam: %s\n",
1338 fprintf(stderr,
"ORaddress subject alt name: '%.*s'\n",
1339 (
int)length, buffer);
1345 fprintf(stderr,
"Error from CertGetStrParam: %s\n",
1350 fprintf(stderr,
"ORaddress subject alt name status: %s\n",
1354 static void usage(
void) {
1355 printf(
"usage: %s\n", optstr);
1356 printf(
"\t where:\n");
1357 printf(
"\t -u : Don't prompt to override defaults \n");
1358 printf(
"\t -3 : Use P3 connection \n");
1359 printf(
"\t -7 : Use P7 connection \n");
1360 printf(
"\t -m : OR Address in P7 bind arg \n");
1361 printf(
"\t -d : DN in P7 bind arg \n");
1362 printf(
"\t -p : Presentation Address of P7 Store \n");
1363 printf(
"\t -w : P7 password of P7 user \n");
1364 printf(
"\t -M : OR Address in P3 bind arg \n");
1365 printf(
"\t -D : DN in P3 bind arg \n");
1366 printf(
"\t -P : Presentation Address of P3 server\n");
1367 printf(
"\t -W : P3 password of P3 user \n");
1368 printf(
"\t -e : Security Environment (dir with x509 subdir): obsolete, use -Y <p12file>\n");
1369 printf(
"\t -x : DN of X.509 Digital Identity\n");
1370 printf(
"\t -b : Passphrase for private key in PKCS12 file\n");
1371 printf(
"\t -E : Fetch messages until all read\n");
1372 printf(
"\t -Y : Filename of PKCS12 file containing Digital Identity\n");
1373 printf(
"\t -U : Directory containing trust anchors\n");
1374 printf(
"\t -I : Generate IPN from message received\n");
#define X400_S_LOG_CONFIGURATION_FILE
#define X400_S_CERT_ISSUER_DN
#define X400_S_MSGTOK_RECIP
int X400msMsgSend(struct X400msMessage *mp)
Send message object.
#define X400_N_S4406_CERTIFICATE
int X400RecipGetCert(struct X400Recipient *rp, int certtype, struct X400Certificate **certp)
Get certificate object from recipient This returns a certificate which was used to sign an object in ...
#define X400_N_MSGTOK_SEC_LAB_STATUS
#define X400_N_S4406_STATUS
#define X400_S_CONVERSION_EITS
int X400msOpen(int type, const char *oraddr, const char *dirname, const char *credentials, const char *pa, int *messages, struct X400msSession **spp)
Open a session to a Message Store (P7) or MTA (P3) in synchronous mode.
#define X400_S_AUTOFORWARD_COMMENT
#define X400_S_S4406_STATUS_DETAIL
int X400RecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.
#define X400_S_SEC_IDENTITY
#define X400_S_RECEIPT_TIME
int X400msSetStrDefault(struct X400msSession *sp, int paramtype, const char *value, size_t length)
Set a default string parameter value in a session.
#define X400_E_X509_CERT_INVALID
#define X400_N_MSGTOK_STATUS
int X400CertGetIntParam(struct X400Certificate *cp, int paramtype, int *valp)
Return a integer-valued parameter from the certificate object.
int X400msMsgGetCert(struct X400msMessage *mp, int certtype, struct X400Certificate **certp)
Get certificate object from message This returns a certificate which was used to sign an object in th...
#define X400_E_X509_VERIFY_FAIL_NO_CERT
#define X400_E_X509_VERIFY_FAIL_NO_PUBKEY
#define X400_N_MSGTOK_RECIP_STATUS
#define X400_N_RECIP_CIC_STATUS
#define X400_S_MSGTOK_CIC
#define X400_S_SECURITY_LABEL
#define X400_N_NON_RECEIPT_REASON
int X400msClose(struct X400msSession *sp)
Close a X400 Session.
int X400msRecipGetIntParam(struct X400Recipient *rp, int paramtype, int *valp)
Return a integer-valued parameter from the recipient object.
#define X400_S_MSGTOK_SEC_LAB
int X400msMsgGet(struct X400msSession *sp, int number, struct X400msMessage **mpp, int *typep, int *seqp)
Get message object for transfer out from MS or MTA via P3.
#define X400_S_MESSAGE_DELIVERY_TIME
#define X400_E_X509_ITEM_INVALID
#define X400_S_MSGTOK_DER
#define X400_N_CERT_MSGTOK_CIC
const char * X400msError(int error)
Obtain a string describing the meaning of the given error code.
#define X400_S_SUPP_RECEIPT_INFO
#define X400_S_SEC_IDENTITY_DN
int X400msMsgNew(struct X400msSession *sp, int type, struct X400msMessage **mpp)
Creates new message.
int X400msWait(struct X400msSession *sp, int seconds, int *count)
Wait for messages to be ready to be read.
#define X400_S_MESSAGE_IDENTIFIER
#define X400_S_SEC_IDENTITY_PASSPHRASE
#define X400_N_PROOF_OF_DEL_REQ
#define X400_S_SUBJECT_IDENTIFIER
int X400msRecipGet(struct X400msMessage *mp, int type, int number, struct X400Recipient **rpp)
Get recipient object from message.
int X400msRecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.
#define X400_S_EXTERNAL_CONTENT_TYPE
X400 MA/MS (P3/P7) Interface.
#define X400_E_X509_VERIFY_FAIL_UNSUPPORTED_ALG
#define X400_E_X509_VERIFY_FAIL
#define X400_N_CERT_ORADDRESS_STATUS
int X400msMsgGetIntParam(struct X400msMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
#define X400_N_CONTENT_LENGTH
#define X400_N_MSGTOK_SEQ_NUM
#define X400_RECIP_PRIMARY
#define X400_E_X509_VERIFY_FAIL_INCOMPAT_ALG
#define X400_S_CERT_SERIAL_NUM
int X400msSetIntDefault(struct X400msSession *sp, int paramtype, int value)
Set a default integer parameter value in a session.
#define X400_N_NON_DELIVERY_DIAGNOSTIC
#define X400_N_NON_DELIVERY_REASON
#define X400_B_RETURN_VERIFICATION_ERRORS
#define X400_N_CERT_MSGTOK
#define X400_S_CERT_SUBJECT_DN
int X400msMsgGetStrParam(struct X400msMessage *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the message object.
#define X400_S_SUBJECT_IPM
#define X400_S_SUPPLEMENTARY_INFO
int X400CertGetStrParam(struct X400Certificate *cp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the certificate object.
int X400msMakeIPN(struct X400msMessage *mp, int non_receipt_reason, struct X400msMessage **mpp)
Make an IPN based on the subject IPM.
#define X400_S_SEC_TRUSTED_CERTS_DIR
#define X400_N_PRECEDENCE
#define X400_N_MSGTOK_PODR_STATUS
#define X400_N_DISCARD_REASON
#define X400_N_CERT_RECIP_CIC
#define X400_N_CONTENT_TYPE
#define X400_S_OR_ADDRESS
int X400msMsgDelete(struct X400msMessage *mp, int retain)
Delete message object.
#define X400_RECIP_REPORT
#define X400_N_MSGTOK_CIC_STATUS
#define X400_RECIP_ENVELOPE