Hello,

> I have to check that a certificate is encrypted with RSA and not DSA. I
> can't find any API function for that.
> Please help me.

EVP_PKEY *pkey;

if ( (pkey = X509_get_pubkey(cert)) == NULL ){
        goto err;
}
if (pkey->type == EVP_PKEY_RSA ){
        // RSA
else if (pkey->type == EVP_PKEY_DSA) {
        // DSA
else {
        // NOT RSA AND NOT DSA :-)
}
EVP_PKEY_free(pkey);

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to