MYCertificate-iPhone.m
changeset 19 f6c91b9da05b
parent 2 8982b8fada63
child 21 2c300b15b381
     1.1 --- a/MYCertificate-iPhone.m	Tue Apr 07 10:56:58 2009 -0700
     1.2 +++ b/MYCertificate-iPhone.m	Thu Jun 04 18:36:30 2009 -0700
     1.3 @@ -15,6 +15,10 @@
     1.4  @implementation MYCertificate
     1.5  
     1.6  
     1.7 ++ (MYCertificate*) certificateWithCertificateRef: (SecCertificateRef)certificateRef {
     1.8 +    return [[[self alloc] initWithCertificateRef: certificateRef] autorelease];
     1.9 +}
    1.10 +
    1.11  /** Creates a MYCertificate object for an existing Keychain certificate reference. */
    1.12  - (id) initWithCertificateRef: (SecCertificateRef)certificateRef {
    1.13      self = [super initWithKeychainItemRef: (SecKeychainItemRef)certificateRef];
    1.14 @@ -34,6 +38,10 @@
    1.15  }
    1.16  
    1.17  
    1.18 +- (BOOL)isEqualToCertificate:(MYCertificate*)cert {
    1.19 +    return [self isEqual: cert] || [self.certificateData isEqual: cert.certificateData];
    1.20 +}
    1.21 +
    1.22  @synthesize certificateRef=_certificateRef;
    1.23  
    1.24  - (NSData*) certificateData {