X509_ALGOR_get_md?

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

 



On Thu, Apr 28, 2016, Wouter Verhelst wrote:

> Hi,
> 
> I note that OpenSSL provides a function X509_ALGOR_set_md() to set
> the message digest algorithm to be used on a signature, but it
> doesn't seem to provide a corresponding X509_ALGOR_get_md()
> function.
> 
> Is this correct, or did I miss something? If I didn't miss anything,
> then how can I figure out which hashing algorithm was used for a
> given X.509 certificate?
> 

You can retrieve the OID used in the X509_ALGOR structure using
X509_ALGOR_get0(). If that OID corresponds to a digest directly you can call
EVP_get_digestbyobj() on it.

In many cases the OID you get will be a signature algorithm. In that case
you convert it to a NID using OBJ_obj2nid() and call OBJ_find_sigid_algs() to
get the digest NID and finally EVP_get_digestbynid().

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org


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

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux