SFCertificateView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/SecurityInterface.framework |
| Availability | Available in OS X v10.3 and later |
| Companion guide | |
| Declared in | SFCertificateView.h |
Overview
The SFCertificateView class displays the contents of a certificate. It includes options to display certificate details, display trust settings, and allow users to edit a certificate’s trust settings.
The following figure shows a certificate view that includes editable trust settings and certificate details.

Tasks
Specifying the Certificate to Display
Customizing the Appearance and Behavior of the View
-
– setDetailsDisclosed: -
– setDisplayDetails: -
– setDisplayTrust: -
– setEditableTrust: -
– setPolicies: -
– setPoliciesDisclosed:
Getting Information About the View
-
– certificate -
– detailsDisplayed -
– detailsDisclosed -
– isTrustDisplayed -
– isEditable -
– policies -
– policiesDisclosed
Saving User Trust Settings
Instance Methods
certificate
Returns the certificate currently displayed in the view.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hdetailsDisclosed
Returns whether the view currently shows the certificate’s details.
Discussion
The certificate details can be shown or hidden depending on whether the user clicks the disclosure triangle. This method returns the state of that disclosure triangle.
Availability
- Available in OS X v10.5 and later.
Declared In
SFCertificateView.hdetailsDisplayed
Indicates if the view currently shows the certificate’s details.
Availability
- Available in OS X v10.4 and later
See Also
Declared In
SFCertificateView.hisEditable
Indicates if the view allows the user to edit the certificate’s trust.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hisTrustDisplayed
Indicates if the view currently shows the certificate’s trust settings.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hpolicies
Returns an array of policies used to evaluate the status of the displayed certificate.
Discussion
This method returns an autoreleased NSArray containing one or more instances of SecPolicyRef. The array always contains at least one item (the Apple X.509 Basic policy, if you have never called the setPolicies: method).
Availability
- Available in OS X v10.4 and later
See Also
Declared In
SFCertificateView.hpoliciesDisclosed
Returns whether the trust policy subview is disclosed.
Discussion
The trust policy settings can be shown or hidden depending on whether the user clicks the disclosure triangle. This method returns the state of that disclosure triangle.
Availability
- Available in OS X v10.5 and later.
Declared In
SFCertificateView.hsaveTrustSettings
Saves the user’s current trust settings for the displayed certificate.
Discussion
If trust settings are not editable, this method effectively does nothing. You can use SecTrustGetUserTrust to subsequently retrieve the trust settings.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hsetCertificate:
Specifies the certificate that’s displayed in the view.
Parameters
- certificate
The new certificate for the view.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hsetDetailsDisclosed:
Sets whether the certificate details subview is disclosed.
Parameters
- disclosed
Pass
YESto open the disclosure triangle and disclose the view, orNOto close it and hide the view.
Discussion
The certificate details can be shown or hidden depending on whether the user clicks the disclosure triangle. This method sets the state of that disclosure triangle and the visibility of the corresponding view.
Availability
- Available in OS X v10.5 and later.
Declared In
SFCertificateView.hsetDisplayDetails:
Specifies whether the user can see the certificate details.
Parameters
- display
Pass
YESto display the certificate details, orNOto hide them.
Discussion
For behavioral compatibility with OS X v10.3, certificate details are displayed by default. To hide the details of a certificate, you must explicitly set the display value to NO.
Availability
- Available in OS X v10.4 and later
See Also
Declared In
SFCertificateView.hsetDisplayTrust:
Specifies whether the user can see the certificate’s trust settings.
Parameters
- display
Pass YES to display the trust settings, or
NOto hide them.
Discussion
Certificate trust settings are not displayed by default. To show the certificate’s trust settings, you must explicitly set the display value to YES. with either this method or the setEditableTrust method.
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hsetEditableTrust:
Specifies whether the user can edit the certificate’s trust settings.
Parameters
- editable
Pass
YESif the trust settings should be editable.
Discussion
For behavioral compatibility with OS X v10.3, this method causes the certificate trust settings to be displayed if they are not currently visible (that is, if setDisplayTrust: is set to NO).
Availability
- Available in OS X v10.3 and later.
See Also
Declared In
SFCertificateView.hsetPolicies:
Specifies the policies to use when evaluating this certificate’s status.
Parameters
- policies
The policy or policies to use. You can pass either a
SecPolicyRefobject or an NSArray (containing one or more objects of typeSecPolicyRef) in this parameter. Ifpoliciesis set to nil, the Apple X.509 Basic Policy is used. See “AppleX509TP Trust Policies” for a list of policies and object identifiers provided by the AppleX509TP module.
Discussion
Applications typically display a certificate view in the context of a specific use, such as SSL or S/MIME. You should set only the policy references that apply to your intended use.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
SFCertificateView.hsetPoliciesDisclosed:
Specifies whether the trust policy settings subview is disclosed.
Parameters
- disclosed
Pass
YESto display the certificate details, orNOto hide them.
Discussion
The trust policy settings can be shown or hidden depending on whether the user clicks the disclosure triangle. This method sets the state of that disclosure triangle and the visibility of the corresponding view.
Availability
- Available in OS X v10.5 and later.
Declared In
SFCertificateView.hConstants
Notifications
Notifications sent by this class.
NSString *SFCertificateViewDisclosureStateDidChange;
Constants
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-06-11)