Mac Developer Library

Developer

SecurityInterface Framework Reference SFCertificateView Class Reference

Options
Deployment Target:

On This Page
Language:

SFCertificateView

Inheritance


Import Statement


Not Applicable

Objective-C

@import SecurityInterface;

Availability


Available in OS X v10.3 and later

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.

Figure 1Certificate view image: ../Art/cert_view.eps
  • Specifies the certificate that’s displayed in the view.

    Declaration

    Objective-C

    - (void)setCertificate:(SecCertificateRef)certificate

    Parameters

    certificate

    The new certificate for the view.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

    See Also

    – certificate

  • Sets whether the certificate details subview is disclosed.

    Declaration

    Objective-C

    - (void)setDetailsDisclosed:(BOOL)disclosed

    Parameters

    disclosed

    Pass YEStrue to open the disclosure triangle and disclose the view, or NOfalse to 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.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.5 and later.

  • Specifies whether the user can see the certificate details.

    Declaration

    Objective-C

    - (void)setDisplayDetails:(BOOL)display

    Parameters

    display

    Pass YEStrue to display the certificate details, or NOfalse to 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 NOfalse.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.4 and later

  • Specifies whether the user can see the certificate’s trust settings.

    Declaration

    Objective-C

    - (void)setDisplayTrust:(BOOL)display

    Parameters

    display

    Pass YES to display the trust settings, or NOfalse to 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 YEStrue. with either this method or the setEditableTrust method.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

  • Specifies whether the user can edit the certificate’s trust settings.

    Declaration

    Objective-C

    - (void)setEditableTrust:(BOOL)editable

    Parameters

    editable

    Pass YEStrue if 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 NOfalse).

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

  • Specifies the policies to use when evaluating this certificate’s status.

    Declaration

    Objective-C

    - (void)setPolicies:(id)policies

    Parameters

    policies

    The policy or policies to use. You can pass either a SecPolicyRef object or an NSArray (containing one or more objects of type SecPolicyRef ) in this parameter. If policies is 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.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.4 and later.

    See Also

    – policies

  • Specifies whether the trust policy settings subview is disclosed.

    Declaration

    Objective-C

    - (void)setPoliciesDisclosed:(BOOL)disclosed

    Parameters

    disclosed

    Pass YEStrue to display the certificate details, or NOfalse to 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.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.5 and later.

  • Returns the certificate currently displayed in the view.

    Declaration

    Objective-C

    - (SecCertificateRef)certificate

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

  • Indicates if the view currently shows the certificate’s details.

    Declaration

    Objective-C

    - (BOOL)detailsDisplayed

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.4 and later

  • Returns whether the view currently shows the certificate’s details.

    Declaration

    Objective-C

    - (BOOL)detailsDisclosed

    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.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.5 and later.

  • Indicates if the view currently shows the certificate’s trust settings.

    Declaration

    Objective-C

    - (BOOL)isTrustDisplayed

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

  • Indicates if the view allows the user to edit the certificate’s trust.

    Declaration

    Objective-C

    - (BOOL)isEditable

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

  • Returns an array of policies used to evaluate the status of the displayed certificate.

    Declaration

    Objective-C

    - (NSArray *)policies

    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).

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.4 and later

  • Returns whether the trust policy subview is disclosed.

    Declaration

    Objective-C

    - (BOOL)policiesDisclosed

    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.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.5 and later.

  • Saves the user’s current trust settings for the displayed certificate.

    Declaration

    Objective-C

    - (void)saveTrustSettings

    Discussion

    If trust settings are not editable, this method effectively does nothing. You can use SecTrustGetUserTrust to subsequently retrieve the trust settings.

    Import Statement

    Objective-C

    @import SecurityInterface;

    Availability

    Available in OS X v10.3 and later.

  • Notifications sent by this class.

    Declaration

    Objective-C

    NSString *SFCertificateViewDisclosureStateDidChange;

    Constants

    • SFCertificateViewDisclosureStateDidChange

      SFCertificateViewDisclosureStateDidChange

      Sent when the disclosure triangle is opened or closed.

      Available in OS X v10.7 and later.