Sorry for my ignorance,
I try with this:

int main()
{
        EVP_PKEY* pkey = EVP_PKEY_new();
        char* fingerprint;
        ASN1_OCTET_STRING *oc;
        X509_PUBKEY *xpkey;
        
        EVP_PKEY_set1_RSA(pkey, load_public_key("rsa.prova.pub"));      
        if (pkey) {
                X509_PUBKEY_set(&xpkey, pkey);
                oc = ASN1_item_pack(xpkey, ASN1_ITEM_rptr(x509), NULL);
                fingerprint = SHA1((char*)oc, (unsigned long)strlen((char*)oc), NULL);
                if (fingerprint)
                        printf("Fingerprint: %s\n", fingerprint);
        }
}

but the only thing I get is this:

-[ davide@bsd : ~/wip/fingerprint ]- $ gcc *.c -o fingerprint -lcrypto -lssl
fingerprint.c: In function `main':
fingerprint.c:322: syntax error before `X509_PUBKEY'

I'm using freebsd 4.6 release and OpenSSL 0.9.6a 5 Apr 2001.

Any suggestion?

Thanks in advance
Davide
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to