diff -r 4c0eafa7b233 -r 6fd9177eb6da MYCertificate.m --- a/MYCertificate.m Sun Apr 12 22:02:20 2009 -0700 +++ b/MYCertificate.m Sun Apr 19 00:01:41 2009 -0700 @@ -236,6 +236,23 @@ } +// Taken from Keychain.framework +NSString* OIDAsString(const CSSM_OID oid) { + if ((NULL == oid.Data) || (0 >= oid.Length)) { + return nil; + } else { + NSMutableString *result = [NSMutableString stringWithCapacity:(4 * oid.Length)]; + unsigned int i; + + for (i = 0; i < oid.Length; ++i) { + [result appendFormat:@"%s%hhu", ((0 == i) ? "" : ", "), oid.Data[i]]; + } + + return result; + } +} + + TestCase(Trust) { Log(@"X.509 policy = %@", MYPolicyGetName([MYCertificate X509Policy]));