[gmime] Parse the pubkey algo used by each signer



commit 18a23d0f0028fdce061c7c94f18b3beaf6ec637c
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Wed Nov 24 15:07:43 2010 -0500

    Parse the pubkey algo used by each signer
    
    2010-11-24  Jeffrey Stedfast  <fejj novell com>
    
    	Fixes bug #635661.
    
    	* gmime/gmime-crypto-context.c (g_mime_signer_new): Initialize
    	pubkey_algo and hash_algo.
    	(g_mime_signer_[g,s]et_pubkey_algo): Implemented.
    	(g_mime_signer_[g,s]et_hash_algo): Renamed from [g,s]_hash().
    
    	* gmime/gmime-crypto-context.h (GMimeCryptoPubKeyAlgo): Defined
    	enum.
    
    	* gmime/gmime-pkcs7-context.c (pkcs7_get_validity): Record the
    	hash and pubkey algorithms used in the GMimeSigner.
    
    	* gmime/gmime-gpg-context.c (gpg_ctx_parse_signer_info): Record
    	the pubkey algorithm used by the signer.

 ChangeLog                         |   18 +++++++++++
 docs/reference/gmime-sections.txt |    6 ++-
 gmime/gmime-crypto-context.c      |   47 +++++++++++++++++++++++++----
 gmime/gmime-crypto-context.h      |   43 ++++++++++++++++++++++----
 gmime/gmime-gpg-context.c         |   60 +++++++++++++++++++++++++++++-------
 gmime/gmime-pkcs7-context.c       |   43 +++++++++++++++++++++++++-
 mono/gmime-api.raw                |   26 ++++++++++++++--
 7 files changed, 212 insertions(+), 31 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2e3cfdd..56e626f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-24  Jeffrey Stedfast  <fejj novell com>
+
+	Fixes bug #635661.
+
+	* gmime/gmime-crypto-context.c (g_mime_signer_new): Initialize
+	pubkey_algo and hash_algo.
+	(g_mime_signer_[g,s]et_pubkey_algo): Implemented.
+	(g_mime_signer_[g,s]et_hash_algo): Renamed from [g,s]_hash().
+
+	* gmime/gmime-crypto-context.h (GMimeCryptoPubKeyAlgo): Defined
+	enum.
+
+	* gmime/gmime-pkcs7-context.c (pkcs7_get_validity): Record the
+	hash and pubkey algorithms used in the GMimeSigner.
+
+	* gmime/gmime-gpg-context.c (gpg_ctx_parse_signer_info): Record
+	the pubkey algorithm used by the signer.
+
 2010-11-22  Jeffrey Stedfast  <fejj novell com>
 
 	* gmime/gmime-multipart-encrypted.c (g_mime_multipart_encrypted_encrypt):
diff --git a/docs/reference/gmime-sections.txt b/docs/reference/gmime-sections.txt
index 59c5567..b0588ef 100644
--- a/docs/reference/gmime-sections.txt
+++ b/docs/reference/gmime-sections.txt
@@ -1165,8 +1165,10 @@ g_mime_signer_get_errors
 g_mime_signer_set_errors
 g_mime_signer_get_trust
 g_mime_signer_set_trust
-g_mime_signer_get_hash
-g_mime_signer_set_hash
+g_mime_signer_get_hash_algo
+g_mime_signer_set_hash_algo
+g_mime_signer_get_pubkey_algo
+g_mime_signer_set_pubkey_algo
 g_mime_signer_get_issuer_serial
 g_mime_signer_set_issuer_serial
 g_mime_signer_get_issuer_name
diff --git a/gmime/gmime-crypto-context.c b/gmime/gmime-crypto-context.c
index a2ff831..79eef32 100644
--- a/gmime/gmime-crypto-context.c
+++ b/gmime/gmime-crypto-context.c
@@ -455,6 +455,8 @@ g_mime_signer_new (void)
 	GMimeSigner *signer;
 	
 	signer = g_slice_new (GMimeSigner);
+	signer->pubkey_algo = GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT;
+	signer->hash_algo = GMIME_CRYPTO_HASH_DEFAULT;
 	signer->status = GMIME_SIGNER_STATUS_NONE;
 	signer->errors = GMIME_SIGNER_ERROR_NONE;
 	signer->trust = GMIME_SIGNER_TRUST_NONE;
@@ -611,23 +613,56 @@ g_mime_signer_get_trust (const GMimeSigner *signer)
 
 
 /**
- * g_mime_signer_set_hash:
+ * g_mime_signer_set_pubkey_algo:
+ * @signer: a #GMimeSigner
+ * @pubkey_algo: a #GMimeCryptoPubKeyAlgo
+ *
+ * Set the public-key algorithm used by the signer.
+ **/
+void
+g_mime_signer_set_pubkey_algo (GMimeSigner *signer, GMimeCryptoPubKeyAlgo pubkey_algo)
+{
+	g_return_if_fail (signer != NULL);
+	
+	signer->pubkey_algo = pubkey_algo;
+}
+
+
+/**
+ * g_mime_signer_get_pubkey_algo:
+ * @signer: a #GMimeSigner
+ *
+ * Get the public-key algorithm used by the signer.
+ *
+ * Returns: the public-key algorithm used by the signer.
+ **/
+GMimeCryptoPubKeyAlgo
+g_mime_signer_get_pubkey_algo (const GMimeSigner *signer)
+{
+	g_return_val_if_fail (signer != NULL, GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT);
+	
+	return signer->pubkey_algo;
+}
+
+
+/**
+ * g_mime_signer_set_hash_algo:
  * @signer: a #GMimeSigner
  * @hash: a #GMimeCryptoHash
  *
  * Set the hash algorithm used by the signer.
  **/
 void
-g_mime_signer_set_hash (GMimeSigner *signer, GMimeCryptoHash hash)
+g_mime_signer_set_hash_algo (GMimeSigner *signer, GMimeCryptoHash hash)
 {
 	g_return_if_fail (signer != NULL);
 	
-	signer->hash = hash;
+	signer->hash_algo = hash;
 }
 
 
 /**
- * g_mime_signer_get_hash:
+ * g_mime_signer_get_hash_algo:
  * @signer: a #GMimeSigner
  *
  * Get the hash algorithm used by the signer.
@@ -635,11 +670,11 @@ g_mime_signer_set_hash (GMimeSigner *signer, GMimeCryptoHash hash)
  * Returns: the hash algorithm used by the signer.
  **/
 GMimeCryptoHash
-g_mime_signer_get_hash (const GMimeSigner *signer)
+g_mime_signer_get_hash_algo (const GMimeSigner *signer)
 {
 	g_return_val_if_fail (signer != NULL, GMIME_CRYPTO_HASH_DEFAULT);
 	
-	return signer->hash;
+	return signer->hash_algo;
 }
 
 
diff --git a/gmime/gmime-crypto-context.h b/gmime/gmime-crypto-context.h
index ef2ff7a..26d49b7 100644
--- a/gmime/gmime-crypto-context.h
+++ b/gmime/gmime-crypto-context.h
@@ -63,6 +63,30 @@ typedef gboolean (* GMimePasswordRequestFunc) (GMimeCryptoContext *ctx, const ch
 					       gboolean reprompt, GMimeStream *response, GError **err);
 
 
+
+/**
+ * GMimeCryptoPubKeyAlgo:
+ * @GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT: The default public-key algorithm.
+ * @GMIME_CRYPTO_PUBKEY_ALGO_RSA: The RSA algorithm.
+ * @GMIME_CRYPTO_PUBKEY_ALGO_RSA_E: An encryption-only RSA algorithm.
+ * @GMIME_CRYPTO_PUBKEY_ALGO_RSA_S: A signature-only RSA algorithm.
+ * @GMIME_CRYPTO_PUBKEY_ALGO_ELG: The ElGamal algorithm.
+ * @GMIME_CRYPTO_PUBKEY_ALGO_ELG_E: An encryption-only ElGamal algorithm.
+ * @GMIME_CRYPTO_PUBKEY_ALGO_DSA: The DSA algorithm.
+ *
+ * A public-key algorithm.
+ **/
+typedef enum {
+	GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT,
+	GMIME_CRYPTO_PUBKEY_ALGO_RSA,
+	GMIME_CRYPTO_PUBKEY_ALGO_RSA_E,
+	GMIME_CRYPTO_PUBKEY_ALGO_RSA_S,
+	GMIME_CRYPTO_PUBKEY_ALGO_ELG,
+	GMIME_CRYPTO_PUBKEY_ALGO_ELG_E,
+	GMIME_CRYPTO_PUBKEY_ALGO_DSA
+} GMimeCryptoPubKeyAlgo;
+
+
 /**
  * GMimeCryptoHash:
  * @GMIME_CRYPTO_HASH_DEFAULT: The default hash algorithm.
@@ -75,7 +99,8 @@ typedef gboolean (* GMimePasswordRequestFunc) (GMimeCryptoContext *ctx, const ch
  * @GMIME_CRYPTO_HASH_SHA512: The SHA-512 hash algorithm.
  * @GMIME_CRYPTO_HASH_RIPEMD160: The RIPEMD-160 hash algorithm.
  * @GMIME_CRYPTO_HASH_TIGER192: The TIGER-192 hash algorithm.
- * @GMIME_CRYPTO_HASH_HAVAL5160: The HAVAL5-160 hash algorithm.
+ * @GMIME_CRYPTO_HASH_HAVAL5160: The HAVAL-5-160 hash algorithm.
+ * @GMIME_CRYPTO_HASH_MD4: The MD4 hash algorithm.
  *
  * A hash algorithm.
  **/
@@ -90,7 +115,8 @@ typedef enum {
 	GMIME_CRYPTO_HASH_SHA512,
 	GMIME_CRYPTO_HASH_RIPEMD160,
 	GMIME_CRYPTO_HASH_TIGER192,
-	GMIME_CRYPTO_HASH_HAVAL5160
+	GMIME_CRYPTO_HASH_HAVAL5160,
+	GMIME_CRYPTO_HASH_MD4
 } GMimeCryptoHash;
 
 
@@ -247,7 +273,8 @@ typedef enum {
  * @errors: A bitfield of #GMimeSignerError values.
  * @trust: A #GMimeSignerTrust.
  * @unused: Unused expansion bits for future use; ignore this.
- * @hash: The hash algorithm used by the signer, if known.
+ * @pubkey_algo: The public-key algorithm used by the signer, if known.
+ * @hash_algo: The hash algorithm used by the signer, if known.
  * @issuer_serial: The issuer of the certificate, if known.
  * @issuer_name: The issuer of the certificate, if known.
  * @fingerprint: A hex string representing the signer's fingerprint.
@@ -267,7 +294,8 @@ struct _GMimeSigner {
 	unsigned int errors:4;    /* bitfield of GMimeSignerError's */
 	unsigned int trust:3;     /* GMimeSignerTrust */
 	unsigned int unused:21;   /* unused expansion bits */
-	GMimeCryptoHash hash;
+	GMimeCryptoPubKeyAlgo pubkey_algo;
+	GMimeCryptoHash hash_algo;
 	char *issuer_serial;
 	char *issuer_name;
 	char *fingerprint;
@@ -295,8 +323,11 @@ GMimeSignerError g_mime_signer_get_errors (const GMimeSigner *signer);
 void g_mime_signer_set_trust (GMimeSigner *signer, GMimeSignerTrust trust);
 GMimeSignerTrust g_mime_signer_get_trust (const GMimeSigner *signer);
 
-void g_mime_signer_set_hash (GMimeSigner *signer, GMimeCryptoHash hash);
-GMimeCryptoHash g_mime_signer_get_hash (const GMimeSigner *signer);
+void g_mime_signer_set_pubkey_algo (GMimeSigner *signer, GMimeCryptoPubKeyAlgo pubkey_algo);
+GMimeCryptoPubKeyAlgo g_mime_signer_get_pubkey_algo (const GMimeSigner *signer);
+
+void g_mime_signer_set_hash_algo (GMimeSigner *signer, GMimeCryptoHash hash);
+GMimeCryptoHash g_mime_signer_get_hash_algo (const GMimeSigner *signer);
 
 void g_mime_signer_set_issuer_serial (GMimeSigner *signer, const char *issuer_serial);
 const char *g_mime_signer_get_issuer_serial (const GMimeSigner *signer);
diff --git a/gmime/gmime-gpg-context.c b/gmime/gmime-gpg-context.c
index e88b7c2..e010ec5 100644
--- a/gmime/gmime-gpg-context.c
+++ b/gmime/gmime-gpg-context.c
@@ -183,6 +183,8 @@ gpg_hash_id (GMimeCryptoContext *ctx, const char *hash)
 	
 	if (!g_ascii_strcasecmp (hash, "md2"))
 		return GMIME_CRYPTO_HASH_MD2;
+	else if (!g_ascii_strcasecmp (hash, "md4"))
+		return GMIME_CRYPTO_HASH_MD4;
 	else if (!g_ascii_strcasecmp (hash, "md5"))
 		return GMIME_CRYPTO_HASH_MD5;
 	else if (!g_ascii_strcasecmp (hash, "sha1"))
@@ -211,6 +213,8 @@ gpg_hash_name (GMimeCryptoContext *ctx, GMimeCryptoHash hash)
 	switch (hash) {
 	case GMIME_CRYPTO_HASH_MD2:
 		return "pgp-md2";
+	case GMIME_CRYPTO_HASH_MD4:
+		return "pgp-md4";
 	case GMIME_CRYPTO_HASH_MD5:
 		return "pgp-md5";
 	case GMIME_CRYPTO_HASH_SHA1:
@@ -541,25 +545,42 @@ gpg_hash_str (GMimeCryptoHash hash)
 		return "--digest-algo=RIPEMD160";
 	case GMIME_CRYPTO_HASH_TIGER192:
 		return "--digest-algo=TIGER192";
+	case GMIME_CRYPTO_HASH_MD4:
+		return "--digest-algo=MD4";
 	default:
 		return NULL;
 	}
 }
 
+static GMimeCryptoPubKeyAlgo
+gpg_pubkey_algo (unsigned long id)
+{
+	switch (id) {
+	case 1: return GMIME_CRYPTO_PUBKEY_ALGO_RSA;
+	case 2: return GMIME_CRYPTO_PUBKEY_ALGO_RSA_E;
+	case 3: return GMIME_CRYPTO_PUBKEY_ALGO_RSA_S;
+	case 16: return GMIME_CRYPTO_PUBKEY_ALGO_ELG_E;
+	case 17: return GMIME_CRYPTO_PUBKEY_ALGO_DSA;
+	case 20: return GMIME_CRYPTO_PUBKEY_ALGO_ELG;
+	default: return GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT;
+	}
+}
+
 static GMimeCryptoHash
-gpg_hash_from_id (unsigned long id)
+gpg_hash_algo (unsigned long id)
 {
 	switch (id) {
 	case 1: return GMIME_CRYPTO_HASH_MD5;
 	case 2: return GMIME_CRYPTO_HASH_SHA1;
 	case 3:	return GMIME_CRYPTO_HASH_RIPEMD160;
-	case 5: return GMIME_CRYPTO_HASH_MD2; /* ? */
-	case 6: return GMIME_CRYPTO_HASH_TIGER192; /* ? */
-	case 7: return GMIME_CRYPTO_HASH_HAVAL5160; /* ? */
+	case 5: return GMIME_CRYPTO_HASH_MD2;
+	case 6: return GMIME_CRYPTO_HASH_TIGER192;
+	case 7: return GMIME_CRYPTO_HASH_HAVAL5160;
 	case 8: return GMIME_CRYPTO_HASH_SHA256;
 	case 9: return GMIME_CRYPTO_HASH_SHA384;
 	case 10: return GMIME_CRYPTO_HASH_SHA512;
 	case 11: return GMIME_CRYPTO_HASH_SHA224;
+	case 301: return GMIME_CRYPTO_HASH_MD4;
 	default: return GMIME_CRYPTO_HASH_DEFAULT;
 	}
 }
@@ -906,31 +927,46 @@ gpg_ctx_parse_signer_info (struct _GpgCtx *gpg, char *status)
 		
 		/* the third token is the signature creation date (or 0 for unknown?) */
 		signer->sig_created = strtoul (status, &inend, 10);
-		if (inend == status || *inend != ' ')
+		if (inend == status || *inend != ' ') {
+			signer->sig_created = 0;
 			return;
+		}
 		
 		status = inend + 1;
 		
 		/* the fourth token is the signature expiration date (or 0 for never) */
 		signer->sig_expires = strtoul (status, &inend, 10);
-		if (inend == status || *inend != ' ')
+		if (inend == status || *inend != ' ') {
+			signer->sig_expires = 0;
 			return;
+		}
 		
 		status = inend + 1;
 		
-		/* the fifth token is an unknown numeric value */
+		/* the fifth token is the signature version */
 		status = next_token (status, NULL);
 		
-		/* the sixth token is an unknown numeric value */
+		/* the sixth token is a reserved numeric value (ignore for now) */
 		status = next_token (status, NULL);
 		
 		/* the seventh token is the public-key algorithm id */
-		status = next_token (status, NULL);
+		signer->pubkey_algo = gpg_pubkey_algo (strtoul (status, &inend, 10));
+		if (inend == status || *inend != ' ')
+			return;
+		
+		status = inend + 1;
 		
 		/* the eighth token is the hash algorithm id */
-		signer->hash = gpg_hash_from_id (strtoul (status, NULL, 10));
+		signer->hash_algo = gpg_hash_algo (strtoul (status, &inend, 10));
+		if (inend == status || *inend != ' ')
+			return;
+		
+		status = inend + 1;
+		
+		/* the nineth token is the signature class */
+		status = next_token (status, NULL);
 		
-		/* ignore the rest... */
+		/* the rest is the primary key fingerprint */
 	} else if (!strncmp (status, "TRUST_", 6)) {
 		status += 6;
 		
@@ -1163,7 +1199,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, GError **err)
 			status = next_token (status, NULL);
 			
 			/* this token is the hash algorithm used */
-			gpg->hash = gpg_hash_from_id (strtoul (status, NULL, 10));
+			gpg->hash = gpg_hash_algo (strtoul (status, NULL, 10));
 			break;
 		case GPG_CTX_MODE_VERIFY:
 			gpg_ctx_parse_signer_info (gpg, status);
diff --git a/gmime/gmime-pkcs7-context.c b/gmime/gmime-pkcs7-context.c
index cec8c94..249f295 100644
--- a/gmime/gmime-pkcs7-context.c
+++ b/gmime/gmime-pkcs7-context.c
@@ -185,6 +185,8 @@ pkcs7_hash_id (GMimeCryptoContext *ctx, const char *hash)
 	
 	if (!g_ascii_strcasecmp (hash, "md2"))
 		return GMIME_CRYPTO_HASH_MD2;
+	else if (!g_ascii_strcasecmp (hash, "md4"))
+		return GMIME_CRYPTO_HASH_MD4;
 	else if (!g_ascii_strcasecmp (hash, "md5"))
 		return GMIME_CRYPTO_HASH_MD5;
 	else if (!g_ascii_strcasecmp (hash, "sha1"))
@@ -213,6 +215,8 @@ pkcs7_hash_name (GMimeCryptoContext *ctx, GMimeCryptoHash hash)
 	switch (hash) {
 	case GMIME_CRYPTO_HASH_MD2:
 		return "md2";
+	case GMIME_CRYPTO_HASH_MD4:
+		return "md4";
 	case GMIME_CRYPTO_HASH_MD5:
 		return "md5";
 	case GMIME_CRYPTO_HASH_SHA1:
@@ -463,6 +467,39 @@ pkcs7_trust (gpgme_validity_t trust)
 	}
 }
 
+static GMimeCryptoPubKeyAlgo
+pkcs7_pubkey_algo (id)
+{
+	switch (id) {
+	case GPGME_PK_RSA: return GMIME_CRYPTO_PUBKEY_ALGO_RSA;
+	case GPGME_PK_RSA_E: return GMIME_CRYPTO_PUBKEY_ALGO_RSA_E;
+	case GPGME_PK_RSA_S: return GMIME_CRYPTO_PUBKEY_ALGO_RSA_S;
+	case GPGME_PK_ELG_E: return GMIME_CRYPTO_PUBKEY_ALGO_ELG_E;
+	case GPGME_PK_DSA: return GMIME_CRYPTO_PUBKEY_ALGO_DSA;
+	case GPGME_PK_ELG: return GMIME_CRYPTO_PUBKEY_ALGO_ELG;
+	default: return GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT;
+	}
+}
+
+static GMimeCryptoHash
+pkcs7_hash_algo (gpgme_hash_algo_t id)
+{
+	switch (id) {
+	case GPGME_MD_NONE: return GMIME_CRYPTO_HASH_DEFAULT;
+	case GPGME_MD_MD5: return GMIME_CRYPTO_HASH_MD5;
+	case GPGME_MD_SHA1: return GMIME_CRYPTO_HASH_SHA1;
+	case GPGME_MD_RMD160: return GMIME_CRYPTO_HASH_RIPEMD160;
+	case GPGME_MD_MD2: return GMIME_CRYPTO_HASH_MD2;
+	case GPGME_MD_TIGER: return GMIME_CRYPTO_HASH_TIGER192;
+	case GPGME_MD_HAVAL: return GMIME_CRYPTO_HASH_HAVAL5160;
+	case GPGME_MD_SHA256: return GMIME_CRYPTO_HASH_SHA256;
+	case GPGME_MD_SHA384: return GMIME_CRYPTO_HASH_SHA384;
+	case GPGME_MD_SHA512: return GMIME_CRYPTO_HASH_SHA512;
+	case GPGME_MD_MD4: return GMIME_CRYPTO_HASH_MD4;
+	default: return GMIME_CRYPTO_HASH_DEFAULT;
+	}
+}
+
 static GMimeSignatureValidity *
 pkcs7_get_validity (Pkcs7Ctx *pkcs7, gboolean verify)
 {
@@ -496,13 +533,15 @@ pkcs7_get_validity (Pkcs7Ctx *pkcs7, gboolean verify)
 		signers->next = signer;
 		signers = signer;
 		
+		g_mime_signer_set_pubkey_algo (signer, pkcs7_pubkey_algo (sig->pubkey_algo));
+		g_mime_signer_set_hash_algo (signer, pkcs7_hash_algo (sig->hash_algo));
 		g_mime_signer_set_sig_expires (signer, sig->exp_timestamp);
 		g_mime_signer_set_sig_created (signer, sig->timestamp);
 		g_mime_signer_set_fingerprint (signer, sig->fpr);
 		
 		errors = GMIME_SIGNER_ERROR_NONE;
 		
-		if (sig->exp_timestamp != 0 && sig->exp_timestamp >= time (NULL))
+		if (sig->exp_timestamp != 0 && sig->exp_timestamp <= time (NULL))
 			errors |= GMIME_SIGNER_ERROR_EXPSIG;
 		
 		if (gpgme_get_key (pkcs7->ctx, sig->fpr, &key, 0) == GPG_ERR_NO_ERROR && key) {
@@ -511,7 +550,7 @@ pkcs7_get_validity (Pkcs7Ctx *pkcs7, gboolean verify)
 			g_mime_signer_set_issuer_serial (signer, key->issuer_serial);
 			g_mime_signer_set_issuer_name (signer, key->issuer_name);
 			
-			/* get the name and email address */
+			/* get the keyid, name, and email address */
 			uid = key->uids;
 			while (uid) {
 				if (uid->name && *uid->name)
diff --git a/mono/gmime-api.raw b/mono/gmime-api.raw
index 48ae0fb..9aa1051 100644
--- a/mono/gmime-api.raw
+++ b/mono/gmime-api.raw
@@ -28,6 +28,16 @@
       <member cname="GMIME_CRYPTO_HASH_RIPEMD160" name="Ripemd160" />
       <member cname="GMIME_CRYPTO_HASH_TIGER192" name="Tiger192" />
       <member cname="GMIME_CRYPTO_HASH_HAVAL5160" name="Haval5160" />
+      <member cname="GMIME_CRYPTO_HASH_MD4" name="Md4" />
+    </enum>
+    <enum name="CryptoPubKeyAlgo" cname="GMimeCryptoPubKeyAlgo" type="enum">
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_DEFAULT" name="Default" />
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_RSA" name="Rsa" />
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_RSA_E" name="RsaE" />
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_RSA_S" name="RsaS" />
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_ELG" name="Elg" />
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_ELG_E" name="ElgE" />
+      <member cname="GMIME_CRYPTO_PUBKEY_ALGO_DSA" name="Dsa" />
     </enum>
     <enum name="EncodingConstraint" cname="GMimeEncodingConstraint" type="enum">
       <member cname="GMIME_ENCODING_CONSTRAINT_7BIT" name="7Bit" />
@@ -2614,7 +2624,8 @@
       <field name="Errors" cname="errors" bits="4" type="unsigned int" access="public" writeable="true" />
       <field name="Trust" cname="trust" bits="3" type="unsigned int" access="public" writeable="true" />
       <field name="Unused" cname="unused" bits="21" type="unsigned int" access="public" writeable="true" />
-      <field name="Hash" cname="hash" type="GMimeCryptoHash" access="public" writeable="true" />
+      <field name="PubkeyAlgo" cname="pubkey_algo" type="GMimeCryptoPubKeyAlgo" access="public" writeable="true" />
+      <field name="HashAlgo" cname="hash_algo" type="GMimeCryptoHash" access="public" writeable="true" />
       <field name="IssuerSerial" cname="issuer_serial" type="char*" access="public" writeable="true" />
       <field name="IssuerName" cname="issuer_name" type="char*" access="public" writeable="true" />
       <field name="Fingerprint" cname="fingerprint" type="char*" access="public" writeable="true" />
@@ -2637,7 +2648,7 @@
       <method name="GetFingerprint" cname="g_mime_signer_get_fingerprint">
         <return-type type="const-char*" />
       </method>
-      <method name="GetHash" cname="g_mime_signer_get_hash">
+      <method name="GetHashAlgo" cname="g_mime_signer_get_hash_algo">
         <return-type type="GMimeCryptoHash" />
       </method>
       <method name="GetIssuerName" cname="g_mime_signer_get_issuer_name">
@@ -2658,6 +2669,9 @@
       <method name="GetName" cname="g_mime_signer_get_name">
         <return-type type="const-char*" />
       </method>
+      <method name="GetPubkeyAlgo" cname="g_mime_signer_get_pubkey_algo">
+        <return-type type="GMimeCryptoPubKeyAlgo" />
+      </method>
       <method name="GetSigCreated" cname="g_mime_signer_get_sig_created">
         <return-type type="time_t" />
       </method>
@@ -2692,7 +2706,7 @@
           <parameter type="const-char*" name="fingerprint" />
         </parameters>
       </method>
-      <method name="SetHash" cname="g_mime_signer_set_hash">
+      <method name="SetHashAlgo" cname="g_mime_signer_set_hash_algo">
         <return-type type="void" />
         <parameters>
           <parameter type="GMimeCryptoHash" name="hash" />
@@ -2734,6 +2748,12 @@
           <parameter type="const-char*" name="name" />
         </parameters>
       </method>
+      <method name="SetPubkeyAlgo" cname="g_mime_signer_set_pubkey_algo">
+        <return-type type="void" />
+        <parameters>
+          <parameter type="GMimeCryptoPubKeyAlgo" name="pubkey_algo" />
+        </parameters>
+      </method>
       <method name="SetSigCreated" cname="g_mime_signer_set_sig_created">
         <return-type type="void" />
         <parameters>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]