diff options
author | Chris Toshok <toshok@src.gnome.org> | 2003-10-31 04:28:32 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-10-31 04:28:32 +0800 |
commit | e432971d030baa8bdadf9df859b3198122792a21 (patch) | |
tree | 16579d316fdcf031f977610a7fe5c866d236bcf7 /smime/tests/import-cert.c | |
parent | 973ca5ea3d5d3b28cbf16865336c344864f652d8 (diff) | |
download | gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.gz gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.tar.zst gsoc2013-evolution-e432971d030baa8bdadf9df859b3198122792a21.zip |
initial checkin
svn path=/trunk/; revision=23137
Diffstat (limited to 'smime/tests/import-cert.c')
-rw-r--r-- | smime/tests/import-cert.c | 35 |
1 files changed, 35 insertions, 0 deletions
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 (); +} |