MYKey Class Reference

Abstract superclass for keys. More...

Inherits MYKeychainItem.

Inherited by MYPrivateKey, MYPublicKey, and MYSymmetricKey.

List of all members.

Public Member Functions

(id) - initWithKeyData:
 Creates a key from encoded data (but does not add it to any keychain.
(id) - _initWithKeyData:forKeychain:
(NSData *) - _crypt:operation:
(CSSM_CC_HANDLE) - _createSignatureContext:
(CSSM_CC_HANDLE) - _createPassThroughContext

Properties

NSData * keyData
 The key's raw data.
unsigned keySizeInBits
 The key's size/length, in bits.
NSString * name
 The user-visible name (kSecKeyPrintName) associated with this key in the Keychain.
NSString * alias
 An application-specific string (kSecKeyAlias) associated with this key in the Keychain.
SecExternalItemType keyClass
SecExternalItemType keyType
MYSHA1Digest_keyDigest
NSArray * _itemList
Mac-Only

Functionality not available on iPhone.

NSString * comment
 The user-visible comment (kSecKeyApplicationTag) associated with this key in the Keychain.

Expert

Advanced methods.



SecKeyRef keyRef
 The Keychain object reference for this key.
struct cssm_key * cssmKey
 The underlying CSSM_KEY structure; used with low-level crypto APIs.
intptr_t cssmCSPHandle
 The underlying CSSM_CSP_HANDLE structure; used with low-level crypto APIs.
CSSM_ALGORITHMS cssmAlgorithm
(id) - initWithKeyRef:
 Creates a MYKey object for an existing Keychain key reference.
(const CSSM_ACCESS_CREDENTIALS *) - cssmCredentialsForOperation:type:error:
 Gets CSSM authorization credentials for a specified operation, such as CSSM_ACL_AUTHORIZATION_ENCRYPT.

Detailed Description

Abstract superclass for keys.

Concrete subclasses are MYSymmetricKey and MYPublicKey.


Member Function Documentation

- (const CSSM_ACCESS_CREDENTIALS *) cssmCredentialsForOperation: (CSSM_ACL_AUTHORIZATION_TAG)  operation
type: (SecCredentialType)  type
error: (NSError**)  outError 

Gets CSSM authorization credentials for a specified operation, such as CSSM_ACL_AUTHORIZATION_ENCRYPT.

This pointer is necessary for creating some CSSM operation contexts.

Parameters:
operation The type of operation you are going to perform (see the enum values in cssmType.h.)
type Specifies whether the operation should be allowed to present a UI. You'll usually want to pass kSecCredentialTypeDefault.
outError Will be set to point to an NSError on failure, or nil on success. Pass nil if you don't care about the specific error.
Returns:
The access credentials, or NULL on failure. This pointer is valid for as long as you have a reference to the key object. Do not free or delete it.
- (id) initWithKeyData: (NSData*)  data  

Creates a key from encoded data (but does not add it to any keychain.

)

- (id) initWithKeyRef: (SecKeyRef)  keyRef  

Creates a MYKey object for an existing Keychain key reference.

This is abstract -- must be called on a MYSymmetricKey or MYPublicKey, as appropriate.


Property Documentation

- (NSString *) alias [read, write, copy]

An application-specific string (kSecKeyAlias) associated with this key in the Keychain.

Not visible to or editable by the user. If you own this key, you can store any associated metadata you like here, although be aware that it can be read and modified by any other app that can access this key.

- (NSString *) comment [read, write, copy]

The user-visible comment (kSecKeyApplicationTag) associated with this key in the Keychain.

The user can edit this, so don't expect it to be immutable.

- (const CSSM_CSP_HANDLE) cssmCSPHandle [read, assign]

The underlying CSSM_CSP_HANDLE structure; used with low-level crypto APIs.

- (const CSSM_KEY *) cssmKey

The underlying CSSM_KEY structure; used with low-level crypto APIs.

- (NSData *) keyData [read, assign]

The key's raw data.

- (SecKeyRef) keyRef [read, assign]

The Keychain object reference for this key.

- (unsigned) keySizeInBits [read, assign]

The key's size/length, in bits.

- (NSString *) name [read, write, copy]

The user-visible name (kSecKeyPrintName) associated with this key in the Keychain.

The user can edit this, so don't expect it to be immutable.


The documentation for this class was generated from the following files:
Generated on Sun Apr 17 12:23:58 2011 for MYCrypto by  doxygen 1.6.3