Trying to validate external reference identifiers with SecTrustEvaluateWithError Method by setting reference Ids to SecPolicyCreateSSL() & SecPolicyCreateWithProperties()
But two concerns are -
- Validates for correct reference IDs but gives error for combination of wrong & correct reference Ids
- 398 days validity works mandatorily before reference Ids check.
Is there any other to validate external reference Ids?, which give flexibility
- To pass multiple combinations of reference IDs string (wrong, correct, IP, DNS)
- To validate reference ID without days validity of 398.
Please suggest. Any help here is highly appreciated.
Can you confirm what validation does SecPolicyCreateX509 policy actually verifies?
I don’t think that’s formally documented, but of the things you listed:
-
Chain validation — Yes.
-
Expiration — Yes. By default the trust object uses the current time, but you can override that with
SecTrustSetVerifyDate
. -
Signature — Yes.
-
“ec parameter” — I don’t know what that means. In the context of PKI EC usually refers to elliptic curve, but I’m not sure what sort of validation that would need beyond the signature check covered by the previous point.
-
Revocation — Maybe. The default policy is an implementation detail. If you want to force specific revocation checks, add in the revocation policy (
SecPolicyCreateRevocation
).
From Reference ID means validating Server Identity.
Thanks for clarifying.
With that understanding, let’s return ot your original questions.
To pass multiple combinations of reference IDs string (wrong, correct, IP, DNS)
I don’t understand what you’re asking here. Server name checking is done by the TLS policy (SecPolicyCreateSSL
). You pass in a DNS name, or the string representation of an IP address, and it checks to see if that’s listed in Subject Alternative Name extension. What else are you looking for?
To validate reference ID without days validity of 398.
I discuss those limits in this post.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"