1.1 --- a/MYCertificate.m Tue Jun 02 13:16:28 2009 -0700
1.2 +++ b/MYCertificate.m Sun Jun 07 21:53:56 2009 -0700
1.3 @@ -10,6 +10,7 @@
1.4 #import "MYCrypto_Private.h"
1.5 #import "MYIdentity.h"
1.6 #import "MYDigest.h"
1.7 +#import "MYCertificateInfo.h"
1.8 #import "MYErrorUtils.h"
1.9
1.10 #if !MYCRYPTO_USE_IPHONE_API
1.11 @@ -55,6 +56,13 @@
1.12 encoding: CSSM_CERT_ENCODING_BER];
1.13 }
1.14
1.15 +- (void) dealloc
1.16 +{
1.17 + [_info release];
1.18 + [super dealloc];
1.19 +}
1.20 +
1.21 +
1.22
1.23 - (NSString*) description {
1.24 return $sprintf(@"%@[%@ %@/%p]",
1.25 @@ -108,6 +116,17 @@
1.26 return [[[MYIdentity alloc] initWithCertificateRef: _certificateRef] autorelease];
1.27 }
1.28
1.29 +- (MYCertificateInfo*) info {
1.30 + if (!_info) {
1.31 + NSError *error;
1.32 + _info = [[MYCertificateInfo alloc] initWithCertificateData: self.certificateData
1.33 + error: &error];
1.34 + if (!_info)
1.35 + Warn(@"Couldn't parse certificate %@: %@", self, error);
1.36 + }
1.37 + return _info;
1.38 +}
1.39 +
1.40 - (NSString*) commonName {
1.41 CFStringRef name = NULL;
1.42 if (!check(SecCertificateCopyCommonName(_certificateRef, &name),