MYKeychainItem.h
author Jens Alfke <jens@mooseyard.com>
Tue Jul 21 10:13:08 2009 -0700 (2009-07-21)
changeset 27 d0aadddb9c64
parent 2 8982b8fada63
permissions -rw-r--r--
MYCertificate now checks validity of self-signed certs loaded from the keychain (because the Security framework doesn't validate self-signed certs.)
     1 //
     2 //  MYKeychainItem.h
     3 //  MYCrypto
     4 //
     5 //  Created by Jens Alfke on 3/26/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import <Foundation/Foundation.h>
    10 #import <Security/Security.h>
    11 #import "MYCryptoConfig.h"
    12 @class MYKeychain;
    13 
    14 
    15 /** Error domain for CSSM (low-level crypto) errors */
    16 extern NSString* const MYCSSMErrorDomain;
    17 
    18 
    19 #if MYCRYPTO_USE_IPHONE_API
    20 typedef CFTypeRef MYKeychainItemRef;
    21 #else
    22 typedef SecKeychainItemRef MYKeychainItemRef;
    23 #endif
    24 
    25 
    26 /** Abstract base class for keychain items.
    27     Direct subclasses are MYKey and MYCertificate. */
    28 @interface MYKeychainItem : NSObject
    29 {
    30     @private
    31     MYKeychainItemRef _itemRef;
    32 #if MYCRYPTO_USE_IPHONE_API
    33     BOOL _isPersistent;
    34 #endif
    35 }
    36 
    37 /** The Keychain item reference that this object represents. */
    38 @property (readonly) MYKeychainItemRef keychainItemRef;
    39 
    40 /** The Keychain that contains this object, or nil. */
    41 @property (readonly) MYKeychain *keychain;
    42 
    43 /** Removes the item from its keychain, if any. */
    44 - (BOOL) removeFromKeychain;
    45 
    46 #if MYCRYPTO_USE_IPHONE_API
    47 @property BOOL isPersistent;
    48 #endif
    49 
    50 @end