diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2010-09-28 20:51:47 +0400 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2010-09-28 20:51:47 +0400 |
commit | b6e358ec9886f209b87db467b8122057a4aad8af (patch) | |
tree | 31cb046e649664302effb65a78ca3268b8461277 /test | |
parent | e3e7591c591e017df5be9fac618226b227c61b6b (diff) |
Update MKCertificate commandline utility to print the hexDigest of a certificate.
Diffstat (limited to 'test')
-rw-r--r-- | test/cert.m | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/cert.m b/test/cert.m index b0a3890..da495a8 100644 --- a/test/cert.m +++ b/test/cert.m @@ -3,5 +3,14 @@ // This is just a temporary tool to test MKCertificate int main(int argc, char *argv[]) { - NSLog(@"Nothing to see, yet."); + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSData *data = [NSData dataWithContentsOfFile:@"Certificates.cer"]; + MKCertificate *cert = [MKCertificate certificateWithCertificate:data privateKey:nil]; + if ([cert hasCertificate]) { + NSLog(@"digest = %@", [cert hexDigest]); + } + + [pool release]; + return 0; } |