libtom / libtomcrypt

LibTomCrypt is a fairly comprehensive, modular and portable cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines.
https://www.libtom.net
Other
1.51k stars 449 forks source link

Signature verification of X509 certificate #634

Closed Larsjep closed 5 months ago

Larsjep commented 9 months ago

Prerequisites

Description

Hi,

I'm trying to verify the signature of a X509 certifcate.

But in order to do that I need the raw data of the tbsCertifcate parts of the certificate. I can decode the elements of the certificate with der_decode_sequence but I can't find a way to get the data I need for verifying the signature.

Do I miss something or is this just not supported by the DER decoder in libtomcrypt.

Best regards Lars

Steps to Reproduce

N/A

Version

master/b96e96cf8

Additional Information

N/A

sjaeckel commented 9 months ago

On master that's currently not possible.

On develop you can use the flexi decoder which now stores the original data before decoding in ltc_asn1_list->data.

sjaeckel commented 5 months ago

I'm closing this as there was no action for too long. Please re-open if you have further questions/comments.