Gets the absolute time against which the certificates in a trust management object are verified.


func SecTrustGetVerifyTime(_ trust: SecTrust) -> CFAbsoluteTime



The trust management object whose verification time you want to get. A trust management object includes one or more certificates plus the policy or policies to be used in evaluating trust. Use the SecTrustCreateWithCertificates(_:_:_:) function to create a trust management object.

Return Value

The absolute time at which the certificates should be checked for validity.


This function returns the absolute time returned by:

  1. the CFDateGetAbsoluteTime(_:) function for the date passed in to the SecTrustSetVerifyDate(_:_:) function, if that was called, or

  2. the last value returned by the SecTrustGetVerifyTime(_:) function, if it was called before, or

  3. the value returned by the CFAbsoluteTimeGetCurrent() function if neither SecTrustSetVerifyDate(_:_:) nor SecTrustGetVerifyTime(_:) were ever called.

It is safe to call this function concurrently on two or more threads as long as it is not used to get a value from a trust management object that is simultaneously being changed by another function. For example, you can call this function on two threads at the same time, but not if you are simultaneously calling the SecTrustSetVerifyDate(_:_:) function for the same trust management object on another thread.

See Also

Trust Components

func SecTrustCopyPublicKey(SecTrust) -> SecKey?

Returns the public key for a leaf certificate after it has been evaluated.

func SecTrustGetCertificateCount(SecTrust) -> CFIndex

Returns the number of certificates in an evaluated certificate chain.

func SecTrustGetCertificateAtIndex(SecTrust, CFIndex) -> SecCertificate?

Returns a specific certificate from the certificate chain used to evaluate trust.

func SecTrustCopyAnchorCertificates(UnsafeMutablePointer<CFArray?>) -> OSStatus

Retrieves the anchor (root) certificates stored by macOS.

func SecTrustCopyCustomAnchorCertificates(SecTrust, UnsafeMutablePointer<CFArray?>) -> OSStatus

Retrieves the custom anchor certificates, if any, used by a given trust.

func SecTrustCopyExceptions(SecTrust) -> CFData

Returns an opaque cookie containing exceptions to trust policies that will allow future evaluations of the current certificate to succeed.

func SecTrustCopyPolicies(SecTrust, UnsafeMutablePointer<CFArray?>) -> OSStatus

Retrieves the policies used by a given trust management object.

func SecTrustCopyProperties(SecTrust) -> CFArray?

Returns an array containing the properties of a trust object.