How can we check the expiration date of a certificate?

Problem:


When calling SecTrustEvaluate(), the SecTrustResultType value is kSecTrustResultRecoverableTrustFailure when the certificate is expired.


According to the documentation (https://developer.apple.com/documentation/security/1394363-sectrustevaluate?language=objc )


"In macOS, you can call the

SecTrustGetTrustResult
function to get more information about the results of the trust evaluation."


Unless I'm dumb (which is a possibility), according to the documentation for SecTrustGetTrustResult, this will just provide me with the same SecTrustResultType value.


So I have some doubt about the "to get more information" part.


Platform:


macOS, OS X 10.8 or later.


Questions:


- How can you get more information about the result of the trust evaluation?

- How can you check whether this is related to an expired certificate (though code)?

That’s a bug in the documentation. It should reference

SecTrustCopyResult
, not
SecTrustGetTrustResult
.

Share and Enjoy

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

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

That is was a bug in the documentation.

That was a bug in the documentation. We just shipped a fix.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
How can we check the expiration date of a certificate?
 
 
Q