summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-03-26 20:11:02 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-03-26 20:11:02 +0000
commit0be55a2e2485e2e8f01594f59f72e9834fe258bd (patch)
tree400eb074eef80802a47a976002c616746eb45027 /src
parent79d52c2ac5463549c8e519962661ef6b18a1029c (diff)
downloadgnutls-0be55a2e2485e2e8f01594f59f72e9834fe258bd.tar.gz
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/common.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/common.c b/src/common.c
index bbf7533b2f..e14ddd41ee 100644
--- a/src/common.c
+++ b/src/common.c
@@ -66,7 +66,7 @@ void print_x509_info(GNUTLS_STATE state)
gnutls_x509_extract_certificate_version(&cert_list[0]));
algo = gnutls_x509_extract_certificate_pk_algorithm( &cert_list[0], &bits);
- printf(" # Certificate public key: ");
+ printf(" # Certificate public key algorithm: ");
if (algo==GNUTLS_PK_RSA) {
printf("RSA\n");
@@ -100,7 +100,9 @@ void print_openpgp_info(GNUTLS_STATE state)
cert_list = gnutls_certificate_get_peers(state, &cert_list_size);
- if (cert_list_size > 0)
+ if (cert_list_size > 0) {
+ int algo, bits;
+
if (gnutls_openpgp_fingerprint
(&cert_list[0], digest, &digest_size) >= 0) {
print = printable;
@@ -113,6 +115,20 @@ void print_openpgp_info(GNUTLS_STATE state)
printf(" # PGP Key version: %d\n",
gnutls_openpgp_extract_key_version(&cert_list[0]));
+ algo = gnutls_x509_extract_certificate_pk_algorithm( &cert_list[0], &bits);
+
+ printf(" # PGP Key public key algorithm: ");
+
+ if (algo==GNUTLS_PK_RSA) {
+ printf("RSA\n");
+ printf(" # Modulus: %d bits\n", bits);
+ } else if (algo==GNUTLS_PK_DSA) {
+ printf("DSA\n");
+ printf(" # Exponent: %d bits\n", bits);
+ } else {
+ printf("UNKNOWN\n");
+ }
+
printf(" # PGP Key fingerprint: %s\n",
printable);
@@ -122,7 +138,7 @@ void print_openpgp_info(GNUTLS_STATE state)
}
-
+ }
}
void print_cert_vrfy(GNUTLS_STATE state)