aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-02-16 20:05:02 +0000
committerWerner Koch <[email protected]>1998-02-16 20:05:02 +0000
commit82464369f664f821542c416d35d4013f9723f87a (patch)
treed127f2d891260ff1c6d4264630b2ba7bd463b1f4 /cipher/misc.c
parentadded option export (diff)
downloadgnupg-82464369f664f821542c416d35d4013f9723f87a.tar.gz
gnupg-82464369f664f821542c416d35d4013f9723f87a.zip
some import functionality
Diffstat (limited to '')
-rw-r--r--cipher/misc.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/cipher/misc.c b/cipher/misc.c
index 7c8f2e3c7..6dcd20245 100644
--- a/cipher/misc.c
+++ b/cipher/misc.c
@@ -75,6 +75,21 @@ string_to_cipher_algo( const char *string )
/****************
+ * Map a cipher algo to a string
+ */
+const char *
+cipher_algo_to_string( int algo )
+{
+ int i;
+
+ for(i=0; cipher_names[i].name; i++ )
+ if( cipher_names[i].algo == algo )
+ return cipher_names[i].name;
+ return NULL;
+}
+
+
+/****************
* Map a string to the pubkey algo
*/
int
@@ -89,6 +104,23 @@ string_to_pubkey_algo( const char *string )
return 0;
}
+
+/****************
+ * Map a pubkey algo to a string
+ */
+const char *
+pubkey_algo_to_string( int algo )
+{
+ int i;
+
+ for(i=0; pubkey_names[i].name; i++ )
+ if( pubkey_names[i].algo == algo )
+ return pubkey_names[i].name;
+ return NULL;
+}
+
+
+
/****************
* Map a string to the digest algo
*/
@@ -104,6 +136,24 @@ string_to_digest_algo( const char *string )
return 0;
}
+
+/****************
+ * Map a digest algo to a string
+ */
+const char *
+digest_algo_to_string( int algo )
+{
+ int i;
+
+ for(i=0; digest_names[i].name; i++ )
+ if( digest_names[i].algo == algo )
+ return digest_names[i].name;
+ return NULL;
+}
+
+
+
+
/****************
* Return 0 if the cipher algo is available
*/