[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: RSA sign/verify and hash generation functions
From: |
Murray S. Kucherawy |
Subject: |
RE: RSA sign/verify and hash generation functions |
Date: |
Thu, 16 Dec 2010 09:49:39 -0800 |
> -----Original Message-----
> From: Nikos Mavrogiannopoulos [mailto:address@hidden Of Behalf Of Nikos
> Mavrogiannopoulos
> Sent: Thursday, December 16, 2010 8:12 AM
> To: Murray S. Kucherawy
> Cc: address@hidden
> Subject: Re: RSA sign/verify and hash generation functions
>
> > One thing I need that this public key interface doesn't appear to
> > have is a way to get the key size from a public key. Could that be
> > added, or if it's there someplace, can you point me to it?
>
> What do you mean by key size? The indicator returned by
> gnutls_pubkey_get_pk_algorithm()?
It's telling me the key is zero bits long. My call sequence is:
bits = 0;
gnutls_pubkey_init(&X)
gnutls_pubkey_import(X, &keydata, GNUTLS_X509_FMT_DER);
gnutls_pubkey_verify_hash(X, 0, &digest, &signature); <== works; returns 1
gnutls_pubkey_get_pk_algorithm(X, &bits);
assert(bits > 0); <== FAILS
It looks like key->bits is never set to anything by gnutls_pubkey_import().
> I've just added (not tested yet) gnutls_pubkey_import_privkey() that
> will import the public parameters from a gnutls_privkey_t structure.
>
> Thus it would still be quite some calls, but you don't need to export
> anything. How does it look?
>
> gnutls_x509_privkey_init(A)
> gnutls_x509_privkey_import(A)
> gnutls_privkey_init(P)
> gnutls_privkey_import_x509(P,A)
> gnutls_pubkey_init(B)
> gnutls_pubkey_import_privkey(B,P)
Works for me. Let me know when you'd like me to grab a snapshot and try it.
-MSK
- Re: RSA sign/verify and hash generation functions, (continued)
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/08
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/08
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/09
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/09
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/13
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/14
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/14
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/14
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/15
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/16
- RE: RSA sign/verify and hash generation functions,
Murray S. Kucherawy <=
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/16
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/16
- Re: RSA sign/verify and hash generation functions, Nikos Mavrogiannopoulos, 2010/12/18
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/20
- RE: RSA sign/verify and hash generation functions, Murray S. Kucherawy, 2010/12/08