I need to filter incoming X509 certificates by issuer, and I am using Pyhton's OpenSSL.crypto for this. However, I did not find how to create an X509Name object as a constant, which I need to compare with the value I get from cert.get_issuer().
Asked
Active
Viewed 1,581 times
1 Answers
1
Best thing I can think of, for you to create a new X509Name is to use
name = crypto.X509Name(crypto.X509().get_subject())
and subsequently populate the attributes via
name.__setattr__(att_name, attr_value)
However, for comparison alone, better to use the hash() builtin function of the class, that returns a hash for the whole name, or do a per-attribute comparison

nettrino
- 588
- 6
- 21