Is there a way to read CRL file from macOS application?

I am working on a macOS application that reads the CRL downloaded from a URL and finds out if a certain certificate exists in it or not. But i am havig trouble reading the downloaded CRL file. Can anyone please guide me how to do this in swift 3/4.

Replies

macOS does not have an API for reading CRLs specifically. However, CRLs have a well-defined format (see Section 5 of RFC 5280) and you can parse that format yourself.

To do that you’ll need an ASN.1 parser. macOS does have an ASN.1 parsing API (

<Security/SecAsn1Coder.h>
) but it’s not easy to use (especially given the poor state of its documentation). You could try getting that to work, but it might be easier to find some third-party library for parsing CRLs, or building a CRL ASN.1 parser using some third-party infrastructure.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for the prompt reply, it helped me clear my doubts.

However, could you kindly suggest a good third-party library that may be useful?

However, could you kindly suggest a good third-party library that may be useful?

I’m sorry but the nature of my work means that I can’t use any third-party libraries, and thus I don’t have any hard experience to share.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"