Inherits from WSCKeychainItem : NSObject
Declared in WSCProtectedKeychainItem.h
WSCProtectedKeychainItem.m

Overview

The WSCProtectedKeychainItem class is a subclass of WSCKeychainItem representing the keychain item that involves the secret data (keys, passphrase, etc.)

You typically do not use WSCProtectedKeychainItem object directly, you use objects whose classes descend from this class or its superclass:

Properties

secAccess

The reference of the SecAccess opaque object, which wrapped by WSCProtectedKeychainItem object. (read-only)

@property (unsafe_unretained, readonly) SecAccessRef secAccess

Discussion

If you are familiar with the underlying Keychain Services API, you can move freely back and forth between WaxSealCore framework and Keychain Services API with this property.

Declared In

WSCProtectedKeychainItem.h

Instance Methods

addPermittedOperationWithDescription:trustedApplications:forOperations:promptContext:error:

Creates a new permitted operation entry from the description, trusted application list, and prompt context provided and adds it to the protected keychain item represented by receiver.

- (WSCPermittedOperation *)addPermittedOperationWithDescription:(NSString *)_Description trustedApplications:(NSSet *)_TrustedApplications forOperations:(WSCPermittedOperationTag)_Operations promptContext:(WSCPermittedOperationPromptContext)_PromptContext error:(NSError **)_Error

Parameters

_Description

The human readable name to be used to refer to this item when the user is prompted.

_TrustedApplications

An set of trusted application objects (that is, WSCTrustedApplication instances) identifying applications that are allowed access to the protected keychain item without user confirmation. If you set this parameter to nil, then any application can use this item. If you pass an empty set, then there are no trusted applications.

_Operations

An unsigned integer bit field containing any of the operation tag masks described in “WSCPermittedOperationTag Constants Reference”, combined using the C bitwise OR operator.

_PromptContext

A set of prompt context masks. See WSCPermittedOperationPromptContext for possible values. By default, the value of this parameter is 0.

_Error

On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you don’t want the error information.

Return Value

A WSCPermittedOperation object that has been added to the list of permitted operations of an protected keychain item. Returns nil if an error occurs.

Discussion

The permitted operation returned by this method is a reference to an permitted operation entry. The permitted operation entry includes the name of the protected keychain item as it appears in user prompts, a list of trusted applications (represented by WSCTrustedApplication), the prompt context masks, and a list of one or more operations tags to which this permitted operation entry applies. By default, a new permitted operation entry applies to all operations. Use the operationTags read-write property to set the list of operations for an permitted operation object.

Warning: The system allows exactly one owner permitted operation entry in each protected keychain item. This method fails if you attempt to add a second owner permitted operaton entry.

Declared In

WSCProtectedKeychainItem.h

permittedOperations

Retrieves all the permitted operation entries of the protected keychain item represented by receiver.

- (NSArray *)permittedOperations

Return Value

An array representing the list of permitted operation entries. Returns nil if an error occurs.

Discussion

A protected keychain item can have any number of permitted operation entries for specific operations or sets of operations.

Declared In

WSCProtectedKeychainItem.h