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