diff libpurple/certificate.h @ 18942:02102eccc4be

- purple_certificate_verify now takes a Verifier argument, creates its own VerificationRequest, amd may callback immediately
author William Ehlhardt <williamehlhardt@gmail.com>
date Sat, 23 Jun 2007 00:04:49 +0000
parents 425f494bd1ec
children fa42d8fa7873
line wrap: on
line diff
--- a/libpurple/certificate.h	Fri Jun 22 23:30:26 2007 +0000
+++ b/libpurple/certificate.h	Sat Jun 23 00:04:49 2007 +0000
@@ -204,6 +204,7 @@
 	 *
 	 * This is looked up from the Verifier when the Request is generated
 	 */
+	PurpleCertificateScheme *scheme;
 
 	/**
 	 * Name to check that the certificate is issued to
@@ -228,6 +229,34 @@
 	gpointer cb_data;
 };
 
+/**
+ * Constructs a verification request and passed control to the specified Verifier
+ *
+ * It is possible that the callback will be called immediately upon calling
+ * this function. Plan accordingly.
+ *
+ * @param verifier      Verification logic to use.
+ *                      @see purple_certificate_find_verifier()
+ *
+ * @param subject_name  Name that should match the first certificate in the
+ *                      chain for the certificate to be valid. Will be strdup'd
+ *                      into the Request struct
+ *
+ * @param cert_chain    Certificate chain to check. If there is more than one
+ *                      certificate in the chain (X.509), the peer's
+ *                      certificate comes first, then the issuer/signer's
+ *                      certificate, etc.
+ *
+ * @param cb            Callback function to be called with whether the
+ *                      certificate was approved or not.
+ * @param cb_data       User-defined data for the above.
+ */
+void
+purple_certificate_verify (PurpleCertificateVerifier *verifier,
+			   const gchar *subject_name, GList *cert_chain,
+			   PurpleCertificateVerifiedCallback cb,
+			   gpointer cb_data);
+
 /*****************************************************************************/
 /** @name PurpleCertificate Subsystem API                                    */
 /*****************************************************************************/