Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

SFCertificateView Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/SecurityInterface.framework
Availability
Available in Mac 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.


Figure 1  Certificate view

Certificate view

Tasks

Specifying the Certificate to Display

Customizing the Appearance and Behavior of the View

Getting Information About the View

Saving User Trust Settings

Instance Methods

certificate

Returns the certificate currently displayed in the view.

- (SecCertificateRef)certificate

Availability
See Also
Declared In
SFCertificateView.h

detailsDisplayed

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

- (BOOL)detailsDisplayed

Availability
See Also
Declared In
SFCertificateView.h

isEditable

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

- (BOOL)isEditable

Availability
See Also
Declared In
SFCertificateView.h

isTrustDisplayed

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

- (BOOL)isTrustDisplayed

Availability
See Also
Declared In
SFCertificateView.h

policies

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

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

Availability
See Also
Declared In
SFCertificateView.h

saveTrustSettings

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

- (void)saveTrustSettings

Discussion

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

Availability
See Also
Declared In
SFCertificateView.h

setCertificate:

Specifies the certificate that’s displayed in the view.

- (void)setCertificate:(SecCertificateRef)certificate

Parameters
certificate

The new certificate for the view.

Availability
See Also
Declared In
SFCertificateView.h

setDisplayDetails:

Specifies whether the user can see the certificate details.

- (void)setDisplayDetails:(BOOL)display

Parameters
display

Pass YES to display the certificate details, or NO to hide them.

Discussion

For behavioral compatibility with Mac 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
See Also
Declared In
SFCertificateView.h

setDisplayTrust:

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

- (void)setDisplayTrust:(BOOL)display

Parameters
display

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

Availability
See Also
Declared In
SFCertificateView.h

setEditableTrust:

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

- (void)setEditableTrust:(BOOL)editable

Parameters
editable

Pass YES if the trust settings should be editable.

Discussion

For behavioral compatibility with Mac 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
See Also
Declared In
SFCertificateView.h

setPolicies:

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

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

Availability
See Also
Declared In
SFCertificateView.h

Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice