aboutsummaryrefslogtreecommitdiffstats
path: root/smime
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2003-10-31 04:28:32 +0800
committerChris Toshok <toshok@src.gnome.org>2003-10-31 04:28:32 +0800
commite432971d030baa8bdadf9df859b3198122792a21 (patch)
tree16579d316fdcf031f977610a7fe5c866d236bcf7 /smime
parent973ca5ea3d5d3b28cbf16865336c344864f652d8 (diff)
downloadgsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar
gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.gz
gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.bz2
gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.lz
gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.xz
gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.zst
gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.zip
initial checkin
svn path=/trunk/; revision=23137
Diffstat (limited to 'smime')
-rw-r--r--smime/tests/.cvsignore3
-rw-r--r--smime/tests/Makefile.am13
-rw-r--r--smime/tests/import-cert.c35
3 files changed, 51 insertions, 0 deletions
diff --git a/smime/tests/.cvsignore b/smime/tests/.cvsignore
new file mode 100644
index 0000000000..db5ae49ffb
--- /dev/null
+++ b/smime/tests/.cvsignore
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+import-cert
diff --git a/smime/tests/Makefile.am b/smime/tests/Makefile.am
new file mode 100644
index 0000000000..1c5b02bae2
--- /dev/null
+++ b/smime/tests/Makefile.am
@@ -0,0 +1,13 @@
+
+noinst_PROGRAMS=import-cert
+
+INCLUDES= \
+ -I$(top_srcdir)/smime/lib \
+ $(SMIME_CFLAGS)
+
+TEST_LIBS= \
+ $(top_builddir)/smime/lib/libessmime.la \
+ $(SMIME_LIBS)
+
+
+import_cert_LDADD=$(TEST_LIBS) \ No newline at end of file
diff --git a/smime/tests/import-cert.c b/smime/tests/import-cert.c
new file mode 100644
index 0000000000..63eb5a63f3
--- /dev/null
+++ b/smime/tests/import-cert.c
@@ -0,0 +1,35 @@
+
+#include "e-cert-db.h"
+
+int
+main (int argc, char **argv)
+{
+ ECertDB *db;
+
+ g_type_init ();
+
+ if (SECSuccess != NSS_InitReadWrite ("/home/toshok/.mozilla/default/xuvq7jx3.slt")) {
+ g_error ("NSS_InitReadWrite failed");
+ }
+
+ STAN_LoadDefaultNSS3TrustDomain();
+
+ db = e_cert_db_peek ();
+
+ printf ("default_trust_domain = %p\n", STAN_GetDefaultTrustDomain());
+ printf ("default_crypto_context = %p\n", STAN_GetDefaultCryptoContext());
+
+ if (!e_cert_db_import_certs_from_file (db, "ca.crt", E_CERT_CA, NULL /* XXX */)) {
+ g_warning ("CA cert import failed");
+ }
+
+ if (!e_cert_db_import_certs_from_file (db, "", E_CERT_CONTACT, NULL /* XXX */)) {
+ g_warning ("contact cert import failed");
+ }
+
+ if (!e_cert_db_import_certs_from_file (db, "", E_CERT_SITE, NULL /* XXX */)) {
+ g_warning ("server cert import failed");
+ }
+
+ e_cert_db_shutdown ();
+}