diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-03-26 20:03:33 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-03-26 20:03:33 +0000 |
commit | 79d52c2ac5463549c8e519962661ef6b18a1029c (patch) | |
tree | adf12f3b853804a665c3c5f55d82d113da06b759 | |
parent | d3d00b7d0e047a39f9ed466088f619aa4d183d2b (diff) | |
download | gnutls-79d52c2ac5463549c8e519962661ef6b18a1029c.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | doc/tex/ex3.tex | 17 |
2 files changed, 36 insertions, 0 deletions
@@ -1,3 +1,22 @@ +2002-03-26 19:50 nmav <nmav@gnutls.org> + + * ChangeLog, lib/gnutls_x509.c, src/common.c: + + changed semantics of gnutls_x509_extract_certificate_pk_algorithm() + +2002-03-26 19:33 nmav <nmav@gnutls.org> + + * lib/: gnutls_algorithms.c, gnutls_algorithms.h, gnutls_buffers.c, + gnutls_global.c, gnutls_record.c: + + Several optimizations + +2002-03-26 17:35 twoaday <twoaday@gnutls.org> + + * lib/gnutls_openpgp.c: + + Now the pk algorithm is returned and not only the key size in bits. + 2002-03-26 09:51 twoaday <twoaday@gnutls.org> * lib/: gnutls_openpgp.c, gnutls_openpgp.h: diff --git a/doc/tex/ex3.tex b/doc/tex/ex3.tex index 3add3dd0c3..4fa7ea4c09 100644 --- a/doc/tex/ex3.tex +++ b/doc/tex/ex3.tex @@ -79,6 +79,7 @@ int print_info(GNUTLS_STATE state) int serial_size = sizeof(serial); char printable[120]; char *print; + int algo, bits; printf(" - Certificate info:\n"); @@ -104,6 +105,21 @@ int print_info(GNUTLS_STATE state) printf(" - Certificate serial number: %s\n", printable); } + /* Extract some of the public key algorithm's parameters + */ + algo = gnutls_x509_extract_certificate_pk_algorithm( &cert_list[0], &bits); + printf("Certificate public key: "); + + 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"); + } + /* Print the version of the X.509 * certificate. */ @@ -115,6 +131,7 @@ int print_info(GNUTLS_STATE state) gnutls_x509_extract_certificate_issuer_dn(&cert_list[0], &dn); printf(" - Certificate Issuer's info:\n"); PRINT_DN(dn); + } } |