diff --git a/.gitignore b/.gitignore index edc082c..5a4e6ce 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ build/* xcuserdata profile *.moved-aside +.DS_Store diff --git a/ASN.1 Dump.xcodeproj/TemplateIcon.icns b/ASN.1 Dump.xcodeproj/TemplateIcon.icns new file mode 100644 index 0000000..62cb701 Binary files /dev/null and b/ASN.1 Dump.xcodeproj/TemplateIcon.icns differ diff --git a/ASN.1 Dump.xcodeproj/project.pbxproj b/ASN.1 Dump.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9e3dc63 --- /dev/null +++ b/ASN.1 Dump.xcodeproj/project.pbxproj @@ -0,0 +1,351 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* MyDocument.xib */; }; + 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; }; + 67743C8015AA190E00AFD9A3 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 67743C7F15AA190E00AFD9A3 /* README.md */; }; + 67826B0D0E4D8000009312C6 /* HexNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 67826B0C0E4D8000009312C6 /* HexNumberFormatter.m */; }; + 67C9B8610E46027C004DB4E9 /* ASN1Node.m in Sources */ = {isa = PBXBuildFile; fileRef = 67C9B8600E46027C004DB4E9 /* ASN1Node.m */; }; + 67C9B8960E4607FD004DB4E9 /* berd.m in Sources */ = {isa = PBXBuildFile; fileRef = 67C9B8950E4607FD004DB4E9 /* berd.m */; }; + 67C9B89D0E460999004DB4E9 /* NSData+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 67C9B89C0E460999004DB4E9 /* NSData+Utils.m */; }; + 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; }; + 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; + 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; }; + 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; + 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = ""; }; + 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; + 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = ""; }; + 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = ""; }; + 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; + 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 32DBCF750370BD2300C91783 /* ASN.1 Dump_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASN.1 Dump_Prefix.pch"; sourceTree = ""; }; + 67743C7F15AA190E00AFD9A3 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; + 67826B0B0E4D8000009312C6 /* HexNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexNumberFormatter.h; sourceTree = ""; }; + 67826B0C0E4D8000009312C6 /* HexNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HexNumberFormatter.m; sourceTree = ""; }; + 67C9B85F0E46027C004DB4E9 /* ASN1Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASN1Node.h; sourceTree = ""; }; + 67C9B8600E46027C004DB4E9 /* ASN1Node.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASN1Node.m; sourceTree = ""; }; + 67C9B8950E4607FD004DB4E9 /* berd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = berd.m; sourceTree = ""; }; + 67C9B89B0E460999004DB4E9 /* NSData+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Utils.h"; sourceTree = ""; }; + 67C9B89C0E460999004DB4E9 /* NSData+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Utils.m"; sourceTree = ""; }; + 67C9B8C80E4611AC004DB4E9 /* berd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = berd.h; sourceTree = ""; }; + 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D15AC370486D014006FF6A4 /* ASN.1 Dump.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASN.1 Dump.app"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D15AC330486D014006FF6A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */, + 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */, + 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FB0FE9D524F11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D15AC370486D014006FF6A4 /* ASN.1 Dump.app */, + ); + name = Products; + sourceTree = ""; + }; + 2A37F4AAFDCFA73011CA2CEA /* ASN.1 Dump */ = { + isa = PBXGroup; + children = ( + 2A37F4ABFDCFA73011CA2CEA /* Classes */, + 67743C8115AA192A00AFD9A3 /* Documentation */, + 2A37F4AFFDCFA73011CA2CEA /* Other Sources */, + 2A37F4B8FDCFA73011CA2CEA /* Resources */, + 2A37F4C3FDCFA73011CA2CEA /* Frameworks */, + 19C28FB0FE9D524F11CA2CBB /* Products */, + ); + name = "ASN.1 Dump"; + sourceTree = ""; + }; + 2A37F4ABFDCFA73011CA2CEA /* Classes */ = { + isa = PBXGroup; + children = ( + 67826B0B0E4D8000009312C6 /* HexNumberFormatter.h */, + 67826B0C0E4D8000009312C6 /* HexNumberFormatter.m */, + 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */, + 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */, + 67C9B8950E4607FD004DB4E9 /* berd.m */, + 67C9B8C80E4611AC004DB4E9 /* berd.h */, + 67C9B85F0E46027C004DB4E9 /* ASN1Node.h */, + 67C9B8600E46027C004DB4E9 /* ASN1Node.m */, + 67C9B89B0E460999004DB4E9 /* NSData+Utils.h */, + 67C9B89C0E460999004DB4E9 /* NSData+Utils.m */, + ); + name = Classes; + sourceTree = ""; + }; + 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32DBCF750370BD2300C91783 /* ASN.1 Dump_Prefix.pch */, + 2A37F4B0FDCFA73011CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 2A37F4B8FDCFA73011CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, + 8D15AC360486D014006FF6A4 /* Info.plist */, + 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, + 1DDD58280DA1D0D100B32029 /* MyDocument.xib */, + 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, + ); + name = Resources; + sourceTree = ""; + }; + 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */, + 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 67743C8115AA192A00AFD9A3 /* Documentation */ = { + isa = PBXGroup; + children = ( + 67743C7F15AA190E00AFD9A3 /* README.md */, + ); + name = Documentation; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D15AC270486D014006FF6A4 /* ASN.1 Dump */ = { + isa = PBXNativeTarget; + buildConfigurationList = C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "ASN.1 Dump" */; + buildPhases = ( + 8D15AC2B0486D014006FF6A4 /* Resources */, + 8D15AC300486D014006FF6A4 /* Sources */, + 8D15AC330486D014006FF6A4 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "ASN.1 Dump"; + productInstallPath = "$(HOME)/Applications"; + productName = "ASN.1 Dump"; + productReference = 8D15AC370486D014006FF6A4 /* ASN.1 Dump.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; + buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "ASN.1 Dump" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 2A37F4AAFDCFA73011CA2CEA /* ASN.1 Dump */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8D15AC270486D014006FF6A4 /* ASN.1 Dump */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D15AC2B0486D014006FF6A4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */, + 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */, + 1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */, + 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */, + 67743C8015AA190E00AFD9A3 /* README.md in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D15AC300486D014006FF6A4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */, + 8D15AC320486D014006FF6A4 /* main.m in Sources */, + 67C9B8610E46027C004DB4E9 /* ASN1Node.m in Sources */, + 67C9B8960E4607FD004DB4E9 /* berd.m in Sources */, + 67C9B89D0E460999004DB4E9 /* NSData+Utils.m in Sources */, + 67826B0D0E4D8000009312C6 /* HexNumberFormatter.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C1660FE840EACC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 1DDD58280DA1D0D100B32029 /* MyDocument.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD58290DA1D0D100B32029 /* English */, + ); + name = MyDocument.xib; + sourceTree = ""; + }; + 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 1DDD582B0DA1D0D100B32029 /* English */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 2A37F4BAFDCFA73011CA2CEA /* English */, + ); + name = Credits.rtf; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C05733C808A9546B00998B17 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "ASN.1 Dump_Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = "ASN.1 Dump"; + }; + name = Debug; + }; + C05733C908A9546B00998B17 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "ASN.1 Dump_Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = "ASN.1 Dump"; + }; + name = Release; + }; + C05733CC08A9546B00998B17 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + C05733CD08A9546B00998B17 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_ACTUAL)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "ASN.1 Dump" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05733C808A9546B00998B17 /* Debug */, + C05733C908A9546B00998B17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "ASN.1 Dump" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05733CC08A9546B00998B17 /* Debug */, + C05733CD08A9546B00998B17 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */; +} diff --git a/ASN.1 Dump_Prefix.pch b/ASN.1 Dump_Prefix.pch new file mode 100644 index 0000000..8f8a4eb --- /dev/null +++ b/ASN.1 Dump_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'ASN.1 Dump' target in the 'ASN.1 Dump' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/ASN1Node.h b/ASN1Node.h new file mode 100644 index 0000000..2bbcc0c --- /dev/null +++ b/ASN1Node.h @@ -0,0 +1,34 @@ +// +// ASN1Node.h +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import + +@interface ASN1Node : NSObject { + NSString *tag; + NSString *length; + NSString *value; + NSNumber *offset; + NSMutableArray *children; +} + ++ (id)nodeWithTag:(NSString *)s offset:(NSNumber *)p; ++ (id)nodeWithTag:(NSString *)s; + +- (id)initWithTag:(NSString *)s; +- (id)initWithTag:(NSString *)s offset:(NSNumber *)p; + +- (void)setTag:(NSString *)s; +- (void)setLength:(NSString *)s; +- (void)setValue:(NSString *)s; +- (NSString *)string; +- (NSNumber *)offset; + +- (void)addChild:(ASN1Node *)n; +- (ASN1Node *)child:(NSInteger)i; +- (NSInteger)numberOfChildren; +@end diff --git a/ASN1Node.m b/ASN1Node.m new file mode 100644 index 0000000..083d9bd --- /dev/null +++ b/ASN1Node.m @@ -0,0 +1,110 @@ +// +// ASN1Node.m +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import "ASN1Node.h" + +@implementation ASN1Node + ++ (id)nodeWithTag:(NSString *)s offset:(NSNumber *)p +{ + ASN1Node *n = [[ASN1Node alloc] initWithTag:s offset:p]; + return [n autorelease]; +} + ++ (id)nodeWithTag:(NSString *)s +{ + ASN1Node *n = [[ASN1Node alloc] initWithTag:s offset:nil]; + return [n autorelease]; +} + +- (id)initWithTag:(NSString *)s offset:(NSNumber *)p +{ + self = [super init]; + tag = [s copy]; + length = nil; + value = nil; + offset = [p copy]; + children = [[NSMutableArray array] retain]; + return self; +} + +- (id)initWithTag:(NSString *)s +{ + return [self initWithTag:s offset:nil]; +} + +- (void)dealloc +{ + [children release], children = nil; + [tag release], tag = nil; + [length release], length = nil; + [value release], value = nil; + [offset release], offset = nil; + [super dealloc]; +} + +- (NSString *)description +{ + return [NSString stringWithFormat:@"(%d) %@ %@ %@ children %@", offset, tag, length, value, children]; +} + +- (void)setTag:(NSString *)s +{ + [s retain]; + [tag release]; + tag = s; +} + +- (void)setLength:(NSString *)s +{ + [s retain]; + [length release]; + length = s; +} + +- (void)setValue:(NSString *)s +{ + [s retain]; + [value release]; + value = s; +} + +- (NSString *)string +{ + if (tag != nil && length == nil && value == nil) + return [NSString stringWithFormat:@"%@", tag]; + if (tag != nil && length != nil && value == nil) + return [NSString stringWithFormat:@"%@ %@", tag, length]; + if (tag != nil && length != nil && value != nil) + return [NSString stringWithFormat:@"%@ %@ %@", tag, length, value]; + if (tag != nil && length == nil && value != nil) + return [NSString stringWithFormat:@"%@ %@", tag, value]; + return @""; +} + +- (NSNumber *)offset +{ + return offset; +} + +- (void)addChild:(ASN1Node *)n +{ + [children addObject:n]; +} + +- (ASN1Node *)child:(NSInteger)i +{ + return [children objectAtIndex:i]; +} + +- (NSInteger)numberOfChildren +{ + return [children count]; +} + +@end diff --git a/English.lproj/Credits.rtf b/English.lproj/Credits.rtf new file mode 100644 index 0000000..46576ef --- /dev/null +++ b/English.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..dea12de Binary files /dev/null and b/English.lproj/InfoPlist.strings differ diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib new file mode 100644 index 0000000..4b65230 --- /dev/null +++ b/English.lproj/MainMenu.xib @@ -0,0 +1,2995 @@ + + + + 1050 + 9E17 + 670 + 949.33 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + ASN.1 Dump + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + ASN.1 Dump + + YES + + + About ASN.1 Dump + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + UHJlZmVyZW5jZXPigKY + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide ASN.1 Dump + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit ASN.1 Dump + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + File + + 1048576 + 2147483647 + + + submenuAction: + + File + + YES + + + New + n + 1048576 + 2147483647 + + + + + + T3BlbuKApg + o + 1048576 + 2147483647 + + + + + + Open Recent + + 1048576 + 2147483647 + + + submenuAction: + + Open Recent + + YES + + + Clear Menu + + 1048576 + 2147483647 + + + + + _NSRecentDocumentsMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Close + w + 1048576 + 2147483647 + + + + + + Save + s + 1048576 + 2147483647 + + + + + + U2F2ZSBBc+KApg + S + 1179648 + 2147483647 + + + + + + Revert to Saved + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Page Setup... + P + 1179648 + 2147483647 + + + + + + + UHJpbnTigKY + p + 1048576 + 2147483647 + + + + + + + + + Edit + + 1048576 + 2147483647 + + + submenuAction: + + Edit + + YES + + + Undo + z + 1048576 + 2147483647 + + + + + + Redo + Z + 1179648 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Cut + x + 1048576 + 2147483647 + + + + + + Copy + c + 1048576 + 2147483647 + + + + + + Paste + v + 1048576 + 2147483647 + + + + + + Delete + + 1048576 + 2147483647 + + + + + + Select All + a + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Find + + 1048576 + 2147483647 + + + submenuAction: + + Find + + YES + + + RmluZOKApg + f + 1048576 + 2147483647 + + + 1 + + + + Find Next + g + 1048576 + 2147483647 + + + 2 + + + + Find Previous + G + 1179648 + 2147483647 + + + 3 + + + + Use Selection for Find + e + 1048576 + 2147483647 + + + 7 + + + + Jump to Selection + j + 1048576 + 2147483647 + + + + + + + + + Spelling and Grammar + + 1048576 + 2147483647 + + + submenuAction: + + Spelling and Grammar + + YES + + + U2hvdyBTcGVsbGluZ+KApg + : + 1048576 + 2147483647 + + + + + + Check Spelling + ; + 1048576 + 2147483647 + + + + + + Check Spelling While Typing + + 1048576 + 2147483647 + + + + + + Check Grammar With Spelling + + 1048576 + 2147483647 + + + + + + + + + Substitutions + + 1048576 + 2147483647 + + + submenuAction: + + Substitutions + + YES + + + Smart Copy/Paste + f + 1048576 + 2147483647 + + + 1 + + + + Smart Quotes + g + 1048576 + 2147483647 + + + 2 + + + + Smart Links + G + 1179648 + 2147483647 + + + 3 + + + + + + + Speech + + 1048576 + 2147483647 + + + submenuAction: + + Speech + + YES + + + Start Speaking + + 1048576 + 2147483647 + + + + + + Stop Speaking + + 1048576 + 2147483647 + + + + + + + + + + + + Format + + 2147483647 + + + submenuAction: + + Format + + YES + + + Font + + 2147483647 + + + submenuAction: + + Font + + YES + + + Show Fonts + t + 1048576 + 2147483647 + + + + + + Bold + b + 1048576 + 2147483647 + + + 2 + + + + Italic + i + 1048576 + 2147483647 + + + 1 + + + + Underline + u + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Bigger + + + 1048576 + 2147483647 + + + 3 + + + + Smaller + - + 1048576 + 2147483647 + + + 4 + + + + YES + YES + + + 2147483647 + + + + + + Kern + + 2147483647 + + + submenuAction: + + Kern + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Tighten + + 2147483647 + + + + + + Loosen + + 2147483647 + + + + + + + + + Ligature + + 2147483647 + + + submenuAction: + + Ligature + + YES + + + Use Default + + 2147483647 + + + + + + Use None + + 2147483647 + + + + + + Use All + + 2147483647 + + + + + + + + + Baseline + + 2147483647 + + + submenuAction: + + Baseline + + YES + + + Use Default + + 2147483647 + + + + + + Superscript + + 2147483647 + + + + + + Subscript + + 2147483647 + + + + + + Raise + + 2147483647 + + + + + + Lower + + 2147483647 + + + + + + + + + YES + YES + + + 2147483647 + + + + + + Show Colors + C + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Copy Style + c + 1572864 + 2147483647 + + + + + + Paste Style + v + 1572864 + 2147483647 + + + + + _NSFontMenu + + + + + Text + + 2147483647 + + + submenuAction: + + Text + + YES + + + Align Left + { + 1048576 + 2147483647 + + + + + + Center + | + 1048576 + 2147483647 + + + + + + Justify + + 2147483647 + + + + + + Align Right + } + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Show Ruler + + 2147483647 + + + + + + Copy Ruler + c + 1310720 + 2147483647 + + + + + + Paste Ruler + v + 1310720 + 2147483647 + + + + + + + + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Show Toolbar + t + 1572864 + 2147483647 + + + + + + Q3VzdG9taXplIFRvb2xiYXLigKY + + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 1048576 + 2147483647 + + + submenuAction: + + Help + + YES + + + ASN.1 Dump Help + ? + 1048576 + 2147483647 + + + + + + + + _NSMainMenu + + + NSFontManager + + + + + YES + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + runPageLayout: + + + + 87 + + + + clearRecentDocuments: + + + + 127 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + performClose: + + + + 193 + + + + toggleContinuousSpellChecking: + + + + 222 + + + + undo: + + + + 223 + + + + copy: + + + + 224 + + + + checkSpelling: + + + + 225 + + + + paste: + + + + 226 + + + + stopSpeaking: + + + + 227 + + + + cut: + + + + 228 + + + + showGuessPanel: + + + + 230 + + + + redo: + + + + 231 + + + + selectAll: + + + + 232 + + + + startSpeaking: + + + + 233 + + + + delete: + + + + 235 + + + + performZoom: + + + + 240 + + + + performFindPanelAction: + + + + 241 + + + + centerSelectionInVisibleArea: + + + + 245 + + + + toggleGrammarChecking: + + + + 347 + + + + toggleSmartInsertDelete: + + + + 355 + + + + toggleAutomaticQuoteSubstitution: + + + + 356 + + + + toggleAutomaticLinkDetection: + + + + 357 + + + + showHelp: + + + + 360 + + + + saveDocument: + + + + 362 + + + + saveDocumentAs: + + + + 363 + + + + revertDocumentToSaved: + + + + 364 + + + + runToolbarCustomizationPalette: + + + + 365 + + + + toggleToolbarShown: + + + + 366 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + newDocument: + + + + 371 + + + + openDocument: + + + + 372 + + + + printDocument: + + + + 373 + + + + addFontTrait: + + + + 420 + + + + addFontTrait: + + + + 421 + + + + modifyFont: + + + + 422 + + + + orderFrontFontPanel: + + + + 423 + + + + modifyFont: + + + + 424 + + + + raiseBaseline: + + + + 425 + + + + lowerBaseline: + + + + 426 + + + + copyFont: + + + + 427 + + + + subscript: + + + + 428 + + + + superscript: + + + + 429 + + + + tightenKerning: + + + + 430 + + + + underline: + + + + 431 + + + + orderFrontColorPanel: + + + + 432 + + + + useAllLigatures: + + + + 433 + + + + loosenKerning: + + + + 434 + + + + pasteFont: + + + + 435 + + + + unscript: + + + + 436 + + + + useStandardKerning: + + + + 437 + + + + useStandardLigatures: + + + + 438 + + + + turnOffLigatures: + + + + 439 + + + + turnOffKerning: + + + + 440 + + + + alignLeft: + + + + 441 + + + + alignJustified: + + + + 442 + + + + copyRuler: + + + + 443 + + + + alignCenter: + + + + 444 + + + + toggleRuler: + + + + 445 + + + + alignRight: + + + + 446 + + + + pasteRuler: + + + + 447 + + + + terminate: + + + + 448 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + + MainMenu + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 103 + + + YES + + + + 1 + + + 217 + + + YES + + + + + + 83 + + + YES + + + + + + 81 + + + YES + + + + + + + + + + + + + + + + 75 + + + 3 + + + 80 + + + 8 + + + 78 + + + 6 + + + 72 + + + + + 82 + + + 9 + + + 124 + + + YES + + + + + + 77 + + + 5 + + + 73 + + + 1 + + + 79 + + + 7 + + + 112 + + + 10 + + + 74 + + + 2 + + + 125 + + + YES + + + + + + 126 + + + + + 205 + + + YES + + + + + + + + + + + + + + + + + + 202 + + + + + 198 + + + + + 207 + + + + + 214 + + + + + 199 + + + + + 203 + + + + + 197 + + + + + 206 + + + + + 215 + + + + + 218 + + + YES + + + + + + 216 + + + YES + + + + + + 200 + + + YES + + + + + + + + + 219 + + + + + 201 + + + + + 204 + + + + + 220 + + + YES + + + + + + + + + + 213 + + + + + 210 + + + + + 221 + + + + + 208 + + + + + 209 + + + + + 106 + + + YES + + + + 2 + + + 111 + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + 1111 + + + 144 + + + + + 129 + + + 121 + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + + 297 + + + + + 298 + + + + + 211 + + + YES + + + + + + 212 + + + YES + + + + + + + 195 + + + + + 196 + + + + + 346 + + + + + 348 + + + YES + + + + + + 349 + + + YES + + + + + + + + 350 + + + + + 351 + + + + + 354 + + + + + 374 + + + YES + + + + + + 375 + + + YES + + + + + + + 376 + + + YES + + + + + + 377 + + + YES + + + + + + 378 + + + YES + + + + + + + + + + + + + 379 + + + + + 380 + + + + + 381 + + + + + 382 + + + + + 383 + + + + + 384 + + + + + 385 + + + + + 386 + + + + + 387 + + + YES + + + + + + + + + + + + + + + + + + + + + 388 + + + + + 389 + + + + + 390 + + + + + 391 + + + + + 392 + + + + + 393 + + + + + 394 + + + + + 395 + + + + + 396 + + + YES + + + + + + 397 + + + YES + + + + + + 398 + + + YES + + + + + + 399 + + + + + 400 + + + + + 401 + + + + + 402 + + + + + 403 + + + + + 404 + + + YES + + + + + + + + + + 405 + + + + + 406 + + + + + 407 + + + + + 408 + + + + + 409 + + + + + 410 + + + YES + + + + + + + + 411 + + + + + 412 + + + + + 413 + + + + + 414 + + + YES + + + + + + + + + 415 + + + + + 416 + + + + + 417 + + + + + 418 + + + + + 419 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 103.IBPluginDependency + 103.ImportedFromIB2 + 106.IBEditorWindowLastContentRect + 106.IBPluginDependency + 106.ImportedFromIB2 + 106.editorWindowContentRectSynchronizationRect + 111.IBPluginDependency + 111.ImportedFromIB2 + 112.IBPluginDependency + 112.ImportedFromIB2 + 124.IBPluginDependency + 124.ImportedFromIB2 + 125.IBPluginDependency + 125.ImportedFromIB2 + 125.editorWindowContentRectSynchronizationRect + 126.IBPluginDependency + 126.ImportedFromIB2 + 129.IBPluginDependency + 129.ImportedFromIB2 + 130.IBPluginDependency + 130.ImportedFromIB2 + 130.editorWindowContentRectSynchronizationRect + 131.IBPluginDependency + 131.ImportedFromIB2 + 134.IBPluginDependency + 134.ImportedFromIB2 + 136.IBPluginDependency + 136.ImportedFromIB2 + 143.IBPluginDependency + 143.ImportedFromIB2 + 144.IBPluginDependency + 144.ImportedFromIB2 + 145.IBPluginDependency + 145.ImportedFromIB2 + 149.IBPluginDependency + 149.ImportedFromIB2 + 150.IBPluginDependency + 150.ImportedFromIB2 + 19.IBPluginDependency + 19.ImportedFromIB2 + 195.IBPluginDependency + 195.ImportedFromIB2 + 196.IBPluginDependency + 196.ImportedFromIB2 + 197.IBPluginDependency + 197.ImportedFromIB2 + 198.IBPluginDependency + 198.ImportedFromIB2 + 199.IBPluginDependency + 199.ImportedFromIB2 + 200.IBPluginDependency + 200.ImportedFromIB2 + 200.editorWindowContentRectSynchronizationRect + 201.IBPluginDependency + 201.ImportedFromIB2 + 202.IBPluginDependency + 202.ImportedFromIB2 + 203.IBPluginDependency + 203.ImportedFromIB2 + 204.IBPluginDependency + 204.ImportedFromIB2 + 205.IBEditorWindowLastContentRect + 205.IBPluginDependency + 205.ImportedFromIB2 + 205.editorWindowContentRectSynchronizationRect + 206.IBPluginDependency + 206.ImportedFromIB2 + 207.IBPluginDependency + 207.ImportedFromIB2 + 208.IBPluginDependency + 208.ImportedFromIB2 + 209.IBPluginDependency + 209.ImportedFromIB2 + 210.IBPluginDependency + 210.ImportedFromIB2 + 211.IBPluginDependency + 211.ImportedFromIB2 + 212.IBPluginDependency + 212.ImportedFromIB2 + 212.editorWindowContentRectSynchronizationRect + 213.IBPluginDependency + 213.ImportedFromIB2 + 214.IBPluginDependency + 214.ImportedFromIB2 + 215.IBPluginDependency + 215.ImportedFromIB2 + 216.IBPluginDependency + 216.ImportedFromIB2 + 217.IBPluginDependency + 217.ImportedFromIB2 + 218.IBPluginDependency + 218.ImportedFromIB2 + 219.IBPluginDependency + 219.ImportedFromIB2 + 220.IBPluginDependency + 220.ImportedFromIB2 + 220.editorWindowContentRectSynchronizationRect + 221.IBPluginDependency + 221.ImportedFromIB2 + 23.IBPluginDependency + 23.ImportedFromIB2 + 236.IBPluginDependency + 236.ImportedFromIB2 + 239.IBPluginDependency + 239.ImportedFromIB2 + 24.IBEditorWindowLastContentRect + 24.IBPluginDependency + 24.ImportedFromIB2 + 24.editorWindowContentRectSynchronizationRect + 29.IBEditorWindowLastContentRect + 29.IBPluginDependency + 29.ImportedFromIB2 + 29.WindowOrigin + 29.editorWindowContentRectSynchronizationRect + 295.IBPluginDependency + 296.IBEditorWindowLastContentRect + 296.IBPluginDependency + 296.editorWindowContentRectSynchronizationRect + 297.IBPluginDependency + 298.IBPluginDependency + 346.IBPluginDependency + 346.ImportedFromIB2 + 348.IBPluginDependency + 348.ImportedFromIB2 + 349.IBPluginDependency + 349.ImportedFromIB2 + 349.editorWindowContentRectSynchronizationRect + 350.IBPluginDependency + 350.ImportedFromIB2 + 351.IBPluginDependency + 351.ImportedFromIB2 + 354.IBPluginDependency + 354.ImportedFromIB2 + 374.IBPluginDependency + 375.IBEditorWindowLastContentRect + 375.IBPluginDependency + 376.IBPluginDependency + 377.IBPluginDependency + 378.IBPluginDependency + 379.IBPluginDependency + 380.IBPluginDependency + 381.IBPluginDependency + 382.IBPluginDependency + 383.IBPluginDependency + 384.IBPluginDependency + 385.IBPluginDependency + 386.IBPluginDependency + 387.IBPluginDependency + 388.IBPluginDependency + 389.IBPluginDependency + 390.IBPluginDependency + 391.IBPluginDependency + 392.IBPluginDependency + 393.IBPluginDependency + 394.IBPluginDependency + 395.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 400.IBPluginDependency + 401.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 404.IBPluginDependency + 405.IBPluginDependency + 406.IBPluginDependency + 407.IBPluginDependency + 408.IBPluginDependency + 409.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 413.IBPluginDependency + 414.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency + 418.IBPluginDependency + 5.IBPluginDependency + 5.ImportedFromIB2 + 56.IBPluginDependency + 56.ImportedFromIB2 + 57.IBEditorWindowLastContentRect + 57.IBPluginDependency + 57.ImportedFromIB2 + 57.editorWindowContentRectSynchronizationRect + 58.IBPluginDependency + 58.ImportedFromIB2 + 72.IBPluginDependency + 72.ImportedFromIB2 + 73.IBPluginDependency + 73.ImportedFromIB2 + 74.IBPluginDependency + 74.ImportedFromIB2 + 75.IBPluginDependency + 75.ImportedFromIB2 + 77.IBPluginDependency + 77.ImportedFromIB2 + 78.IBPluginDependency + 78.ImportedFromIB2 + 79.IBPluginDependency + 79.ImportedFromIB2 + 80.IBPluginDependency + 80.ImportedFromIB2 + 81.IBEditorWindowLastContentRect + 81.IBPluginDependency + 81.ImportedFromIB2 + 81.editorWindowContentRectSynchronizationRect + 82.IBPluginDependency + 82.ImportedFromIB2 + 83.IBPluginDependency + 83.ImportedFromIB2 + 92.IBPluginDependency + 92.ImportedFromIB2 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + {{450, 362}, {196, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{596, 852}, {216, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{522, 812}, {146, 23}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{436, 809}, {64, 6}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {275, 83}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{219, 142}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{197, 734}, {243, 243}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {167, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {241, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{379, 312}, {197, 73}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{525, 802}, {197, 73}} + {{57, 385}, {454, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + + {74, 862} + {{11, 977}, {478, 20}} + com.apple.InterfaceBuilder.CocoaPlugin + {{329, 342}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + {{475, 832}, {234, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{608, 612}, {215, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + {{263, 342}, {86, 43}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{69, 202}, {225, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{23, 794}, {245, 183}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + {{177, 182}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + {{155, 774}, {199, 203}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 448 + + + 0 + ../../CocoaDocApp.xcodeproj + 3 + + diff --git a/English.lproj/MyDocument.xib b/English.lproj/MyDocument.xib new file mode 100644 index 0000000..5ba72f4 --- /dev/null +++ b/English.lproj/MyDocument.xib @@ -0,0 +1,507 @@ + + + + 1050 + 11E53 + 2182 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 2182 + + + YES + NSView + NSOutlineView + NSScrollView + NSWindowTemplate + NSTextFieldCell + NSTableHeaderView + NSTableColumn + NSScroller + NSCustomObject + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + MyDocument + + + FirstResponder + + + 15 + 2 + {{133, 277}, {465, 371}} + 1886912512 + Window + NSWindow + View + + {94, 86} + + + 256 + + YES + + + 274 + + YES + + + 2304 + + YES + + + 4352 + {465, 355} + + YES + + + 256 + {465, 17} + + + + + + 256 + {{451, 0}, {16, 17}} + + + YES + + offset + 92 + 40 + 1000 + + 75628096 + 2048 + Offset + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 67239488 + 272761856 + Text + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 3 + YES + + + + string + 367 + 16 + 1000 + + 75628096 + 2048 + ASN.1 + + + + + + 67239488 + 272761856 + Text + + + + + + 3 + YES + + + + 3 + 2 + + 3 + MQA + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -759169024 + + + 4 + 15 + 0 + YES + 0 + 1 + 11 + + + + {{1, 17}, {465, 355}} + + + + + 6 + System + controlBackgroundColor + + + 4 + + + + 256 + {{451, 17}, {15, 349}} + + + _doScroller: + 37 + 0.13909779999999999 + + + + 256 + {{1, 357}, {459, 15}} + + 1 + + _doScroller: + 0.99778270000000002 + + + + 2304 + + YES + + + {{1, 0}, {465, 17}} + + + + + 4 + + + {{-1, -1}, {467, 373}} + + + 133170 + + + + + QSAAAEEgAABBmAAAQZgAAA + + + {465, 371} + + + {{0, 0}, {1440, 878}} + {94, 108} + {10000000000000, 10000000000000} + YES + + + NSApplication + + + + + YES + + + window + + + + 18 + + + + outline + + + + 100030 + + + + delegate + + + + 17 + + + + dataSource + + + + 100031 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + 5 + + + YES + + + + Window + + + 6 + + + YES + + + + + + -3 + + + Application + + + 100021 + + + YES + + + + + + + + + 100022 + + + + + 100023 + + + + + 100024 + + + YES + + + + + + + 100025 + + + + + 100026 + + + YES + + + + + + 100027 + + + YES + + + + + + 100032 + + + + + 100033 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 100021.IBPluginDependency + 100022.IBPluginDependency + 100023.IBPluginDependency + 100024.IBPluginDependency + 100025.IBPluginDependency + 100026.IBPluginDependency + 100027.IBPluginDependency + 100032.IBPluginDependency + 100033.IBPluginDependency + 5.IBPluginDependency + 5.IBWindowTemplateEditedContentRect + 6.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{89, 280}, {465, 371}} + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 100033 + + + + YES + + MyDocument + NSDocument + + outline + NSOutlineView + + + outline + + outline + NSOutlineView + + + + IBProjectSource + ./Classes/MyDocument.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + diff --git a/HexNumberFormatter.h b/HexNumberFormatter.h new file mode 100644 index 0000000..caf946b --- /dev/null +++ b/HexNumberFormatter.h @@ -0,0 +1,15 @@ +// +// HexNumberFormatter.h +// ASN.1 Dump +// +// Created by Chris on 09/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import + +@interface HexNumberFormatter : NSFormatter { + +} + +@end diff --git a/HexNumberFormatter.m b/HexNumberFormatter.m new file mode 100644 index 0000000..9972421 --- /dev/null +++ b/HexNumberFormatter.m @@ -0,0 +1,21 @@ +// +// HexNumberFormatter.m +// ASN.1 Dump +// +// Created by Chris on 09/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import "HexNumberFormatter.h" + +@implementation HexNumberFormatter + +- (NSString *)stringForObjectValue:(id)anObject +{ + if (![anObject isKindOfClass:[NSNumber class]]) { + return nil; + } + return [NSString stringWithFormat:@"%08lx", [anObject integerValue]]; +} + +@end diff --git a/Info.plist b/Info.plist new file mode 100644 index 0000000..ffe88c5 --- /dev/null +++ b/Info.plist @@ -0,0 +1,55 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + cer + ber + der + bin + p7b + p12 + pfx + + CFBundleTypeIconFile + + CFBundleTypeName + DocumentType + CFBundleTypeOSTypes + + ???? + + CFBundleTypeRole + Viewer + NSDocumentClass + MyDocument + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/MyDocument.h b/MyDocument.h new file mode 100644 index 0000000..ab91305 --- /dev/null +++ b/MyDocument.h @@ -0,0 +1,18 @@ +// +// MyDocument.h +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + + +#import + +@class ASN1Node; +@interface MyDocument : NSDocument +{ + IBOutlet NSOutlineView *outline; + ASN1Node *doc; +} +@end diff --git a/MyDocument.m b/MyDocument.m new file mode 100644 index 0000000..75db420 --- /dev/null +++ b/MyDocument.m @@ -0,0 +1,116 @@ +// +// MyDocument.m +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import "MyDocument.h" +#import "ASN1Node.h" +#import "HexNumberFormatter.h" +#import "berd.h" + +@implementation MyDocument + +- (id)init +{ + self = [super init]; + if (self) { + + // Add your subclass-specific initialization here. + // If an error occurs here, send a [self release] message and return nil. + doc = [[ASN1Node alloc] initWithTag:nil]; + } + return self; +} + +- (void)dealloc +{ + [doc release], doc = nil; + [super dealloc]; +} + +- (NSString *)windowNibName +{ + // Override returning the nib file name of the document + // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. + return @"MyDocument"; +} + +- (void)awakeFromNib +{ + HexNumberFormatter *h = [[HexNumberFormatter alloc] init]; + [[[outline tableColumnWithIdentifier:@"offset"] dataCell] setFormatter:h]; + [h release]; +} + +- (void)windowControllerDidLoadNib:(NSWindowController *) aController +{ + [super windowControllerDidLoadNib:aController]; + // Add any code here that needs to be executed once the windowController has loaded the document's window. +} + +- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError +{ + // Insert code here to write your document to data of the specified type. If the given outError != NULL, ensure that you set *outError when returning nil. + + // You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead. + + // For applications targeted for Panther or earlier systems, you should use the deprecated API -dataRepresentationOfType:. In this case you can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead. + + if ( outError != NULL ) { + *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; + } + return nil; +} + +- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError +{ + // Insert code here to read your document from the given data of the specified type. If the given outError != NULL, ensure that you set *outError when returning NO. + + // You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead. + + // For applications targeted for Panther or earlier systems, you should use the deprecated API -loadDataRepresentation:ofType. In this case you can also choose to override -readFromFile:ofType: or -loadFileWrapperRepresentation:ofType: instead. + + // Figure out a way to handle PEM-encoded files here + dump(data, 0, [data length], doc, standard); + [outline reloadData]; + + if ( outError != NULL ) { + *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; + } + return YES; +} + +#pragma mark OutlineView data source + +- (id)outlineView:(NSOutlineView *)outlineView + child:(NSInteger)index + ofItem:(id)item +{ + ASN1Node *n = item ? item : doc; + return [n child:index]; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView + isItemExpandable:(id)item +{ + ASN1Node *n = item ? item : doc; + return [n numberOfChildren] > 0; +} + +- (NSInteger)outlineView:(NSOutlineView *)outlineView + numberOfChildrenOfItem:(id)item +{ + ASN1Node *n = item ? item : doc; + return [n numberOfChildren]; +} + +- (id)outlineView:(NSOutlineView *)outlineView +objectValueForTableColumn:(NSTableColumn *)tableColumn + byItem:(id)item +{ + return [item valueForKey:[tableColumn identifier]]; +} +@end diff --git a/NSData+Utils.h b/NSData+Utils.h new file mode 100644 index 0000000..f4147be --- /dev/null +++ b/NSData+Utils.h @@ -0,0 +1,21 @@ +// +// NSData+Utils.h +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import + + +@interface NSData (Utils) + +- (NSInteger)byteAtOffset:(NSInteger)p; + +- (NSData *)dataFromPEMData; + +- (id)initWithBase64Bytes:(const char *)base64Bytes + length:(unsigned long)lentext; + +@end diff --git a/NSData+Utils.m b/NSData+Utils.m new file mode 100644 index 0000000..2562494 --- /dev/null +++ b/NSData+Utils.m @@ -0,0 +1,113 @@ +// +// NSData+Utils.m +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import "NSData+Utils.h" + +@implementation NSData (Utils) + +- (NSInteger)byteAtOffset:(NSInteger)p +{ + char c; + + [self getBytes: &c range:NSMakeRange(p,1)]; + return (NSInteger)c & 0xff; +} + +// PEM files look like (according to OpenSSL crypto/pem/pem_lib.c, and a quick +// look at RFC 1421) +// -----BEGIN(stuff)-----\n +// key:value\n (optional, multiple) +// \n(blank line) +// base64-encoded data +// -----END(stuff)-----\n +- (NSData *)dataFromPEMData +{ + NSInteger length = [self length]; + const char *bytes = [self bytes]; + if (length > strlen("-----BEGIN") && + strncmp(bytes, "-----BEGIN", strlen("-----BEGIN")) != 0) + return nil; + + NSInteger i; + for (i = strlen("-----BEGIN"); i < length - 1; i++) { + if (strncmp(bytes + i, "\n\n", strlen("\n\n")) == 0) { + NSLog(@"Base64 data probably at %ld", i + 2); + NSInteger j; + for (j = length - 1 - strlen("\n-----END"); j > i + 2; j--) { + if (strncmp(bytes + j, "\n-----END", strlen("\n-----END")) == 0) { + NSLog(@"Base64 ends at %ld", j - 1); + NSMutableData *d = [[NSMutableData alloc] initWithBase64Bytes:bytes + i + 2 + length: j - (i + 2)]; + return [d autorelease]; + } + } + // not found the -----END + return nil; + } + } + return nil; +} + +- (id)initWithBase64Bytes:(const char *)base64Bytes + length:(unsigned long)lentext +{ + unsigned long ixtext = 0; + unsigned char ch = 0; + unsigned char inbuf[4], outbuf[3]; + short i = 0, ixinbuf = 0; + BOOL flignore = NO; + BOOL flendtext = NO; + + NSMutableData *mutableData = [NSMutableData dataWithCapacity:lentext]; + + while (YES) { + if (ixtext >= lentext) break; + ch = base64Bytes[ixtext++]; + flignore = NO; + + if ((ch >= 'A') && (ch <= 'Z')) ch = ch - 'A'; + else if ((ch >= 'a') && (ch <= 'z')) ch = ch - 'a' + 26; + else if ((ch >= '0') && (ch <= '9')) ch = ch - '0' + 52; + else if (ch == '+') ch = 62; + else if (ch == '=') flendtext = YES; + else if (ch == '/') ch = 63; + else flignore = YES; + + if (!flignore) { + short ctcharsinbuf = 3; + BOOL flbreak = NO; + + if (flendtext) { + if (!ixinbuf) break; + if ((ixinbuf == 1) || (ixinbuf == 2)) ctcharsinbuf = 1; + else ctcharsinbuf = 2; + ixinbuf = 3; + flbreak = YES; + } + + inbuf[ixinbuf++] = ch; + + if (ixinbuf == 4) { + ixinbuf = 0; + outbuf[0] = (inbuf[0] << 2) | ((inbuf[1] & 0x30) >> 4); + outbuf[1] = ((inbuf[1] & 0x0F) << 4) | ((inbuf[2] & 0x3C) >> 2); + outbuf[2] = ((inbuf[2] & 0x03) << 6) | (inbuf[3] & 0x3F); + + for (i = 0; i < ctcharsinbuf; i++) + [mutableData appendBytes:&outbuf[i] length:1]; + } + + if (flbreak) break; + } + } + + self = [self initWithData:mutableData]; + return self; +} + +@end diff --git a/README.md b/README.md index 6d060ed..1ee699d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ asn1-dump ========= -Display the structured content of ASN.1 encoded files \ No newline at end of file +Display the structured content of ASN.1 encoded files diff --git a/berd.h b/berd.h new file mode 100644 index 0000000..934a1c4 --- /dev/null +++ b/berd.h @@ -0,0 +1,7 @@ +#import + +enum Display {none = 0, standard, foldtext, foldoctet, foldbit}; + +@class ASN1Node; + +extern NSInteger dump(NSData *, NSInteger, NSInteger, ASN1Node *, enum Display); \ No newline at end of file diff --git a/berd.m b/berd.m new file mode 100644 index 0000000..f2142ed --- /dev/null +++ b/berd.m @@ -0,0 +1,1967 @@ +/* + * Dump a BER-encoded file to stdout + * + * Copyright Chris Ridd, 1993-2012 + * + * If string folding occurs, the length printed is incorrect. The printed + * length is the length of the outer type, which will be more than the actual + * number of octets in the constructed string + */ +#import +#import "NSData+Utils.h" +#import "ASN1Node.h" +#import "berd.h" + +#include +#include +#include +#include +#include + +/* + * BER tag classes + * + */ +enum classes { + UNIVERSAL = 0x00, + APPLICATION = 0x01, + CONTEXT = 0x02, + PRIVATE = 0x03 +}; + + +/* + * Globals + * + */ +int fold = 0; // 1 means fold constructed strings together +int textoctets = 0; // 1 means display OCTETs as text +int lengths = 1; // 0 means do not display length value +int encapsulated = 1; // 1 means look for encapsulated data + +const char *univTags[] = { + "BOOLEAN", + "INTEGER", + "BIT STRING", + "OCTET STRING", + "NULL", + "OBJECT IDENTIFIER", + "ObjectDescriptor", + "EXTERNAL", + "REAL", + "ENUMERATED", + NULL, /* 11 (reserved by ISO) */ + "UTF8String", + "RELATIVE-OID", + NULL, /* 14 */ + NULL, /* 15 */ + "SEQUENCE", + "SET", + "NumericString", + "PrintableString", + "TeletexString", + "VideotexString", + "IA5String", + "UTCTime", + "GeneralizedTime", + "GraphicString", + "VisibleString", + "GeneralString", + "UniversalString", + NULL, /* 29 */ + "BMPString" +}; +#define numTags ((int)(sizeof(univTags) / sizeof(univTags[0]))) + +enum tags { + ASN1_BOOLEAN = 1, + ASN1_INTEGER = 2, + ASN1_BIT_STRING = 3, + ASN1_OCTET_STRING = 4, + ASN1_NULL = 5, + ASN1_OBJECT_IDENTIFIER = 6, + ASN1_ObjectDescriptor = 7, + ASN1_EXTERNAL = 8, + ASN1_REAL = 9, + ASN1_ENUMERATED = 10, + ASN1_EMBEDDED_PDV = 11, + ASN1_UTF8String = 12, + ASN1_RELATIVE_OID = 13, + /* 14 */ + /* 15 */ + ASN1_SEQUENCE = 16, + ASN1_SET = 17, + ASN1_NumericString = 18, + ASN1_PrintableString = 19, + ASN1_TeletexString = 20, + ASN1_VideotexString = 21, + ASN1_IA5String = 22, + ASN1_UTCTime = 23, + ASN1_GeneralizedTime = 24, + ASN1_GraphicString = 25, + ASN1_VisibleString = 26, + ASN1_GeneralString = 27, + ASN1_UniversalString = 28, + /* 29 */ + ASN1_BMPString = 30 +}; + +typedef struct { + int t_class; + int t_encode; + int t_tagnum; +} Tag; + +NSInteger dump(NSData *d, NSInteger pos, NSInteger checkpt, ASN1Node *parent, enum Display display); + +/* + * Print a tag name and length value + * + */ +ASN1Node *printTL(Tag *tag, NSInteger pos, long len, enum Display subdisplay) +{ + const char *s; + + NSString *t = nil; + switch (tag->t_class) { + case UNIVERSAL: + s = NULL; + if (tag->t_tagnum > 0 && tag->t_tagnum < numTags) + s = univTags[tag->t_tagnum - 1]; + if (s) + t = [NSString stringWithFormat: @"%s", s]; + else + t = [NSString stringWithFormat:@"[UNIVERSAL %d]", tag->t_tagnum]; + break; + case APPLICATION: + t = [NSString stringWithFormat:@"[APPLICATION %d]", tag->t_tagnum]; + break; + case CONTEXT: + t = [NSString stringWithFormat:@"[%d]", tag->t_tagnum]; + break; + case PRIVATE: + t = [NSString stringWithFormat:@"[PRIVATE %d]", tag->t_tagnum]; + break; + } + ASN1Node *n = [ASN1Node nodeWithTag:t offset:[NSNumber numberWithInteger:pos]]; + + if (lengths) + [n setLength:[NSString stringWithFormat:@"-- %ld octet%@ --", len, len == 1 ? @"" : @"s"]]; + + /* + * If a folded string, print the string prefix (like a ") + * If any other constructed type, or no folding, print a brace + * + */ + NSString *v = nil; + if (tag->t_encode) { + if (tag->t_class == 0) { + if (subdisplay == standard) { + v = @"{"; + } + } else { + v = @"{"; + } + [n setValue:v]; + } + + return n; +} + +/* + * Print a bit string + * + */ +NSString *printBit(NSData *d, NSInteger pos, long len) +{ + int unused; // Unused bits at end of string + int num; + int mask; + long n; + int c; + int i; + NSMutableString *value = [NSMutableString stringWithString:@"\'"]; + + unused = [d byteAtOffset:pos++]; + for (n = 0; n < (len - 1); n++) { + num = (n == len - 2) ? 8 - unused : 8; + c = [d byteAtOffset:pos++]; + for (i = 1, mask = 0x80; i <= num; i++, mask >>= 1) + [value appendString:(c & mask) ? @"1" : @"0"]; + } + [value appendString:@"\'B"]; + return value; +} + +/* + * Print an octet string + * + */ +NSString *printOctet(NSData *d, NSInteger pos, long len) +{ + long n; + NSMutableString *value = [NSMutableString string]; + + for (n = 0; n < len; n++) + [value appendFormat:@"%02x", [d byteAtOffset:pos++]]; + return value; +} + +/* + * Print a text string + * All escape characters are printed as per ANSI C (ie \n etc) + * Unknown escape characters are printed in hex + * + */ +NSString *printText(NSData *d, NSInteger pos, long len) +{ + long n; + int c; + NSMutableString *value = [NSMutableString string]; + + for (n = 0; n < len; n++) { + c = [d byteAtOffset:pos++]; + switch (c) { + case '\n': [value appendString:@"\\n"]; break; + case '\t': [value appendString:@"\\t"]; break; + case '\v': [value appendString:@"\\v"]; break; + case '\b': [value appendString:@"\\b"]; break; + case '\r': [value appendString:@"\\r"]; break; + case '\f': [value appendString:@"\\f"]; break; + case '\a': [value appendString:@"\\a"]; break; + case '\\': [value appendString:@"\\\\"]; break; + case '\?': [value appendString:@"\\?"]; break; + case '\'': [value appendString:@"\\\'"]; break; + case '\"': [value appendString:@"\\\""]; break; + default: if (iscntrl(c) || c > 0x7f) + [value appendFormat:@"\\x%02x", c]; + else + [value appendFormat:@"%c", c]; + break; + } + } + return value; +} + +/* + * Read Tag octet(s) + * Returns new pos + * + */ +NSInteger readT(NSData *d, NSInteger pos, Tag *t) +{ + Tag tag; + int c; + + c = [d byteAtOffset:pos++]; + + tag.t_class = (c >> 6) & 0x03; + tag.t_encode = (c >> 5) & 0x01; + tag.t_tagnum = c & 0x1f; + + if (tag.t_tagnum == 0x1f) { // Read further octets + tag.t_tagnum = 0; + while ((c = [d byteAtOffset:pos++]) && c & 0x80) + tag.t_tagnum = (tag.t_tagnum << 7) | c; + // Potential overflow... + } + *t = tag; + return pos; +} + +/* + * Check if there's encapsulated data + * Sniff the initial tag and length to see if the data looks + * decodable. Based on Peter Gutmann's dumpasn1 heuristics. + * + */ +int isEncapsulated(NSData *d, NSInteger pos, long outerlen) +{ + Tag tag; + long len; + + if (encapsulated == 0) + return 0; + + // minimal size of a tag+length is 2 bytes + if (outerlen < 2) + return 0; + + @try { + NSInteger newpos = readT(d, pos, &tag); + + // extended tags suggest it isn't BER + if (tag.t_tagnum == 0x1f) { + return 0; + } + + // only allow UNIVERSAL or CONTEXT classes + if (tag.t_class != UNIVERSAL && tag.t_class != CONTEXT) { + return 0; + } + + int c = [d byteAtOffset: newpos++]; + + if (c == 0x80) { // indefinite length + return 0; + } else if (c & 0x80) { + long nlen = c & 0x7f; + len = 0; + for (c = 0; c < nlen; c++) { + len = (len << 8) | ([d byteAtOffset:newpos++] & 0xff); + // Potential overflow... + } + } else { + len = c & 0x7f; + } + outerlen -= (newpos - pos); // account for extra tag and len? + } + // if we get a range exception, it wasn't BER! + @catch (NSException *e) { + return 0; + } + + // sanity check length matches len here + if (outerlen == len) + return 1; + + return 0; +} + +/* + * Print a value. + * Never called for a constructed type (SET/SEQ or IMPLICIT SET/SEQ) + * + */ +NSString *printV(NSData *d, NSInteger pos, Tag *tag, long len, NSInteger *decapsulatePos, long *decapsulateLen) +{ + int c; + long n; + long iv; + static NSMutableDictionary *oid = nil; + NSMutableString *value = [NSMutableString string]; + + if (oid == nil) { + oid = [[NSMutableDictionary alloc] init]; + [oid setObject:@"Telesec" forKey:@"0.2.262.1.10"]; + [oid setObject:@"extension" forKey:@"0.2.262.1.10.0"]; + [oid setObject:@"mechanism" forKey:@"0.2.262.1.10.1"]; + [oid setObject:@"authentication" forKey:@"0.2.262.1.10.1.0"]; + [oid setObject:@"passwordAuthentication" forKey:@"0.2.262.1.10.1.0.1"]; + [oid setObject:@"protectedPasswordAuthentication" forKey:@"0.2.262.1.10.1.0.2"]; + [oid setObject:@"oneWayX509Authentication" forKey:@"0.2.262.1.10.1.0.3"]; + [oid setObject:@"twoWayX509Authentication" forKey:@"0.2.262.1.10.1.0.4"]; + [oid setObject:@"threeWayX509Authentication" forKey:@"0.2.262.1.10.1.0.5"]; + [oid setObject:@"oneWayISO9798Authentication" forKey:@"0.2.262.1.10.1.0.6"]; + [oid setObject:@"twoWayISO9798Authentication" forKey:@"0.2.262.1.10.1.0.7"]; + [oid setObject:@"telekomAuthentication" forKey:@"0.2.262.1.10.1.0.8"]; + [oid setObject:@"signature" forKey:@"0.2.262.1.10.1.1"]; + [oid setObject:@"md4WithRSAAndISO9697" forKey:@"0.2.262.1.10.1.1.1"]; + [oid setObject:@"md4WithRSAAndTelesecSignatureStandard" forKey:@"0.2.262.1.10.1.1.2"]; + [oid setObject:@"md5WithRSAAndISO9697" forKey:@"0.2.262.1.10.1.1.3"]; + [oid setObject:@"md5WithRSAAndTelesecSignatureStandard" forKey:@"0.2.262.1.10.1.1.4"]; + [oid setObject:@"ripemd160WithRSAAndTelekomSignatureStandard" forKey:@"0.2.262.1.10.1.1.5"]; + [oid setObject:@"hbciRsaSignature" forKey:@"0.2.262.1.10.1.1.9"]; + [oid setObject:@"encryption" forKey:@"0.2.262.1.10.1.2"]; + [oid setObject:@"none" forKey:@"0.2.262.1.10.1.2.0"]; + [oid setObject:@"rsaTelesec" forKey:@"0.2.262.1.10.1.2.1"]; + [oid setObject:@"des" forKey:@"0.2.262.1.10.1.2.2"]; + [oid setObject:@"desECB" forKey:@"0.2.262.1.10.1.2.2.1"]; + [oid setObject:@"desCBC" forKey:@"0.2.262.1.10.1.2.2.2"]; + [oid setObject:@"desOFB" forKey:@"0.2.262.1.10.1.2.2.3"]; + [oid setObject:@"desCFB8" forKey:@"0.2.262.1.10.1.2.2.4"]; + [oid setObject:@"desCFB64" forKey:@"0.2.262.1.10.1.2.2.5"]; + [oid setObject:@"des3" forKey:@"0.2.262.1.10.1.2.3"]; + [oid setObject:@"des3ECB" forKey:@"0.2.262.1.10.1.2.3.1"]; + [oid setObject:@"des3CBC" forKey:@"0.2.262.1.10.1.2.3.2"]; + [oid setObject:@"des3OFB" forKey:@"0.2.262.1.10.1.2.3.3"]; + [oid setObject:@"des3CFB8" forKey:@"0.2.262.1.10.1.2.3.4"]; + [oid setObject:@"des3CFB64" forKey:@"0.2.262.1.10.1.2.3.5"]; + [oid setObject:@"magenta" forKey:@"0.2.262.1.10.1.2.4"]; + [oid setObject:@"idea" forKey:@"0.2.262.1.10.1.2.5"]; + [oid setObject:@"ideaECB" forKey:@"0.2.262.1.10.1.2.5.1"]; + [oid setObject:@"ideaCBC" forKey:@"0.2.262.1.10.1.2.5.2"]; + [oid setObject:@"ideaOFB" forKey:@"0.2.262.1.10.1.2.5.3"]; + [oid setObject:@"ideaCFB8" forKey:@"0.2.262.1.10.1.2.5.4"]; + [oid setObject:@"ideaCFB64" forKey:@"0.2.262.1.10.1.2.5.5"]; + [oid setObject:@"oneWayFunction" forKey:@"0.2.262.1.10.1.3"]; + [oid setObject:@"md4" forKey:@"0.2.262.1.10.1.3.1"]; + [oid setObject:@"md5" forKey:@"0.2.262.1.10.1.3.2"]; + [oid setObject:@"sqModNX509" forKey:@"0.2.262.1.10.1.3.3"]; + [oid setObject:@"sqModNISO" forKey:@"0.2.262.1.10.1.3.4"]; + [oid setObject:@"ripemd128" forKey:@"0.2.262.1.10.1.3.5"]; + [oid setObject:@"hashUsingBlockCipher" forKey:@"0.2.262.1.10.1.3.6"]; + [oid setObject:@"mac" forKey:@"0.2.262.1.10.1.3.7"]; + [oid setObject:@"ripemd160" forKey:@"0.2.262.1.10.1.3.8"]; + [oid setObject:@"fecFunction" forKey:@"0.2.262.1.10.1.4"]; + [oid setObject:@"reedSolomon" forKey:@"0.2.262.1.10.1.4.1"]; + [oid setObject:@"module" forKey:@"0.2.262.1.10.2"]; + [oid setObject:@"algorithms" forKey:@"0.2.262.1.10.2.0"]; + [oid setObject:@"attributeTypes" forKey:@"0.2.262.1.10.2.1"]; + [oid setObject:@"certificateTypes" forKey:@"0.2.262.1.10.2.2"]; + [oid setObject:@"messageTypes" forKey:@"0.2.262.1.10.2.3"]; + [oid setObject:@"plProtocol" forKey:@"0.2.262.1.10.2.4"]; + [oid setObject:@"smeAndComponentsOfSme" forKey:@"0.2.262.1.10.2.5"]; + [oid setObject:@"fec" forKey:@"0.2.262.1.10.2.6"]; + [oid setObject:@"usefulDefinitions" forKey:@"0.2.262.1.10.2.7"]; + [oid setObject:@"stefiles" forKey:@"0.2.262.1.10.2.8"]; + [oid setObject:@"sadmib" forKey:@"0.2.262.1.10.2.9"]; + [oid setObject:@"electronicOrder" forKey:@"0.2.262.1.10.2.10"]; + [oid setObject:@"telesecTtpAsymmetricApplication" forKey:@"0.2.262.1.10.2.11"]; + [oid setObject:@"telesecTtpBasisApplication" forKey:@"0.2.262.1.10.2.12"]; + [oid setObject:@"telesecTtpMessages" forKey:@"0.2.262.1.10.2.13"]; + [oid setObject:@"telesecTtpTimeStampApplication" forKey:@"0.2.262.1.10.2.14"]; + [oid setObject:@"objectClass" forKey:@"0.2.262.1.10.3"]; + [oid setObject:@"telesecOtherName" forKey:@"0.2.262.1.10.3.0"]; + [oid setObject:@"directory" forKey:@"0.2.262.1.10.3.1"]; + [oid setObject:@"directoryType" forKey:@"0.2.262.1.10.3.2"]; + [oid setObject:@"directoryGroup" forKey:@"0.2.262.1.10.3.3"]; + [oid setObject:@"directoryUser" forKey:@"0.2.262.1.10.3.4"]; + [oid setObject:@"symmetricKeyEntry" forKey:@"0.2.262.1.10.3.5"]; + [oid setObject:@"package" forKey:@"0.2.262.1.10.4"]; + [oid setObject:@"parameter" forKey:@"0.2.262.1.10.5"]; + [oid setObject:@"nameBinding" forKey:@"0.2.262.1.10.6"]; + [oid setObject:@"attribute" forKey:@"0.2.262.1.10.7"]; + [oid setObject:@"applicationGroupIdentifier" forKey:@"0.2.262.1.10.7.0"]; + [oid setObject:@"certificateType" forKey:@"0.2.262.1.10.7.1"]; + [oid setObject:@"telesecCertificate" forKey:@"0.2.262.1.10.7.2"]; + [oid setObject:@"certificateNumber" forKey:@"0.2.262.1.10.7.3"]; + [oid setObject:@"certificateRevocationList" forKey:@"0.2.262.1.10.7.4"]; + [oid setObject:@"creationDate" forKey:@"0.2.262.1.10.7.5"]; + [oid setObject:@"issuer" forKey:@"0.2.262.1.10.7.6"]; + [oid setObject:@"namingAuthority" forKey:@"0.2.262.1.10.7.7"]; + [oid setObject:@"publicKeyDirectory" forKey:@"0.2.262.1.10.7.8"]; + [oid setObject:@"securityDomain" forKey:@"0.2.262.1.10.7.9"]; + [oid setObject:@"subject" forKey:@"0.2.262.1.10.7.10"]; + [oid setObject:@"timeOfRevocation" forKey:@"0.2.262.1.10.7.11"]; + [oid setObject:@"userGroupReference" forKey:@"0.2.262.1.10.7.12"]; + [oid setObject:@"validity" forKey:@"0.2.262.1.10.7.13"]; + [oid setObject:@"zert93" forKey:@"0.2.262.1.10.7.14"]; + [oid setObject:@"securityMessEnv" forKey:@"0.2.262.1.10.7.15"]; + [oid setObject:@"anonymizedPublicKeyDirectory" forKey:@"0.2.262.1.10.7.16"]; + [oid setObject:@"telesecGivenName" forKey:@"0.2.262.1.10.7.17"]; + [oid setObject:@"nameAdditions" forKey:@"0.2.262.1.10.7.18"]; + [oid setObject:@"telesecPostalCode" forKey:@"0.2.262.1.10.7.19"]; + [oid setObject:@"nameDistinguisher" forKey:@"0.2.262.1.10.7.20"]; + [oid setObject:@"telesecCertificateList" forKey:@"0.2.262.1.10.7.21"]; + [oid setObject:@"teletrustCertificateList" forKey:@"0.2.262.1.10.7.22"]; + [oid setObject:@"x509CertificateList" forKey:@"0.2.262.1.10.7.23"]; + [oid setObject:@"timeOfIssue" forKey:@"0.2.262.1.10.7.24"]; + [oid setObject:@"physicalCardNumber" forKey:@"0.2.262.1.10.7.25"]; + [oid setObject:@"fileType" forKey:@"0.2.262.1.10.7.26"]; + [oid setObject:@"ctlFileIsArchive" forKey:@"0.2.262.1.10.7.27"]; + [oid setObject:@"emailAddress" forKey:@"0.2.262.1.10.7.28"]; + [oid setObject:@"certificateTemplateList" forKey:@"0.2.262.1.10.7.29"]; + [oid setObject:@"directoryName" forKey:@"0.2.262.1.10.7.30"]; + [oid setObject:@"directoryTypeName" forKey:@"0.2.262.1.10.7.31"]; + [oid setObject:@"directoryGroupName" forKey:@"0.2.262.1.10.7.32"]; + [oid setObject:@"directoryUserName" forKey:@"0.2.262.1.10.7.33"]; + [oid setObject:@"revocationFlag" forKey:@"0.2.262.1.10.7.34"]; + [oid setObject:@"symmetricKeyEntryName" forKey:@"0.2.262.1.10.7.35"]; + [oid setObject:@"glNumber" forKey:@"0.2.262.1.10.7.36"]; + [oid setObject:@"goNumber" forKey:@"0.2.262.1.10.7.37"]; + [oid setObject:@"gKeyData" forKey:@"0.2.262.1.10.7.38"]; + [oid setObject:@"zKeyData" forKey:@"0.2.262.1.10.7.39"]; + [oid setObject:@"ktKeyData" forKey:@"0.2.262.1.10.7.40"]; + [oid setObject:@"ktKeyNumber" forKey:@"0.2.262.1.10.7.41"]; + [oid setObject:@"timeOfRevocationGen" forKey:@"0.2.262.1.10.7.51"]; + [oid setObject:@"liabilityText" forKey:@"0.2.262.1.10.7.52"]; + [oid setObject:@"attributeGroup" forKey:@"0.2.262.1.10.8"]; + [oid setObject:@"action" forKey:@"0.2.262.1.10.9"]; + [oid setObject:@"notification" forKey:@"0.2.262.1.10.10"]; + [oid setObject:@"snmp-mibs" forKey:@"0.2.262.1.10.11"]; + [oid setObject:@"securityApplication" forKey:@"0.2.262.1.10.11.1"]; + [oid setObject:@"certAndCrlExtensionDefinitions" forKey:@"0.2.262.1.10.12"]; + [oid setObject:@"certExtensionLiabilityLimitationExt" forKey:@"0.2.262.1.10.12.0"]; + [oid setObject:@"telesecCertIdExt" forKey:@"0.2.262.1.10.12.1"]; + [oid setObject:@"Telesec policyIdentifier" forKey:@"0.2.262.1.10.12.2"]; + [oid setObject:@"telesecPolicyQualifierID" forKey:@"0.2.262.1.10.12.3"]; + [oid setObject:@"telesecCRLFilteredExt" forKey:@"0.2.262.1.10.12.4"]; + [oid setObject:@"telesecCRLFilterExt" forKey:@"0.2.262.1.10.12.5"]; + [oid setObject:@"telesecNamingAuthorityExt" forKey:@"0.2.262.1.10.12.6"]; + [oid setObject:@"userID" forKey:@"0.9.2342.19200300.100.1.1"]; + [oid setObject:@"rfc822Mailbox" forKey:@"0.9.2342.19200300.100.1.3"]; + [oid setObject:@"domainComponent" forKey:@"0.9.2342.19200300.100.1.25"]; + [oid setObject:@"australianBusinessNumber" forKey:@"1.2.36.1.333.1"]; + [oid setObject:@"Certificates Australia policyIdentifier" forKey:@"1.2.36.75878867.1.100.1.1"]; + [oid setObject:@"Signet personal" forKey:@"1.2.36.68980861.1.1.2"]; + [oid setObject:@"Signet business" forKey:@"1.2.36.68980861.1.1.3"]; + [oid setObject:@"Signet legal" forKey:@"1.2.36.68980861.1.1.4"]; + [oid setObject:@"Signet pilot" forKey:@"1.2.36.68980861.1.1.10"]; + [oid setObject:@"Signet intraNet" forKey:@"1.2.36.68980861.1.1.11"]; + [oid setObject:@"Signet policyIdentifier" forKey:@"1.2.36.68980861.1.1.20"]; + [oid setObject:@"symmetric-encryption-algorithm" forKey:@"1.2.392.200011.61.1.1.1"]; + [oid setObject:@"misty1-cbc" forKey:@"1.2.392.200011.61.1.1.1.1"]; + [oid setObject:@"seis-cp" forKey:@"1.2.752.34.1"]; + [oid setObject:@"SEIS high-assurance policyIdentifier" forKey:@"1.2.752.34.1.1"]; + [oid setObject:@"SEIS GAK policyIdentifier" forKey:@"1.2.752.34.1.2"]; + [oid setObject:@"SEIS pe" forKey:@"1.2.752.34.2"]; + [oid setObject:@"SEIS at" forKey:@"1.2.752.34.3"]; + [oid setObject:@"SEIS at-personalIdentifier" forKey:@"1.2.752.34.3.1"]; + [oid setObject:@"module" forKey:@"1.2.840.10040.1"]; + [oid setObject:@"x9f1-cert-mgmt" forKey:@"1.2.840.10040.1.1"]; + [oid setObject:@"holdinstruction" forKey:@"1.2.840.10040.2"]; + [oid setObject:@"holdinstruction-none" forKey:@"1.2.840.10040.2.1"]; + [oid setObject:@"callissuer" forKey:@"1.2.840.10040.2.2"]; + [oid setObject:@"reject" forKey:@"1.2.840.10040.2.3"]; + [oid setObject:@"pickupToken" forKey:@"1.2.840.10040.2.4"]; + [oid setObject:@"attribute" forKey:@"1.2.840.10040.3"]; + [oid setObject:@"countersignature" forKey:@"1.2.840.10040.3.1"]; + [oid setObject:@"attribute-cert" forKey:@"1.2.840.10040.3.2"]; + [oid setObject:@"algorithm" forKey:@"1.2.840.10040.4"]; + [oid setObject:@"dsa" forKey:@"1.2.840.10040.4.1"]; + [oid setObject:@"dsa-match" forKey:@"1.2.840.10040.4.2"]; + [oid setObject:@"dsaWithSha1" forKey:@"1.2.840.10040.4.3"]; + [oid setObject:@"fieldType" forKey:@"1.2.840.10045.1"]; + [oid setObject:@"prime-field" forKey:@"1.2.840.10045.1.1"]; + [oid setObject:@"characteristic-two-field" forKey:@"1.2.840.10045.1.2"]; + [oid setObject:@"characteristic-two-basis" forKey:@"1.2.840.10045.1.2.3"]; + [oid setObject:@"onBasis" forKey:@"1.2.840.10045.1.2.3.1"]; + [oid setObject:@"tpBasis" forKey:@"1.2.840.10045.1.2.3.2"]; + [oid setObject:@"ppBasis" forKey:@"1.2.840.10045.1.2.3.3"]; + [oid setObject:@"publicKeyType" forKey:@"1.2.840.10045.2"]; + [oid setObject:@"ecPublicKey" forKey:@"1.2.840.10045.2.1"]; + [oid setObject:@"fieldType" forKey:@"1.2.840.10046.1"]; + [oid setObject:@"gf-prime" forKey:@"1.2.840.10046.1.1"]; + [oid setObject:@"numberType" forKey:@"1.2.840.10046.2"]; + [oid setObject:@"dhPublicKey" forKey:@"1.2.840.10046.2.1"]; + [oid setObject:@"scheme" forKey:@"1.2.840.10046.3"]; + [oid setObject:@"dhStatic" forKey:@"1.2.840.10046.3.1"]; + [oid setObject:@"dhEphem" forKey:@"1.2.840.10046.3.2"]; + [oid setObject:@"dhHybrid1" forKey:@"1.2.840.10046.3.3"]; + [oid setObject:@"dhHybrid2" forKey:@"1.2.840.10046.3.4"]; + [oid setObject:@"mqv2" forKey:@"1.2.840.10046.3.5"]; + [oid setObject:@"mqv1" forKey:@"1.2.840.10046.3.6"]; + [oid setObject:@"?" forKey:@"1.2.840.10065.2.2"]; + [oid setObject:@"healthcareLicense" forKey:@"1.2.840.10065.2.3"]; + [oid setObject:@"license?" forKey:@"1.2.840.10065.2.3.1.1"]; + [oid setObject:@"nsn" forKey:@"1.2.840.113533.7"]; + [oid setObject:@"nsn-ce" forKey:@"1.2.840.113533.7.65"]; + [oid setObject:@"entrustVersInfo" forKey:@"1.2.840.113533.7.65.0"]; + [oid setObject:@"nsn-alg" forKey:@"1.2.840.113533.7.66"]; + [oid setObject:@"cast3CBC" forKey:@"1.2.840.113533.7.66.3"]; + [oid setObject:@"cast5CBC" forKey:@"1.2.840.113533.7.66.10"]; + [oid setObject:@"cast5MAC" forKey:@"1.2.840.113533.7.66.11"]; + [oid setObject:@"pbeWithMD5AndCAST5-CBC" forKey:@"1.2.840.113533.7.66.12"]; + [oid setObject:@"passwordBasedMac" forKey:@"1.2.840.113533.7.66.13"]; + [oid setObject:@"nsn-oc" forKey:@"1.2.840.113533.7.67"]; + [oid setObject:@"entrustUser" forKey:@"1.2.840.113533.7.67.0"]; + [oid setObject:@"nsn-at" forKey:@"1.2.840.113533.7.68"]; + [oid setObject:@"entrustCAInfo" forKey:@"1.2.840.113533.7.68.0"]; + [oid setObject:@"attributeCertificate" forKey:@"1.2.840.113533.7.68.10"]; + [oid setObject:@"pkcs-1" forKey:@"1.2.840.113549.1.1"]; + [oid setObject:@"rsaEncryption" forKey:@"1.2.840.113549.1.1.1"]; + [oid setObject:@"md2withRSAEncryption" forKey:@"1.2.840.113549.1.1.2"]; + [oid setObject:@"md4withRSAEncryption" forKey:@"1.2.840.113549.1.1.3"]; + [oid setObject:@"md5withRSAEncryption" forKey:@"1.2.840.113549.1.1.4"]; + [oid setObject:@"sha1withRSAEncryption" forKey:@"1.2.840.113549.1.1.5"]; + [oid setObject:@"rsaOAEP" forKey:@"1.2.840.113549.1.1.7"]; + [oid setObject:@"rsaOAEP-MGF" forKey:@"1.2.840.113549.1.1.8"]; + [oid setObject:@"rsaOAEP-pSpecified" forKey:@"1.2.840.113549.1.1.9"]; + [oid setObject:@"rsaPSS" forKey:@"1.2.840.113549.1.1.10"]; + [oid setObject:@"sha256WithRSAEncryption" forKey:@"1.2.840.113549.1.1.11"]; + [oid setObject:@"sha384WithRSAEncryption" forKey:@"1.2.840.113549.1.1.12"]; + [oid setObject:@"sha512WithRSAEncryption" forKey:@"1.2.840.113549.1.1.13"]; + [oid setObject:@"rsaOAEPEncryptionSET" forKey:@"1.2.840.113549.1.1.6"]; + [oid setObject:@"bsafeRsaEncr" forKey:@"1.2.840.113549.1.2"]; + [oid setObject:@"dhKeyAgreement" forKey:@"1.2.840.113549.1.3.1"]; + [oid setObject:@"pbeWithMD2AndDES-CBC" forKey:@"1.2.840.113549.1.5.1"]; + [oid setObject:@"pbeWithMD5AndDES-CBC" forKey:@"1.2.840.113549.1.5.3"]; + [oid setObject:@"pbeWithMD2AndRC2-CBC" forKey:@"1.2.840.113549.1.5.4"]; + [oid setObject:@"pbeWithMD5AndRC2-CBC" forKey:@"1.2.840.113549.1.5.6"]; + [oid setObject:@"pbeWithMD5AndXOR" forKey:@"1.2.840.113549.1.5.9"]; + [oid setObject:@"pbeWithSHAAndDES-CBC" forKey:@"1.2.840.113549.1.5.10"]; + [oid setObject:@"pkcs5PBKDF2" forKey:@"1.2.840.113549.1.5.12"]; + [oid setObject:@"pkcs5PBES2" forKey:@"1.2.840.113549.1.5.13"]; + [oid setObject:@"pkcs5PBMAC1" forKey:@"1.2.840.113549.1.5.14"]; + [oid setObject:@"data" forKey:@"1.2.840.113549.1.7.1"]; + [oid setObject:@"signedData" forKey:@"1.2.840.113549.1.7.2"]; + [oid setObject:@"envelopedData" forKey:@"1.2.840.113549.1.7.3"]; + [oid setObject:@"signedAndEnvelopedData" forKey:@"1.2.840.113549.1.7.4"]; + [oid setObject:@"digestedData" forKey:@"1.2.840.113549.1.7.5"]; + [oid setObject:@"encryptedData" forKey:@"1.2.840.113549.1.7.6"]; + [oid setObject:@"dataWithAttributes" forKey:@"1.2.840.113549.1.7.7"]; + [oid setObject:@"encryptedPrivateKeyInfo" forKey:@"1.2.840.113549.1.7.8"]; + [oid setObject:@"pkcs-9" forKey:@"1.2.840.113549.1.9"]; + [oid setObject:@"emailAddress" forKey:@"1.2.840.113549.1.9.1"]; + [oid setObject:@"unstructuredName" forKey:@"1.2.840.113549.1.9.2"]; + [oid setObject:@"contentType" forKey:@"1.2.840.113549.1.9.3"]; + [oid setObject:@"messageDigest" forKey:@"1.2.840.113549.1.9.4"]; + [oid setObject:@"signingTime" forKey:@"1.2.840.113549.1.9.5"]; + [oid setObject:@"countersignature" forKey:@"1.2.840.113549.1.9.6"]; + [oid setObject:@"challengePassword" forKey:@"1.2.840.113549.1.9.7"]; + [oid setObject:@"unstructuredAddress" forKey:@"1.2.840.113549.1.9.8"]; + [oid setObject:@"extendedCertificateAttributes" forKey:@"1.2.840.113549.1.9.9"]; + [oid setObject:@"issuerAndSerialNumber" forKey:@"1.2.840.113549.1.9.10"]; + [oid setObject:@"passwordCheck" forKey:@"1.2.840.113549.1.9.11"]; + [oid setObject:@"publicKey" forKey:@"1.2.840.113549.1.9.12"]; + [oid setObject:@"signingDescription" forKey:@"1.2.840.113549.1.9.13"]; + [oid setObject:@"extensionRequest" forKey:@"1.2.840.113549.1.9.14"]; + [oid setObject:@"sMIMECapabilities" forKey:@"1.2.840.113549.1.9.15"]; + [oid setObject:@"preferSignedData" forKey:@"1.2.840.113549.1.9.15.1"]; + [oid setObject:@"canNotDecryptAny" forKey:@"1.2.840.113549.1.9.15.2"]; + [oid setObject:@"receiptRequest" forKey:@"1.2.840.113549.1.9.15.3"]; + [oid setObject:@"receipt" forKey:@"1.2.840.113549.1.9.15.4"]; + [oid setObject:@"contentHints" forKey:@"1.2.840.113549.1.9.15.5"]; + [oid setObject:@"mlExpansionHistory" forKey:@"1.2.840.113549.1.9.15.6"]; + [oid setObject:@"id-sMIME" forKey:@"1.2.840.113549.1.9.16"]; + [oid setObject:@"id-mod" forKey:@"1.2.840.113549.1.9.16.0"]; + [oid setObject:@"id-mod-cms" forKey:@"1.2.840.113549.1.9.16.0.1"]; + [oid setObject:@"id-mod-ess" forKey:@"1.2.840.113549.1.9.16.0.2"]; + [oid setObject:@"id-mod-oid" forKey:@"1.2.840.113549.1.9.16.0.3"]; + [oid setObject:@"id-mod-msg-v3" forKey:@"1.2.840.113549.1.9.16.0.4"]; + [oid setObject:@"id-mod-ets-eSignature-88" forKey:@"1.2.840.113549.1.9.16.0.5"]; + [oid setObject:@"id-mod-ets-eSignature-97" forKey:@"1.2.840.113549.1.9.16.0.6"]; + [oid setObject:@"id-mod-ets-eSigPolicy-88" forKey:@"1.2.840.113549.1.9.16.0.7"]; + [oid setObject:@"id-mod-ets-eSigPolicy-88" forKey:@"1.2.840.113549.1.9.16.0.8"]; + [oid setObject:@"contentType" forKey:@"1.2.840.113549.1.9.16.1"]; + [oid setObject:@"receipt" forKey:@"1.2.840.113549.1.9.16.1.1"]; + [oid setObject:@"authData" forKey:@"1.2.840.113549.1.9.16.1.2"]; + [oid setObject:@"publishCert" forKey:@"1.2.840.113549.1.9.16.1.3"]; + [oid setObject:@"tSTInfo" forKey:@"1.2.840.113549.1.9.16.1.4"]; + [oid setObject:@"tDTInfo" forKey:@"1.2.840.113549.1.9.16.1.5"]; + [oid setObject:@"contentInfo" forKey:@"1.2.840.113549.1.9.16.1.6"]; + [oid setObject:@"dVCSRequestData" forKey:@"1.2.840.113549.1.9.16.1.7"]; + [oid setObject:@"dVCSResponseData" forKey:@"1.2.840.113549.1.9.16.1.8"]; + [oid setObject:@"compressedData" forKey:@"1.2.840.113549.1.9.16.1.9"]; + [oid setObject:@"authenticatedAttributes" forKey:@"1.2.840.113549.1.9.16.2"]; + [oid setObject:@"receiptRequest" forKey:@"1.2.840.113549.1.9.16.2.1"]; + [oid setObject:@"securityLabel" forKey:@"1.2.840.113549.1.9.16.2.2"]; + [oid setObject:@"mlExpandHistory" forKey:@"1.2.840.113549.1.9.16.2.3"]; + [oid setObject:@"contentHint" forKey:@"1.2.840.113549.1.9.16.2.4"]; + [oid setObject:@"msgSigDigest" forKey:@"1.2.840.113549.1.9.16.2.5"]; + [oid setObject:@"encapContentType" forKey:@"1.2.840.113549.1.9.16.2.6"]; + [oid setObject:@"contentIdentifier" forKey:@"1.2.840.113549.1.9.16.2.7"]; + [oid setObject:@"macValue" forKey:@"1.2.840.113549.1.9.16.2.8"]; + [oid setObject:@"equivalentLabels" forKey:@"1.2.840.113549.1.9.16.2.9"]; + [oid setObject:@"contentReference" forKey:@"1.2.840.113549.1.9.16.2.10"]; + [oid setObject:@"encrypKeyPref" forKey:@"1.2.840.113549.1.9.16.2.11"]; + [oid setObject:@"signingCertificate" forKey:@"1.2.840.113549.1.9.16.2.12"]; + [oid setObject:@"smimeEncryptCerts" forKey:@"1.2.840.113549.1.9.16.2.13"]; + [oid setObject:@"timeStampToken" forKey:@"1.2.840.113549.1.9.16.2.14"]; + [oid setObject:@"ets-sigPolicyId" forKey:@"1.2.840.113549.1.9.16.2.15"]; + [oid setObject:@"ets-commitmentType" forKey:@"1.2.840.113549.1.9.16.2.16"]; + [oid setObject:@"ets-signerLocation" forKey:@"1.2.840.113549.1.9.16.2.17"]; + [oid setObject:@"ets-signerAttr" forKey:@"1.2.840.113549.1.9.16.2.18"]; + [oid setObject:@"ets-otherSigCert" forKey:@"1.2.840.113549.1.9.16.2.19"]; + [oid setObject:@"ets-contentTimestamp" forKey:@"1.2.840.113549.1.9.16.2.20"]; + [oid setObject:@"ets-CertificateRefs" forKey:@"1.2.840.113549.1.9.16.2.21"]; + [oid setObject:@"ets-RevocationRefs" forKey:@"1.2.840.113549.1.9.16.2.22"]; + [oid setObject:@"ets-certValues" forKey:@"1.2.840.113549.1.9.16.2.23"]; + [oid setObject:@"ets-revocationValues" forKey:@"1.2.840.113549.1.9.16.2.24"]; + [oid setObject:@"ets-escTimeStamp" forKey:@"1.2.840.113549.1.9.16.2.25"]; + [oid setObject:@"ets-certCRLTimestamp" forKey:@"1.2.840.113549.1.9.16.2.26"]; + [oid setObject:@"ets-archiveTimeStamp" forKey:@"1.2.840.113549.1.9.16.2.27"]; + [oid setObject:@"signatureType" forKey:@"1.2.840.113549.1.9.16.2.28"]; + [oid setObject:@"dvcs-dvc" forKey:@"1.2.840.113549.1.9.16.2.29"]; + [oid setObject:@"algESDHwith3DES" forKey:@"1.2.840.113549.1.9.16.3.1"]; + [oid setObject:@"algESDHwithRC2" forKey:@"1.2.840.113549.1.9.16.3.2"]; + [oid setObject:@"alg3DESwrap" forKey:@"1.2.840.113549.1.9.16.3.3"]; + [oid setObject:@"algRC2wrap" forKey:@"1.2.840.113549.1.9.16.3.4"]; + [oid setObject:@"esDH" forKey:@"1.2.840.113549.1.9.16.3.5"]; + [oid setObject:@"cms3DESwrap" forKey:@"1.2.840.113549.1.9.16.3.6"]; + [oid setObject:@"cmsRC2wrap" forKey:@"1.2.840.113549.1.9.16.3.7"]; + [oid setObject:@"zlib" forKey:@"1.2.840.113549.1.9.16.3.8"]; + [oid setObject:@"pwri-KEK" forKey:@"1.2.840.113549.1.9.16.3.9"]; + [oid setObject:@"certDist-ldap" forKey:@"1.2.840.113549.1.9.16.4.1"]; + [oid setObject:@"sigPolicyQualifier-ets-sqt-uri" forKey:@"1.2.840.113549.1.9.16.5.1"]; + [oid setObject:@"sigPolicyQualifier-ets-sqt-unotice" forKey:@"1.2.840.113549.1.9.16.5.2"]; + [oid setObject:@"id-cti-ets-proofOfOrigin" forKey:@"1.2.840.113549.1.9.16.6.1"]; + [oid setObject:@"id-cti-ets-proofOfReceipt" forKey:@"1.2.840.113549.1.9.16.6.2"]; + [oid setObject:@"id-cti-ets-proofOfDelivery" forKey:@"1.2.840.113549.1.9.16.6.3"]; + [oid setObject:@"id-cti-ets-proofOfSender" forKey:@"1.2.840.113549.1.9.16.6.4"]; + [oid setObject:@"id-cti-ets-proofOfApproval" forKey:@"1.2.840.113549.1.9.16.6.5"]; + [oid setObject:@"id-cti-ets-proofOfCreation" forKey:@"1.2.840.113549.1.9.16.6.6"]; + [oid setObject:@"sMIMECapabilities" forKey:@"1.2.840.113549.1.9.15"]; + [oid setObject:@"signatureTypeIdentifier" forKey:@"1.2.840.113549.1.9.16.9"]; + [oid setObject:@"originatorSig" forKey:@"1.2.840.113549.1.9.16.9.1"]; + [oid setObject:@"domainSig" forKey:@"1.2.840.113549.1.9.16.9.2"]; + [oid setObject:@"additionalAttributesSig" forKey:@"1.2.840.113549.1.9.16.9.3"]; + [oid setObject:@"reviewSig" forKey:@"1.2.840.113549.1.9.16.9.4"]; + [oid setObject:@"capabilities" forKey:@"1.2.840.113549.1.9.16.11"]; + [oid setObject:@"preferBinaryInside" forKey:@"1.2.840.113549.1.9.16.11.1"]; + [oid setObject:@"friendlyName (for PKCS #12)" forKey:@"1.2.840.113549.1.9.20"]; + [oid setObject:@"localKeyID (for PKCS #12)" forKey:@"1.2.840.113549.1.9.21"]; + [oid setObject:@"certTypes (for PKCS #12)" forKey:@"1.2.840.113549.1.9.22"]; + [oid setObject:@"x509Certificate (for PKCS #12)" forKey:@"1.2.840.113549.1.9.22.1"]; + [oid setObject:@"sdsiCertificate (for PKCS #12)" forKey:@"1.2.840.113549.1.9.22.2"]; + [oid setObject:@"crlTypes (for PKCS #12)" forKey:@"1.2.840.113549.1.9.23"]; + [oid setObject:@"x509Crl (for PKCS #12)" forKey:@"1.2.840.113549.1.9.23.1"]; + [oid setObject:@"pkcs9objectClass" forKey:@"1.2.840.113549.1.9.24"]; + [oid setObject:@"pkcs9attributes" forKey:@"1.2.840.113549.1.9.25"]; + [oid setObject:@"pkcs15Token" forKey:@"1.2.840.113549.1.9.25.1"]; + [oid setObject:@"encryptedPrivateKeyInfo" forKey:@"1.2.840.113549.1.9.25.2"]; + [oid setObject:@"randomNonce" forKey:@"1.2.840.113549.1.9.25.3"]; + [oid setObject:@"sequenceNumber" forKey:@"1.2.840.113549.1.9.25.4"]; + [oid setObject:@"pkcs7PDU" forKey:@"1.2.840.113549.1.9.25.5"]; + [oid setObject:@"pkcs9syntax" forKey:@"1.2.840.113549.1.9.1A"]; + [oid setObject:@"pkcs9matchingRules" forKey:@"1.2.840.113549.1.9.1B"]; + [oid setObject:@"pkcs-12" forKey:@"1.2.840.113549.1.12"]; + [oid setObject:@"pkcs-12-PbeIds" forKey:@"1.2.840.113549.1.12.1"]; + [oid setObject:@"pbeWithSHAAnd128BitRC4" forKey:@"1.2.840.113549.1.12.1.1"]; + [oid setObject:@"pbeWithSHAAnd40BitRC4" forKey:@"1.2.840.113549.1.12.1.2"]; + [oid setObject:@"pbeWithSHAAnd3-KeyTripleDES-CBC" forKey:@"1.2.840.113549.1.12.1.3"]; + [oid setObject:@"pbeWithSHAAnd2-KeyTripleDES-CBC" forKey:@"1.2.840.113549.1.12.1.4"]; + [oid setObject:@"pbeWithSHAAnd128BitRC2-CBC" forKey:@"1.2.840.113549.1.12.1.5"]; + [oid setObject:@"pbeWithSHAAnd40BitRC2-CBC" forKey:@"1.2.840.113549.1.12.1.6"]; + [oid setObject:@"pkcs-12-ESPVKID" forKey:@"1.2.840.113549.1.12.2"]; + [oid setObject:@"pkcs-12-PKCS8KeyShrouding" forKey:@"1.2.840.113549.1.12.2.1"]; + [oid setObject:@"pkcs-12-BagIds" forKey:@"1.2.840.113549.1.12.3"]; + [oid setObject:@"pkcs-12-keyBagId" forKey:@"1.2.840.113549.1.12.3.1"]; + [oid setObject:@"pkcs-12-certAndCRLBagId" forKey:@"1.2.840.113549.1.12.3.2"]; + [oid setObject:@"pkcs-12-secretBagId" forKey:@"1.2.840.113549.1.12.3.3"]; + [oid setObject:@"pkcs-12-safeContentsId" forKey:@"1.2.840.113549.1.12.3.4"]; + [oid setObject:@"pkcs-12-pkcs-8ShroudedKeyBagId" forKey:@"1.2.840.113549.1.12.3.5"]; + [oid setObject:@"pkcs-12-CertBagID" forKey:@"1.2.840.113549.1.12.4"]; + [oid setObject:@"pkcs-12-X509CertCRLBagID" forKey:@"1.2.840.113549.1.12.4.1"]; + [oid setObject:@"pkcs-12-SDSICertBagID" forKey:@"1.2.840.113549.1.12.4.2"]; + [oid setObject:@"pkcs-12-PBEID" forKey:@"1.2.840.113549.1.12.5.1"]; + [oid setObject:@"pkcs-12-PBEWithSha1And128BitRC4" forKey:@"1.2.840.113549.1.12.5.1.1"]; + [oid setObject:@"pkcs-12-PBEWithSha1And40BitRC4" forKey:@"1.2.840.113549.1.12.5.1.2"]; + [oid setObject:@"pkcs-12-PBEWithSha1AndTripleDESCBC" forKey:@"1.2.840.113549.1.12.5.1.3"]; + [oid setObject:@"pkcs-12-PBEWithSha1And128BitRC2CBC" forKey:@"1.2.840.113549.1.12.5.1.4"]; + [oid setObject:@"pkcs-12-PBEWithSha1And40BitRC2CBC" forKey:@"1.2.840.113549.1.12.5.1.5"]; + [oid setObject:@"pkcs-12-PBEWithSha1AndRC4" forKey:@"1.2.840.113549.1.12.5.1.6"]; + [oid setObject:@"pkcs-12-PBEWithSha1AndRC2CBC" forKey:@"1.2.840.113549.1.12.5.1.7"]; + [oid setObject:@"pkcs-12-RSAEncryptionWith128BitRC4" forKey:@"1.2.840.113549.1.12.5.2.1"]; + [oid setObject:@"pkcs-12-RSAEncryptionWith40BitRC4" forKey:@"1.2.840.113549.1.12.5.2.2"]; + [oid setObject:@"pkcs-12-RSAEncryptionWithTripleDES" forKey:@"1.2.840.113549.1.12.5.2.3"]; + [oid setObject:@"pkcs-12-RSASignatureWithSHA1Digest" forKey:@"1.2.840.113549.1.12.5.3.1"]; + [oid setObject:@"pkcs-12-keyBag" forKey:@"1.2.840.113549.1.12.10.1.1"]; + [oid setObject:@"pkcs-12-pkcs-8ShroudedKeyBag" forKey:@"1.2.840.113549.1.12.10.1.2"]; + [oid setObject:@"pkcs-12-certBag" forKey:@"1.2.840.113549.1.12.10.1.3"]; + [oid setObject:@"pkcs-12-crlBag" forKey:@"1.2.840.113549.1.12.10.1.4"]; + [oid setObject:@"pkcs-12-secretBag" forKey:@"1.2.840.113549.1.12.10.1.5"]; + [oid setObject:@"pkcs-12-safeContentsBag" forKey:@"1.2.840.113549.1.12.10.1.6"]; + [oid setObject:@"pkcs15modules" forKey:@"1.2.840.113549.1.15.1"]; + [oid setObject:@"pkcs15attributes" forKey:@"1.2.840.113549.1.15.2"]; + [oid setObject:@"pkcs15contentType" forKey:@"1.2.840.113549.1.15.3"]; + [oid setObject:@"pkcs15content" forKey:@"1.2.840.113549.1.15.3.1"]; + [oid setObject:@"md2" forKey:@"1.2.840.113549.2.2"]; + [oid setObject:@"md4" forKey:@"1.2.840.113549.2.4"]; + [oid setObject:@"md5" forKey:@"1.2.840.113549.2.5"]; + [oid setObject:@"hmacWithSHA1" forKey:@"1.2.840.113549.2.7"]; + [oid setObject:@"rc2CBC" forKey:@"1.2.840.113549.3.2"]; + [oid setObject:@"rc2ECB" forKey:@"1.2.840.113549.3.3"]; + [oid setObject:@"rc4" forKey:@"1.2.840.113549.3.4"]; + [oid setObject:@"rc4WithMAC" forKey:@"1.2.840.113549.3.5"]; + [oid setObject:@"desx-CBC" forKey:@"1.2.840.113549.3.6"]; + [oid setObject:@"des-EDE3-CBC" forKey:@"1.2.840.113549.3.7"]; + [oid setObject:@"rc5CBC" forKey:@"1.2.840.113549.3.8"]; + [oid setObject:@"rc5-CBCPad" forKey:@"1.2.840.113549.3.9"]; + [oid setObject:@"desCDMF" forKey:@"1.2.840.113549.3.10"]; + [oid setObject:@"Identrus unknown policyIdentifier" forKey:@"1.2.840.114021.1.6.1"]; + [oid setObject:@"identrusOCSP" forKey:@"1.2.840.114021.4.1"]; + [oid setObject:@"site-Addressing" forKey:@"1.2.840.113556.1.3.00"]; + [oid setObject:@"classSchema" forKey:@"1.2.840.113556.1.3.13"]; + [oid setObject:@"attributeSchema" forKey:@"1.2.840.113556.1.3.14"]; + [oid setObject:@"mailbox-Agent" forKey:@"1.2.840.113556.1.3.174"]; + [oid setObject:@"mailbox" forKey:@"1.2.840.113556.1.3.22"]; + [oid setObject:@"container" forKey:@"1.2.840.113556.1.3.23"]; + [oid setObject:@"mailRecipient" forKey:@"1.2.840.113556.1.3.46"]; + [oid setObject:@"deliveryMechanism" forKey:@"1.2.840.113556.1.2.241"]; + [oid setObject:@"microsoftExcel" forKey:@"1.2.840.113556.4.3"]; + [oid setObject:@"titledWithOID" forKey:@"1.2.840.113556.4.4"]; + [oid setObject:@"microsoftPowerPoint" forKey:@"1.2.840.113556.4.5"]; + [oid setObject:@"spcIndirectDataContext" forKey:@"1.3.6.1.4.1.311.2.1.4"]; + [oid setObject:@"spcAgencyInfo" forKey:@"1.3.6.1.4.1.311.2.1.10"]; + [oid setObject:@"spcStatementType" forKey:@"1.3.6.1.4.1.311.2.1.11"]; + [oid setObject:@"spcSpOpusInfo" forKey:@"1.3.6.1.4.1.311.2.1.12"]; + [oid setObject:@"certReqExtensions" forKey:@"1.3.6.1.4.1.311.2.1.14"]; + [oid setObject:@"spcPEImageData" forKey:@"1.3.6.1.4.1.311.2.1.15"]; + [oid setObject:@"spcRawFileData" forKey:@"1.3.6.1.4.1.311.2.1.18"]; + [oid setObject:@"spcStructuredStorageData" forKey:@"1.3.6.1.4.1.311.2.1.19"]; + [oid setObject:@"spcJavaClassData (type 1)" forKey:@"1.3.6.1.4.1.311.2.1.20"]; + [oid setObject:@"individualCodeSigning" forKey:@"1.3.6.1.4.1.311.2.1.21"]; + [oid setObject:@"commercialCodeSigning" forKey:@"1.3.6.1.4.1.311.2.1.22"]; + [oid setObject:@"spcLink (type 2)" forKey:@"1.3.6.1.4.1.311.2.1.25"]; + [oid setObject:@"spcMinimalCriteriaInfo" forKey:@"1.3.6.1.4.1.311.2.1.26"]; + [oid setObject:@"spcFinancialCriteriaInfo" forKey:@"1.3.6.1.4.1.311.2.1.27"]; + [oid setObject:@"spcLink (type 3)" forKey:@"1.3.6.1.4.1.311.2.1.28"]; + [oid setObject:@"timestampRequest" forKey:@"1.3.6.1.4.1.311.3.2.1"]; + [oid setObject:@"certTrustList" forKey:@"1.3.6.1.4.1.311.10.1"]; + [oid setObject:@"nextUpdateLocation" forKey:@"1.3.6.1.4.1.311.10.2"]; + [oid setObject:@"certTrustListSigning" forKey:@"1.3.6.1.4.1.311.10.3.1"]; + [oid setObject:@"timeStampSigning" forKey:@"1.3.6.1.4.1.311.10.3.2"]; + [oid setObject:@"serverGatedCrypto" forKey:@"1.3.6.1.4.1.311.10.3.3"]; + [oid setObject:@"encryptedFileSystem" forKey:@"1.3.6.1.4.1.311.10.3.4"]; + [oid setObject:@"yesnoTrustAttr" forKey:@"1.3.6.1.4.1.311.10.4.1"]; + [oid setObject:@"enrolmentCSP" forKey:@"1.3.6.1.4.1.311.13.2.2"]; + [oid setObject:@"osVersion" forKey:@"1.3.6.1.4.1.311.13.2.3"]; + [oid setObject:@"microsoftRecipientInfo" forKey:@"1.3.6.1.4.1.311.16.4"]; + [oid setObject:@"cAKeyCertIndexPair" forKey:@"1.3.6.1.4.1.311.21.1"]; + [oid setObject:@"originalFilename" forKey:@"1.3.6.1.4.1.311.88.2.1"]; + [oid setObject:@"ascom" forKey:@"1.3.6.1.4.1.188.7.1.1"]; + [oid setObject:@"ideaECB" forKey:@"1.3.6.1.4.1.188.7.1.1.1"]; + [oid setObject:@"ideaCBC" forKey:@"1.3.6.1.4.1.188.7.1.1.2"]; + [oid setObject:@"ideaCFB" forKey:@"1.3.6.1.4.1.188.7.1.1.3"]; + [oid setObject:@"ideaOFB" forKey:@"1.3.6.1.4.1.188.7.1.1.4"]; + [oid setObject:@"UNINETT policyIdentifier" forKey:@"1.3.6.1.4.1.2428.10.1.1"]; + [oid setObject:@"ICE-TEL policyIdentifier" forKey:@"1.3.6.1.4.1.2712.10"]; + [oid setObject:@"ICE-TEL Italian policyIdentifier" forKey:@"1.3.6.1.4.1.2786.1.1.1"]; + [oid setObject:@"blowfishECB" forKey:@"1.3.6.1.4.1.3029.1.1.1"]; + [oid setObject:@"blowfishCBC" forKey:@"1.3.6.1.4.1.3029.1.1.2"]; + [oid setObject:@"blowfishCFB" forKey:@"1.3.6.1.4.1.3029.1.1.3"]; + [oid setObject:@"blowfishOFB" forKey:@"1.3.6.1.4.1.3029.1.1.4"]; + [oid setObject:@"elgamal" forKey:@"1.3.6.1.4.1.3029.1.2.1"]; + [oid setObject:@"elgamalWithSHA-1" forKey:@"1.3.6.1.4.1.3029.1.2.1.1"]; + [oid setObject:@"elgamalWithRIPEMD-160" forKey:@"1.3.6.1.4.1.3029.1.2.1.2"]; + [oid setObject:@"cryptlibPresenceCheck" forKey:@"1.3.6.1.4.1.3029.3.1.1"]; + [oid setObject:@"ocspResponseRTCS" forKey:@"1.3.6.1.4.1.3029.3.1.2"]; + [oid setObject:@"ocspResponseRTCSExtended" forKey:@"1.3.6.1.4.1.3029.3.1.3"]; + [oid setObject:@"crlExtReason" forKey:@"1.3.6.1.4.1.3029.3.1.4"]; + [oid setObject:@"keyFeatures" forKey:@"1.3.6.1.4.1.3029.3.1.5"]; + [oid setObject:@"pkiBoot" forKey:@"1.3.6.1.4.1.3029.3.1.6"]; + [oid setObject:@"cryptlibContent" forKey:@"1.3.6.1.4.1.3029.4.1"]; + [oid setObject:@"cryptlibConfigData" forKey:@"1.3.6.1.4.1.3029.4.1.1"]; + [oid setObject:@"cryptlibUserIndex" forKey:@"1.3.6.1.4.1.3029.4.1.2"]; + [oid setObject:@"cryptlibUserInfo" forKey:@"1.3.6.1.4.1.3029.4.1.3"]; + [oid setObject:@"mpeg-1" forKey:@"1.3.6.1.4.1.3029.42.11172.1"]; + [oid setObject:@"xYZZY policyIdentifier" forKey:@"1.3.6.1.4.1.3029.88.89.90.90.89"]; + [oid setObject:@"eciaAscX12Edi" forKey:@"1.3.6.1.4.1.3576.7"]; + [oid setObject:@"plainEDImessage" forKey:@"1.3.6.1.4.1.3576.7.1"]; + [oid setObject:@"signedEDImessage" forKey:@"1.3.6.1.4.1.3576.7.2"]; + [oid setObject:@"integrityEDImessage" forKey:@"1.3.6.1.4.1.3576.7.5"]; + [oid setObject:@"iaReceiptMessage" forKey:@"1.3.6.1.4.1.3576.7.65"]; + [oid setObject:@"iaStatusMessage" forKey:@"1.3.6.1.4.1.3576.7.97"]; + [oid setObject:@"eciaEdifact" forKey:@"1.3.6.1.4.1.3576.8"]; + [oid setObject:@"eciaNonEdi" forKey:@"1.3.6.1.4.1.3576.9"]; + [oid setObject:@"timeproof" forKey:@"1.3.6.1.4.1.5472"]; + [oid setObject:@"tss" forKey:@"1.3.6.1.4.1.5472.1"]; + [oid setObject:@"tss80" forKey:@"1.3.6.1.4.1.5472.1.1"]; + [oid setObject:@"tss380" forKey:@"1.3.6.1.4.1.5472.1.2"]; + [oid setObject:@"tss400" forKey:@"1.3.6.1.4.1.5472.1.3"]; + [oid setObject:@"secondaryPractices" forKey:@"1.3.6.1.4.1.5770.0.3"]; + [oid setObject:@"physicianIdentifiers" forKey:@"1.3.6.1.4.1.5770.0.4"]; + [oid setObject:@"comodoPolicy" forKey:@"1.3.6.1.4.1.6449.1.2.1.3.1"]; + [oid setObject:@"rolUnicoNacional" forKey:@"1.3.6.1.4.1.8231.1"]; + [oid setObject:@"gnu" forKey:@"1.3.6.1.4.1.11591"]; + [oid setObject:@"gnu-radius" forKey:@"1.3.6.1.4.1.11591.1"]; + [oid setObject:@"gnu-radar" forKey:@"1.3.6.1.4.1.11591.3"]; + [oid setObject:@"gnuDigestAlgorithm" forKey:@"1.3.6.1.4.1.11591.12"]; + [oid setObject:@"tiger" forKey:@"1.3.6.1.4.1.11591.12.2"]; + [oid setObject:@"gnuEncryptionAlgorithm" forKey:@"1.3.6.1.4.1.11591.13"]; + [oid setObject:@"serpent" forKey:@"1.3.6.1.4.1.11591.13.2"]; + [oid setObject:@"serpent128-ECB" forKey:@"1.3.6.1.4.1.11591.13.2.1"]; + [oid setObject:@"serpent128-CBC" forKey:@"1.3.6.1.4.1.11591.13.2.2"]; + [oid setObject:@"serpent128-OFB" forKey:@"1.3.6.1.4.1.11591.13.2.3"]; + [oid setObject:@"serpent128-CFB" forKey:@"1.3.6.1.4.1.11591.13.2.4"]; + [oid setObject:@"serpent192-ECB" forKey:@"1.3.6.1.4.1.11591.13.2.21"]; + [oid setObject:@"serpent192-CBC" forKey:@"1.3.6.1.4.1.11591.13.2.22"]; + [oid setObject:@"serpent192-OFB" forKey:@"1.3.6.1.4.1.11591.13.2.23"]; + [oid setObject:@"serpent192-CFB" forKey:@"1.3.6.1.4.1.11591.13.2.24"]; + [oid setObject:@"serpent256-ECB" forKey:@"1.3.6.1.4.1.11591.13.2.41"]; + [oid setObject:@"serpent256-CBC" forKey:@"1.3.6.1.4.1.11591.13.2.42"]; + [oid setObject:@"serpent256-OFB" forKey:@"1.3.6.1.4.1.11591.13.2.43"]; + [oid setObject:@"serpent256-CFB" forKey:@"1.3.6.1.4.1.11591.13.2.44"]; + [oid setObject:@"pkix" forKey:@"1.3.6.1.5.5.7"]; + [oid setObject:@"attributeCert" forKey:@"1.3.6.1.5.5.7.0.12"]; + [oid setObject:@"privateExtension" forKey:@"1.3.6.1.5.5.7.1"]; + [oid setObject:@"authorityInfoAccess" forKey:@"1.3.6.1.5.5.7.1.1"]; + [oid setObject:@"biometricInfo" forKey:@"1.3.6.1.5.5.7.1.2"]; + [oid setObject:@"qcStatements" forKey:@"1.3.6.1.5.5.7.1.3"]; + [oid setObject:@"acAuditIdentity" forKey:@"1.3.6.1.5.5.7.1.4"]; + [oid setObject:@"acTargeting" forKey:@"1.3.6.1.5.5.7.1.5"]; + [oid setObject:@"acAaControls" forKey:@"1.3.6.1.5.5.7.1.6"]; + [oid setObject:@"sbgp-ipAddrBlock" forKey:@"1.3.6.1.5.5.7.1.7"]; + [oid setObject:@"sbgp-autonomousSysNum" forKey:@"1.3.6.1.5.5.7.1.8"]; + [oid setObject:@"sbgp-routerIdentifier" forKey:@"1.3.6.1.5.5.7.1.9"]; + [oid setObject:@"acProxying" forKey:@"1.3.6.1.5.5.7.1.10"]; + [oid setObject:@"subjectInfoAccess" forKey:@"1.3.6.1.5.5.7.1.11"]; + [oid setObject:@"policyQualifierIds" forKey:@"1.3.6.1.5.5.7.2"]; + [oid setObject:@"cps" forKey:@"1.3.6.1.5.5.7.2.1"]; + [oid setObject:@"unotice" forKey:@"1.3.6.1.5.5.7.2.2"]; + [oid setObject:@"textNotice" forKey:@"1.3.6.1.5.5.7.2.3"]; + [oid setObject:@"keyPurpose" forKey:@"1.3.6.1.5.5.7.3"]; + [oid setObject:@"serverAuth" forKey:@"1.3.6.1.5.5.7.3.1"]; + [oid setObject:@"clientAuth" forKey:@"1.3.6.1.5.5.7.3.2"]; + [oid setObject:@"codeSigning" forKey:@"1.3.6.1.5.5.7.3.3"]; + [oid setObject:@"emailProtection" forKey:@"1.3.6.1.5.5.7.3.4"]; + [oid setObject:@"ipsecEndSystem" forKey:@"1.3.6.1.5.5.7.3.5"]; + [oid setObject:@"ipsecTunnel" forKey:@"1.3.6.1.5.5.7.3.6"]; + [oid setObject:@"ipsecUser" forKey:@"1.3.6.1.5.5.7.3.7"]; + [oid setObject:@"timeStamping" forKey:@"1.3.6.1.5.5.7.3.8"]; + [oid setObject:@"ocspSigning" forKey:@"1.3.6.1.5.5.7.3.9"]; + [oid setObject:@"dvcs" forKey:@"1.3.6.1.5.5.7.3.10"]; + [oid setObject:@"sbgpCertAAServerAuth" forKey:@"1.3.6.1.5.5.7.3.11"]; + [oid setObject:@"eapOverPPP" forKey:@"1.3.6.1.5.5.7.3.13"]; + [oid setObject:@"wlanSSID" forKey:@"1.3.6.1.5.5.7.3.14"]; + [oid setObject:@"cmpInformationTypes" forKey:@"1.3.6.1.5.5.7.4"]; + [oid setObject:@"caProtEncCert" forKey:@"1.3.6.1.5.5.7.4.1"]; + [oid setObject:@"signKeyPairTypes" forKey:@"1.3.6.1.5.5.7.4.2"]; + [oid setObject:@"encKeyPairTypes" forKey:@"1.3.6.1.5.5.7.4.3"]; + [oid setObject:@"preferredSymmAlg" forKey:@"1.3.6.1.5.5.7.4.4"]; + [oid setObject:@"caKeyUpdateInfo" forKey:@"1.3.6.1.5.5.7.4.5"]; + [oid setObject:@"currentCRL" forKey:@"1.3.6.1.5.5.7.4.6"]; + [oid setObject:@"unsupportedOIDs" forKey:@"1.3.6.1.5.5.7.4.7"]; + [oid setObject:@"keyPairParamReq" forKey:@"1.3.6.1.5.5.7.4.10"]; + [oid setObject:@"keyPairParamRep" forKey:@"1.3.6.1.5.5.7.4.11"]; + [oid setObject:@"revPassphrase" forKey:@"1.3.6.1.5.5.7.4.12"]; + [oid setObject:@"implicitConfirm" forKey:@"1.3.6.1.5.5.7.4.13"]; + [oid setObject:@"confirmWaitTime" forKey:@"1.3.6.1.5.5.7.4.14"]; + [oid setObject:@"origPKIMessage" forKey:@"1.3.6.1.5.5.7.4.15"]; + [oid setObject:@"suppLangTags" forKey:@"1.3.6.1.5.5.7.4.16"]; + [oid setObject:@"crmfRegistration" forKey:@"1.3.6.1.5.5.7.5"]; + [oid setObject:@"regCtrl" forKey:@"1.3.6.1.5.5.7.5.1"]; + [oid setObject:@"regToken" forKey:@"1.3.6.1.5.5.7.5.1.1"]; + [oid setObject:@"authenticator" forKey:@"1.3.6.1.5.5.7.5.1.2"]; + [oid setObject:@"pkiPublicationInfo" forKey:@"1.3.6.1.5.5.7.5.1.3"]; + [oid setObject:@"pkiArchiveOptions" forKey:@"1.3.6.1.5.5.7.5.1.4"]; + [oid setObject:@"oldCertID" forKey:@"1.3.6.1.5.5.7.5.1.5"]; + [oid setObject:@"protocolEncrKey" forKey:@"1.3.6.1.5.5.7.5.1.6"]; + [oid setObject:@"altCertTemplate" forKey:@"1.3.6.1.5.5.7.5.1.7"]; + [oid setObject:@"wtlsTemplate" forKey:@"1.3.6.1.5.5.7.5.1.8"]; + [oid setObject:@"utf8Pairs" forKey:@"1.3.6.1.5.5.7.5.2.1"]; + [oid setObject:@"certReq" forKey:@"1.3.6.1.5.5.7.5.2.2"]; + [oid setObject:@"algorithms" forKey:@"1.3.6.1.5.5.7.6"]; + [oid setObject:@"des40" forKey:@"1.3.6.1.5.5.7.6.1"]; + [oid setObject:@"noSignature" forKey:@"1.3.6.1.5.5.7.6.2"]; + [oid setObject:@"dh-sig-hmac-sha1" forKey:@"1.3.6.1.5.5.7.6.3"]; + [oid setObject:@"dh-pop" forKey:@"1.3.6.1.5.5.7.6.4"]; + [oid setObject:@"cmcControls" forKey:@"1.3.6.1.5.5.7.7"]; + [oid setObject:@"otherNames" forKey:@"1.3.6.1.5.5.7.8"]; + [oid setObject:@"personalData" forKey:@"1.3.6.1.5.5.7.8.1"]; + [oid setObject:@"userGroup" forKey:@"1.3.6.1.5.5.7.8.2"]; + [oid setObject:@"personalData" forKey:@"1.3.6.1.5.5.7.9"]; + [oid setObject:@"dateOfBirth" forKey:@"1.3.6.1.5.5.7.9.1"]; + [oid setObject:@"placeOfBirth" forKey:@"1.3.6.1.5.5.7.9.2"]; + [oid setObject:@"gender" forKey:@"1.3.6.1.5.5.7.9.3"]; + [oid setObject:@"countryOfCitizenship" forKey:@"1.3.6.1.5.5.7.9.4"]; + [oid setObject:@"countryOfResidence" forKey:@"1.3.6.1.5.5.7.9.5"]; + [oid setObject:@"attributeCertificate" forKey:@"1.3.6.1.5.5.7.10"]; + [oid setObject:@"authenticationInfo" forKey:@"1.3.6.1.5.5.7.10.1"]; + [oid setObject:@"accessIdentity" forKey:@"1.3.6.1.5.5.7.10.2"]; + [oid setObject:@"chargingIdentity" forKey:@"1.3.6.1.5.5.7.10.3"]; + [oid setObject:@"group" forKey:@"1.3.6.1.5.5.7.10.4"]; + [oid setObject:@"role" forKey:@"1.3.6.1.5.5.7.10.5"]; + [oid setObject:@"encAttrs" forKey:@"1.3.6.1.5.5.7.10.6"]; + [oid setObject:@"personalData" forKey:@"1.3.6.1.5.5.7.11"]; + [oid setObject:@"pkixQCSyntax-v1" forKey:@"1.3.6.1.5.5.7.11.1"]; + [oid setObject:@"ocsp" forKey:@"1.3.6.1.5.5.7.48.1"]; + [oid setObject:@"ocspBasic" forKey:@"1.3.6.1.5.5.7.48.1.1"]; + [oid setObject:@"ocspNonce" forKey:@"1.3.6.1.5.5.7.48.1.2"]; + [oid setObject:@"ocspCRL" forKey:@"1.3.6.1.5.5.7.48.1.3"]; + [oid setObject:@"ocspResponse" forKey:@"1.3.6.1.5.5.7.48.1.4"]; + [oid setObject:@"ocspNoCheck" forKey:@"1.3.6.1.5.5.7.48.1.5"]; + [oid setObject:@"ocspArchiveCutoff" forKey:@"1.3.6.1.5.5.7.48.1.6"]; + [oid setObject:@"ocspServiceLocator" forKey:@"1.3.6.1.5.5.7.48.1.7"]; + [oid setObject:@"caIssuers" forKey:@"1.3.6.1.5.5.7.48.2"]; + [oid setObject:@"timeStamping" forKey:@"1.3.6.1.5.5.7.48.3"]; + [oid setObject:@"caRepository" forKey:@"1.3.6.1.5.5.7.48.5"]; + [oid setObject:@"hmacMD5" forKey:@"1.3.6.1.5.5.8.1.1"]; + [oid setObject:@"hmacSHA" forKey:@"1.3.6.1.5.5.8.1.2"]; + [oid setObject:@"hmacTiger" forKey:@"1.3.6.1.5.5.8.1.3"]; + [oid setObject:@"iKEIntermediate" forKey:@"1.3.6.1.5.5.8.2.2"]; + [oid setObject:@"decEncryptionAlgorithm" forKey:@"1.3.12.2.1011.7.1"]; + [oid setObject:@"decDEA" forKey:@"1.3.12.2.1011.7.1.2"]; + [oid setObject:@"decHashAlgorithm" forKey:@"1.3.12.2.1011.7.2"]; + [oid setObject:@"decMD2" forKey:@"1.3.12.2.1011.7.2.1"]; + [oid setObject:@"decMD4" forKey:@"1.3.12.2.1011.7.2.2"]; + [oid setObject:@"decSignatureAlgorithm" forKey:@"1.3.12.2.1011.7.3"]; + [oid setObject:@"decMD2withRSA" forKey:@"1.3.12.2.1011.7.3.1"]; + [oid setObject:@"decMD4withRSA" forKey:@"1.3.12.2.1011.7.3.2"]; + [oid setObject:@"decDEAMAC" forKey:@"1.3.12.2.1011.7.3.3"]; + [oid setObject:@"sha" forKey:@"1.3.14.2.26.5"]; + [oid setObject:@"rsa" forKey:@"1.3.14.3.2.1.1"]; + [oid setObject:@"md4WitRSA" forKey:@"1.3.14.3.2.2"]; + [oid setObject:@"md5WithRSA" forKey:@"1.3.14.3.2.3"]; + [oid setObject:@"md4WithRSAEncryption" forKey:@"1.3.14.3.2.4"]; + [oid setObject:@"sqmod-N" forKey:@"1.3.14.3.2.2.1"]; + [oid setObject:@"sqmod-NwithRSA" forKey:@"1.3.14.3.2.3.1"]; + [oid setObject:@"desECB" forKey:@"1.3.14.3.2.6"]; + [oid setObject:@"desCBC" forKey:@"1.3.14.3.2.7"]; + [oid setObject:@"desOFB" forKey:@"1.3.14.3.2.8"]; + [oid setObject:@"desCFB" forKey:@"1.3.14.3.2.9"]; + [oid setObject:@"desMAC" forKey:@"1.3.14.3.2.10"]; + [oid setObject:@"rsaSignature" forKey:@"1.3.14.3.2.11"]; + [oid setObject:@"dsa" forKey:@"1.3.14.3.2.12"]; + [oid setObject:@"dsaWithSHA" forKey:@"1.3.14.3.2.13"]; + [oid setObject:@"mdc2WithRSASignature" forKey:@"1.3.14.3.2.14"]; + [oid setObject:@"shaWithRSASignature" forKey:@"1.3.14.3.2.15"]; + [oid setObject:@"dhWithCommonModulus" forKey:@"1.3.14.3.2.16"]; + [oid setObject:@"desEDE" forKey:@"1.3.14.3.2.17"]; + [oid setObject:@"sha" forKey:@"1.3.14.3.2.18"]; + [oid setObject:@"mdc-2" forKey:@"1.3.14.3.2.19"]; + [oid setObject:@"dsaCommon" forKey:@"1.3.14.3.2.20"]; + [oid setObject:@"dsaCommonWithSHA" forKey:@"1.3.14.3.2.21"]; + [oid setObject:@"rsaKeyTransport" forKey:@"1.3.14.3.2.22"]; + [oid setObject:@"keyed-hash-seal" forKey:@"1.3.14.3.2.23"]; + [oid setObject:@"md2WithRSASignature" forKey:@"1.3.14.3.2.24"]; + [oid setObject:@"md5WithRSASignature" forKey:@"1.3.14.3.2.25"]; + [oid setObject:@"sha1" forKey:@"1.3.14.3.2.26"]; + [oid setObject:@"dsaWithSHA1" forKey:@"1.3.14.3.2.27"]; + [oid setObject:@"dsaWithCommonSHA1" forKey:@"1.3.14.3.2.28"]; + [oid setObject:@"sha-1WithRSAEncryption" forKey:@"1.3.14.3.2.29"]; + [oid setObject:@"simple-strong-auth-mechanism" forKey:@"1.3.14.3.3.1"]; + [oid setObject:@"ElGamal" forKey:@"1.3.14.7.2.1.1"]; + [oid setObject:@"md2WithRSA" forKey:@"1.3.14.7.2.3.1"]; + [oid setObject:@"md2WithElGamal" forKey:@"1.3.14.7.2.3.2"]; + [oid setObject:@"document" forKey:@"1.3.36.1"]; + [oid setObject:@"finalVersion" forKey:@"1.3.36.1.1"]; + [oid setObject:@"draft" forKey:@"1.3.36.1.2"]; + [oid setObject:@"sio" forKey:@"1.3.36.2"]; + [oid setObject:@"sedu" forKey:@"1.3.36.2.1"]; + [oid setObject:@"algorithm" forKey:@"1.3.36.3"]; + [oid setObject:@"encryptionAlgorithm" forKey:@"1.3.36.3.1"]; + [oid setObject:@"des" forKey:@"1.3.36.3.1.1"]; + [oid setObject:@"desECB_pad" forKey:@"1.3.36.3.1.1.1"]; + [oid setObject:@"desECB_ISOpad" forKey:@"1.3.36.3.1.1.1.1"]; + [oid setObject:@"desCBC_pad" forKey:@"1.3.36.3.1.1.2.1"]; + [oid setObject:@"desCBC_ISOpad" forKey:@"1.3.36.3.1.1.2.1.1"]; + [oid setObject:@"des_3" forKey:@"1.3.36.3.1.3"]; + [oid setObject:@"des_3ECB_pad" forKey:@"1.3.36.3.1.3.1.1"]; + [oid setObject:@"des_3ECB_ISOpad" forKey:@"1.3.36.3.1.3.1.1.1"]; + [oid setObject:@"des_3CBC_pad" forKey:@"1.3.36.3.1.3.2.1"]; + [oid setObject:@"des_3CBC_ISOpad" forKey:@"1.3.36.3.1.3.2.1.1"]; + [oid setObject:@"idea" forKey:@"1.3.36.3.1.2"]; + [oid setObject:@"ideaECB" forKey:@"1.3.36.3.1.2.1"]; + [oid setObject:@"ideaECB_pad" forKey:@"1.3.36.3.1.2.1.1"]; + [oid setObject:@"ideaECB_ISOpad" forKey:@"1.3.36.3.1.2.1.1.1"]; + [oid setObject:@"ideaCBC" forKey:@"1.3.36.3.1.2.2"]; + [oid setObject:@"ideaCBC_pad" forKey:@"1.3.36.3.1.2.2.1"]; + [oid setObject:@"ideaCBC_ISOpad" forKey:@"1.3.36.3.1.2.2.1.1"]; + [oid setObject:@"ideaOFB" forKey:@"1.3.36.3.1.2.3"]; + [oid setObject:@"ideaCFB" forKey:@"1.3.36.3.1.2.4"]; + [oid setObject:@"rsaEncryption" forKey:@"1.3.36.3.1.4"]; + [oid setObject:@"rsaEncryptionWithlmod512expe17" forKey:@"1.3.36.3.1.4.512.17"]; + [oid setObject:@"bsi-1" forKey:@"1.3.36.3.1.5"]; + [oid setObject:@"bsi_1ECB_pad" forKey:@"1.3.36.3.1.5.1"]; + [oid setObject:@"bsi_1CBC_pad" forKey:@"1.3.36.3.1.5.2"]; + [oid setObject:@"bsi_1CBC_PEMpad" forKey:@"1.3.36.3.1.5.2.1"]; + [oid setObject:@"hashAlgorithm" forKey:@"1.3.36.3.2"]; + [oid setObject:@"ripemd160" forKey:@"1.3.36.3.2.1"]; + [oid setObject:@"ripemd128" forKey:@"1.3.36.3.2.2"]; + [oid setObject:@"ripemd256" forKey:@"1.3.36.3.2.3"]; + [oid setObject:@"mdc2singleLength" forKey:@"1.3.36.3.2.4"]; + [oid setObject:@"mdc2doubleLength" forKey:@"1.3.36.3.2.5"]; + [oid setObject:@"signatureAlgorithm" forKey:@"1.3.36.3.3"]; + [oid setObject:@"rsaSignature" forKey:@"1.3.36.3.3.1"]; + [oid setObject:@"rsaSignatureWithsha1" forKey:@"1.3.36.3.3.1.1"]; + [oid setObject:@"rsaSignatureWithsha1_l512_l2" forKey:@"1.3.36.3.3.1.1.512.2"]; + [oid setObject:@"rsaSignatureWithsha1_l640_l2" forKey:@"1.3.36.3.3.1.1.640.2"]; + [oid setObject:@"rsaSignatureWithsha1_l768_l2" forKey:@"1.3.36.3.3.1.1.768.2"]; + [oid setObject:@"rsaSignatureWithsha1_l896_l2" forKey:@"1.3.36.3.3.1.1.892.2"]; + [oid setObject:@"rsaSignatureWithsha1_l1024_l2" forKey:@"1.3.36.3.3.1.1.1024.2"]; + [oid setObject:@"rsaSignatureWithsha1_l512_l3" forKey:@"1.3.36.3.3.1.1.512.3"]; + [oid setObject:@"rsaSignatureWithsha1_l640_l3" forKey:@"1.3.36.3.3.1.1.640.3"]; + [oid setObject:@"rsaSignatureWithsha1_l768_l3" forKey:@"1.3.36.3.3.1.1.768.3"]; + [oid setObject:@"rsaSignatureWithsha1_l896_l3" forKey:@"1.3.36.3.3.1.1.896.3"]; + [oid setObject:@"rsaSignatureWithsha1_l1024_l3" forKey:@"1.3.36.3.3.1.1.1024.3"]; + [oid setObject:@"rsaSignatureWithsha1_l512_l5" forKey:@"1.3.36.3.3.1.1.512.5"]; + [oid setObject:@"rsaSignatureWithsha1_l640_l5" forKey:@"1.3.36.3.3.1.1.640.5"]; + [oid setObject:@"rsaSignatureWithsha1_l768_l5" forKey:@"1.3.36.3.3.1.1.768.5"]; + [oid setObject:@"rsaSignatureWithsha1_l896_l5" forKey:@"1.3.36.3.3.1.1.896.5"]; + [oid setObject:@"rsaSignatureWithsha1_l1024_l5" forKey:@"1.3.36.3.3.1.1.1024.5"]; + [oid setObject:@"rsaSignatureWithsha1_l512_l9" forKey:@"1.3.36.3.3.1.1.512.9"]; + [oid setObject:@"rsaSignatureWithsha1_l640_l9" forKey:@"1.3.36.3.3.1.1.640.9"]; + [oid setObject:@"rsaSignatureWithsha1_l768_l9" forKey:@"1.3.36.3.3.1.1.768.9"]; + [oid setObject:@"rsaSignatureWithsha1_l896_l9" forKey:@"1.3.36.3.3.1.1.896.9"]; + [oid setObject:@"rsaSignatureWithsha1_l1024_l9" forKey:@"1.3.36.3.3.1.1.1024.9"]; + [oid setObject:@"rsaSignatureWithsha1_l512_l11" forKey:@"1.3.36.3.3.1.1.512.11"]; + [oid setObject:@"rsaSignatureWithsha1_l640_l11" forKey:@"1.3.36.3.3.1.1.640.11"]; + [oid setObject:@"rsaSignatureWithsha1_l768_l11" forKey:@"1.3.36.3.3.1.1.768.11"]; + [oid setObject:@"rsaSignatureWithsha1_l896_l11" forKey:@"1.3.36.3.3.1.1.896.11"]; + [oid setObject:@"rsaSignatureWithsha1_l1024_l11" forKey:@"1.3.36.3.3.1.1.1024.11"]; + [oid setObject:@"rsaSignatureWithripemd160" forKey:@"1.3.36.3.3.1.2"]; + [oid setObject:@"rsaSignatureWithripemd160_l512_l2" forKey:@"1.3.36.3.3.1.2.512.2"]; + [oid setObject:@"rsaSignatureWithripemd160_l640_l2" forKey:@"1.3.36.3.3.1.2.640.2"]; + [oid setObject:@"rsaSignatureWithripemd160_l768_l2" forKey:@"1.3.36.3.3.1.2.768.2"]; + [oid setObject:@"rsaSignatureWithripemd160_l896_l2" forKey:@"1.3.36.3.3.1.2.892.2"]; + [oid setObject:@"rsaSignatureWithripemd160_l1024_l2" forKey:@"1.3.36.3.3.1.2.1024.2"]; + [oid setObject:@"rsaSignatureWithripemd160_l512_l3" forKey:@"1.3.36.3.3.1.2.512.3"]; + [oid setObject:@"rsaSignatureWithripemd160_l640_l3" forKey:@"1.3.36.3.3.1.2.640.3"]; + [oid setObject:@"rsaSignatureWithripemd160_l768_l3" forKey:@"1.3.36.3.3.1.2.768.3"]; + [oid setObject:@"rsaSignatureWithripemd160_l896_l3" forKey:@"1.3.36.3.3.1.2.896.3"]; + [oid setObject:@"rsaSignatureWithripemd160_l1024_l3" forKey:@"1.3.36.3.3.1.2.1024.3"]; + [oid setObject:@"rsaSignatureWithripemd160_l512_l5" forKey:@"1.3.36.3.3.1.2.512.5"]; + [oid setObject:@"rsaSignatureWithripemd160_l640_l5" forKey:@"1.3.36.3.3.1.2.640.5"]; + [oid setObject:@"rsaSignatureWithripemd160_l768_l5" forKey:@"1.3.36.3.3.1.2.768.5"]; + [oid setObject:@"rsaSignatureWithripemd160_l896_l5" forKey:@"1.3.36.3.3.1.2.896.5"]; + [oid setObject:@"rsaSignatureWithripemd160_l1024_l5" forKey:@"1.3.36.3.3.1.2.1024.5"]; + [oid setObject:@"rsaSignatureWithripemd160_l512_l9" forKey:@"1.3.36.3.3.1.2.512.9"]; + [oid setObject:@"rsaSignatureWithripemd160_l640_l9" forKey:@"1.3.36.3.3.1.2.640.9"]; + [oid setObject:@"rsaSignatureWithripemd160_l768_l9" forKey:@"1.3.36.3.3.1.2.768.9"]; + [oid setObject:@"rsaSignatureWithripemd160_l896_l9" forKey:@"1.3.36.3.3.1.2.896.9"]; + [oid setObject:@"rsaSignatureWithripemd160_l1024_l9" forKey:@"1.3.36.3.3.1.2.1024.9"]; + [oid setObject:@"rsaSignatureWithripemd160_l512_l11" forKey:@"1.3.36.3.3.1.2.512.11"]; + [oid setObject:@"rsaSignatureWithripemd160_l640_l11" forKey:@"1.3.36.3.3.1.2.640.11"]; + [oid setObject:@"rsaSignatureWithripemd160_l768_l11" forKey:@"1.3.36.3.3.1.2.768.11"]; + [oid setObject:@"rsaSignatureWithripemd160_l896_l11" forKey:@"1.3.36.3.3.1.2.896.11"]; + [oid setObject:@"rsaSignatureWithripemd160_l1024_l11" forKey:@"1.3.36.3.3.1.2.1024.11"]; + [oid setObject:@"rsaSignatureWithrimpemd128" forKey:@"1.3.36.3.3.1.3"]; + [oid setObject:@"rsaSignatureWithrimpemd256" forKey:@"1.3.36.3.3.1.4"]; + [oid setObject:@"ecsieSign" forKey:@"1.3.36.3.3.2"]; + [oid setObject:@"ecsieSignWithsha1" forKey:@"1.3.36.3.3.2.1"]; + [oid setObject:@"ecsieSignWithripemd160" forKey:@"1.3.36.3.3.2.2"]; + [oid setObject:@"ecsieSignWithmd2" forKey:@"1.3.36.3.3.2.3"]; + [oid setObject:@"ecsieSignWithmd5" forKey:@"1.3.36.3.3.2.4"]; + [oid setObject:@"signatureScheme" forKey:@"1.3.36.3.4"]; + [oid setObject:@"sigS_ISO9796-1" forKey:@"1.3.36.3.4.1"]; + [oid setObject:@"sigS_ISO9796-2" forKey:@"1.3.36.3.4.2"]; + [oid setObject:@"sigS_ISO9796-2Withred" forKey:@"1.3.36.3.4.2.1"]; + [oid setObject:@"sigS_ISO9796-2Withrsa" forKey:@"1.3.36.3.4.2.2"]; + [oid setObject:@"sigS_ISO9796-2Withrnd" forKey:@"1.3.36.3.4.2.3"]; + [oid setObject:@"attribute" forKey:@"1.3.36.4"]; + [oid setObject:@"policy" forKey:@"1.3.36.5"]; + [oid setObject:@"api" forKey:@"1.3.36.6"]; + [oid setObject:@"manufacturer-specific_api" forKey:@"1.3.36.6.1"]; + [oid setObject:@"utimaco-api" forKey:@"1.3.36.6.1.1"]; + [oid setObject:@"functionality-specific_api" forKey:@"1.3.36.6.2"]; + [oid setObject:@"keymgmnt" forKey:@"1.3.36.7"]; + [oid setObject:@"keyagree" forKey:@"1.3.36.7.1"]; + [oid setObject:@"bsiPKE" forKey:@"1.3.36.7.1.1"]; + [oid setObject:@"keytrans" forKey:@"1.3.36.7.2"]; + [oid setObject:@"encISO9796-2Withrsa" forKey:@"1.3.36.7.2.1"]; + [oid setObject:@"Teletrust SigiSigConform policyIdentifier" forKey:@"1.3.36.8.1.1"]; + [oid setObject:@"directoryService" forKey:@"1.3.36.8.2.1"]; + [oid setObject:@"dateOfCertGen" forKey:@"1.3.36.8.3.1"]; + [oid setObject:@"procuration" forKey:@"1.3.36.8.3.2"]; + [oid setObject:@"admission" forKey:@"1.3.36.8.3.3"]; + [oid setObject:@"monetaryLimit" forKey:@"1.3.36.8.3.4"]; + [oid setObject:@"declarationOfMajority" forKey:@"1.3.36.8.3.5"]; + [oid setObject:@"integratedCircuitCardSerialNumber" forKey:@"1.3.36.8.3.6"]; + [oid setObject:@"pKReference" forKey:@"1.3.36.8.3.7"]; + [oid setObject:@"restriction" forKey:@"1.3.36.8.3.8"]; + [oid setObject:@"retrieveIfAllowed" forKey:@"1.3.36.8.3.9"]; + [oid setObject:@"requestedCertificate" forKey:@"1.3.36.8.3.10"]; + [oid setObject:@"namingAuthorities" forKey:@"1.3.36.8.3.11"]; + [oid setObject:@"certInDirSince" forKey:@"1.3.36.8.3.12"]; + [oid setObject:@"certHash" forKey:@"1.3.36.8.3.13"]; + [oid setObject:@"personalData" forKey:@"1.3.36.8.4.1"]; + [oid setObject:@"restriction" forKey:@"1.3.36.8.4.8"]; + [oid setObject:@"rsaIndicateSHA1" forKey:@"1.3.36.8.5.1.1.1"]; + [oid setObject:@"rsaIndicateRIPEMD160" forKey:@"1.3.36.8.5.1.1.2"]; + [oid setObject:@"rsaWithSHA1" forKey:@"1.3.36.8.5.1.1.3"]; + [oid setObject:@"rsaWithRIPEMD160" forKey:@"1.3.36.8.5.1.1.4"]; + [oid setObject:@"dsaExtended" forKey:@"1.3.36.8.5.1.2.1"]; + [oid setObject:@"dsaWithRIPEMD160" forKey:@"1.3.36.8.5.1.2.2"]; + [oid setObject:@"cert" forKey:@"1.3.36.8.6.1"]; + [oid setObject:@"certRef" forKey:@"1.3.36.8.6.2"]; + [oid setObject:@"attrCert" forKey:@"1.3.36.8.6.3"]; + [oid setObject:@"attrRef" forKey:@"1.3.36.8.6.4"]; + [oid setObject:@"fileName" forKey:@"1.3.36.8.6.5"]; + [oid setObject:@"storageTime" forKey:@"1.3.36.8.6.6"]; + [oid setObject:@"fileSize" forKey:@"1.3.36.8.6.7"]; + [oid setObject:@"location" forKey:@"1.3.36.8.6.8"]; + [oid setObject:@"sigNumber" forKey:@"1.3.36.8.6.9"]; + [oid setObject:@"autoGen" forKey:@"1.3.36.8.6.10"]; + [oid setObject:@"ptAdobeILL" forKey:@"1.3.36.8.7.1.1"]; + [oid setObject:@"ptAmiPro" forKey:@"1.3.36.8.7.1.2"]; + [oid setObject:@"ptAutoCAD" forKey:@"1.3.36.8.7.1.3"]; + [oid setObject:@"ptBinary" forKey:@"1.3.36.8.7.1.4"]; + [oid setObject:@"ptBMP" forKey:@"1.3.36.8.7.1.5"]; + [oid setObject:@"ptCGM" forKey:@"1.3.36.8.7.1.6"]; + [oid setObject:@"ptCorelCRT" forKey:@"1.3.36.8.7.1.7"]; + [oid setObject:@"ptCorelDRW" forKey:@"1.3.36.8.7.1.8"]; + [oid setObject:@"ptCorelEXC" forKey:@"1.3.36.8.7.1.9"]; + [oid setObject:@"ptCorelPHT" forKey:@"1.3.36.8.7.1.10"]; + [oid setObject:@"ptDraw" forKey:@"1.3.36.8.7.1.11"]; + [oid setObject:@"ptDVI" forKey:@"1.3.36.8.7.1.12"]; + [oid setObject:@"ptEPS" forKey:@"1.3.36.8.7.1.13"]; + [oid setObject:@"ptExcel" forKey:@"1.3.36.8.7.1.14"]; + [oid setObject:@"ptGEM" forKey:@"1.3.36.8.7.1.15"]; + [oid setObject:@"ptGIF" forKey:@"1.3.36.8.7.1.16"]; + [oid setObject:@"ptHPGL" forKey:@"1.3.36.8.7.1.17"]; + [oid setObject:@"ptJPEG" forKey:@"1.3.36.8.7.1.18"]; + [oid setObject:@"ptKodak" forKey:@"1.3.36.8.7.1.19"]; + [oid setObject:@"ptLaTeX" forKey:@"1.3.36.8.7.1.20"]; + [oid setObject:@"ptLotus" forKey:@"1.3.36.8.7.1.21"]; + [oid setObject:@"ptLotusPIC" forKey:@"1.3.36.8.7.1.22"]; + [oid setObject:@"ptMacPICT" forKey:@"1.3.36.8.7.1.23"]; + [oid setObject:@"ptMacWord" forKey:@"1.3.36.8.7.1.24"]; + [oid setObject:@"ptMSWfD" forKey:@"1.3.36.8.7.1.25"]; + [oid setObject:@"ptMSWord" forKey:@"1.3.36.8.7.1.26"]; + [oid setObject:@"ptMSWord2" forKey:@"1.3.36.8.7.1.27"]; + [oid setObject:@"ptMSWord6" forKey:@"1.3.36.8.7.1.28"]; + [oid setObject:@"ptMSWord8" forKey:@"1.3.36.8.7.1.29"]; + [oid setObject:@"ptPDF" forKey:@"1.3.36.8.7.1.30"]; + [oid setObject:@"ptPIF" forKey:@"1.3.36.8.7.1.31"]; + [oid setObject:@"ptPostscript" forKey:@"1.3.36.8.7.1.32"]; + [oid setObject:@"ptRTF" forKey:@"1.3.36.8.7.1.33"]; + [oid setObject:@"ptSCITEX" forKey:@"1.3.36.8.7.1.34"]; + [oid setObject:@"ptTAR" forKey:@"1.3.36.8.7.1.35"]; + [oid setObject:@"ptTarga" forKey:@"1.3.36.8.7.1.36"]; + [oid setObject:@"ptTeX" forKey:@"1.3.36.8.7.1.37"]; + [oid setObject:@"ptText" forKey:@"1.3.36.8.7.1.38"]; + [oid setObject:@"ptTIFF" forKey:@"1.3.36.8.7.1.39"]; + [oid setObject:@"ptTIFF-FC" forKey:@"1.3.36.8.7.1.40"]; + [oid setObject:@"ptUID" forKey:@"1.3.36.8.7.1.41"]; + [oid setObject:@"ptUUEncode" forKey:@"1.3.36.8.7.1.42"]; + [oid setObject:@"ptWMF" forKey:@"1.3.36.8.7.1.43"]; + [oid setObject:@"ptWordPerfect" forKey:@"1.3.36.8.7.1.44"]; + [oid setObject:@"ptWPGrph" forKey:@"1.3.36.8.7.1.45"]; + [oid setObject:@"thawte-ce" forKey:@"1.3.101.1.4"]; + [oid setObject:@"strongExtranet" forKey:@"1.3.101.1.4.1"]; + [oid setObject:@"objectClass" forKey:@"2.5.4.0"]; + [oid setObject:@"aliasedEntryName" forKey:@"2.5.4.1"]; + [oid setObject:@"knowledgeInformation" forKey:@"2.5.4.2"]; + [oid setObject:@"commonName" forKey:@"2.5.4.3"]; + [oid setObject:@"surname" forKey:@"2.5.4.4"]; + [oid setObject:@"serialNumber" forKey:@"2.5.4.5"]; + [oid setObject:@"countryName" forKey:@"2.5.4.6"]; + [oid setObject:@"localityName" forKey:@"2.5.4.7"]; + [oid setObject:@"collectiveLocalityName" forKey:@"2.5.4.7.1"]; + [oid setObject:@"stateOrProvinceName" forKey:@"2.5.4.8"]; + [oid setObject:@"collectiveStateOrProvinceName" forKey:@"2.5.4.8.1"]; + [oid setObject:@"streetAddress" forKey:@"2.5.4.9"]; + [oid setObject:@"collectiveStreetAddress" forKey:@"2.5.4.9.1"]; + [oid setObject:@"organizationName" forKey:@"2.5.4.10"]; + [oid setObject:@"collectiveOrganizationName" forKey:@"2.5.4.10.1"]; + [oid setObject:@"organizationalUnitName" forKey:@"2.5.4.11"]; + [oid setObject:@"collectiveOrganizationalUnitName" forKey:@"2.5.4.11.1"]; + [oid setObject:@"title" forKey:@"2.5.4.12"]; + [oid setObject:@"description" forKey:@"2.5.4.13"]; + [oid setObject:@"searchGuide" forKey:@"2.5.4.14"]; + [oid setObject:@"businessCategory" forKey:@"2.5.4.15"]; + [oid setObject:@"postalAddress" forKey:@"2.5.4.16"]; + [oid setObject:@"collectivePostalAddress" forKey:@"2.5.4.16.1"]; + [oid setObject:@"postalCode" forKey:@"2.5.4.17"]; + [oid setObject:@"collectivePostalCode" forKey:@"2.5.4.17.1"]; + [oid setObject:@"postOfficeBox" forKey:@"2.5.4.18"]; + [oid setObject:@"collectivePostOfficeBox" forKey:@"2.5.4.18.1"]; + [oid setObject:@"physicalDeliveryOfficeName" forKey:@"2.5.4.19"]; + [oid setObject:@"collectivePhysicalDeliveryOfficeName" forKey:@"2.5.4.19.1"]; + [oid setObject:@"telephoneNumber" forKey:@"2.5.4.20"]; + [oid setObject:@"collectiveTelephoneNumber" forKey:@"2.5.4.20.1"]; + [oid setObject:@"telexNumber" forKey:@"2.5.4.21"]; + [oid setObject:@"collectiveTelexNumber" forKey:@"2.5.4.21.1"]; + [oid setObject:@"teletexTerminalIdentifier" forKey:@"2.5.4.22"]; + [oid setObject:@"collectiveTeletexTerminalIdentifier" forKey:@"2.5.4.22.1"]; + [oid setObject:@"facsimileTelephoneNumber" forKey:@"2.5.4.23"]; + [oid setObject:@"collectiveFacsimileTelephoneNumber" forKey:@"2.5.4.23.1"]; + [oid setObject:@"x121Address" forKey:@"2.5.4.24"]; + [oid setObject:@"internationalISDNNumber" forKey:@"2.5.4.25"]; + [oid setObject:@"collectiveInternationalISDNNumber" forKey:@"2.5.4.25.1"]; + [oid setObject:@"registeredAddress" forKey:@"2.5.4.26"]; + [oid setObject:@"destinationIndicator" forKey:@"2.5.4.27"]; + [oid setObject:@"preferredDeliveryMehtod" forKey:@"2.5.4.28"]; + [oid setObject:@"presentationAddress" forKey:@"2.5.4.29"]; + [oid setObject:@"supportedApplicationContext" forKey:@"2.5.4.30"]; + [oid setObject:@"member" forKey:@"2.5.4.31"]; + [oid setObject:@"owner" forKey:@"2.5.4.32"]; + [oid setObject:@"roleOccupant" forKey:@"2.5.4.33"]; + [oid setObject:@"seeAlso" forKey:@"2.5.4.34"]; + [oid setObject:@"userPassword" forKey:@"2.5.4.35"]; + [oid setObject:@"userCertificate" forKey:@"2.5.4.36"]; + [oid setObject:@"caCertificate" forKey:@"2.5.4.37"]; + [oid setObject:@"authorityRevocationList" forKey:@"2.5.4.38"]; + [oid setObject:@"certificateRevocationList" forKey:@"2.5.4.39"]; + [oid setObject:@"crossCertificatePair" forKey:@"2.5.4.40"]; + [oid setObject:@"name" forKey:@"2.5.4.41"]; + [oid setObject:@"givenName" forKey:@"2.5.4.42"]; + [oid setObject:@"initials" forKey:@"2.5.4.43"]; + [oid setObject:@"generationQualifier" forKey:@"2.5.4.44"]; + [oid setObject:@"uniqueIdentifier" forKey:@"2.5.4.45"]; + [oid setObject:@"dnQualifier" forKey:@"2.5.4.46"]; + [oid setObject:@"enhancedSearchGuide" forKey:@"2.5.4.47"]; + [oid setObject:@"protocolInformation" forKey:@"2.5.4.48"]; + [oid setObject:@"distinguishedName" forKey:@"2.5.4.49"]; + [oid setObject:@"uniqueMember" forKey:@"2.5.4.50"]; + [oid setObject:@"houseIdentifier" forKey:@"2.5.4.51"]; + [oid setObject:@"supportedAlgorithms" forKey:@"2.5.4.52"]; + [oid setObject:@"deltaRevocationList" forKey:@"2.5.4.53"]; + [oid setObject:@"dmdName" forKey:@"2.5.4.54"]; + [oid setObject:@"clearance" forKey:@"2.5.4.55"]; + [oid setObject:@"defaultDirQop" forKey:@"2.5.4.56"]; + [oid setObject:@"attributeIntegrityInfo" forKey:@"2.5.4.57"]; + [oid setObject:@"attributeCertificate" forKey:@"2.5.4.58"]; + [oid setObject:@"attributeCertificateRevocationList" forKey:@"2.5.4.59"]; + [oid setObject:@"confKeyInfo" forKey:@"2.5.4.60"]; + [oid setObject:@"aACertificate" forKey:@"2.5.4.61"]; + [oid setObject:@"attributeDescriptorCertificate" forKey:@"2.5.4.62"]; + [oid setObject:@"attributeAuthorityRevocationList" forKey:@"2.5.4.63"]; + [oid setObject:@"familyInformation" forKey:@"2.5.4.64"]; + [oid setObject:@"pseudonym" forKey:@"2.5.4.65"]; + [oid setObject:@"communicationsService" forKey:@"2.5.4.66"]; + [oid setObject:@"communicationsNetwork" forKey:@"2.5.4.67"]; + [oid setObject:@"certificationPracticeStmt" forKey:@"2.5.4.68"]; + [oid setObject:@"certificatePolicy" forKey:@"2.5.4.69"]; + [oid setObject:@"pkiPath" forKey:@"2.5.4.70"]; + [oid setObject:@"privPolicy" forKey:@"2.5.4.71"]; + [oid setObject:@"role" forKey:@"2.5.4.72"]; + [oid setObject:@"delegationPath" forKey:@"2.5.4.73"]; + [oid setObject:@"top" forKey:@"2.5.6.0"]; + [oid setObject:@"alias" forKey:@"2.5.6.1"]; + [oid setObject:@"country" forKey:@"2.5.6.2"]; + [oid setObject:@"locality" forKey:@"2.5.6.3"]; + [oid setObject:@"organization" forKey:@"2.5.6.4"]; + [oid setObject:@"organizationalUnit" forKey:@"2.5.6.5"]; + [oid setObject:@"person" forKey:@"2.5.6.6"]; + [oid setObject:@"organizationalPerson" forKey:@"2.5.6.7"]; + [oid setObject:@"organizationalRole" forKey:@"2.5.6.8"]; + [oid setObject:@"groupOfNames" forKey:@"2.5.6.9"]; + [oid setObject:@"residentialPerson" forKey:@"2.5.6.10"]; + [oid setObject:@"applicationProcess" forKey:@"2.5.6.11"]; + [oid setObject:@"applicationEntity" forKey:@"2.5.6.12"]; + [oid setObject:@"dSA" forKey:@"2.5.6.13"]; + [oid setObject:@"device" forKey:@"2.5.6.14"]; + [oid setObject:@"strongAuthenticationUser" forKey:@"2.5.6.15"]; + [oid setObject:@"certificateAuthority" forKey:@"2.5.6.16"]; + [oid setObject:@"groupOfUniqueNames" forKey:@"2.5.6.17"]; + [oid setObject:@"pkiUser" forKey:@"2.5.6.21"]; + [oid setObject:@"pkiCA" forKey:@"2.5.6.22"]; + [oid setObject:@"X.500-Algorithms" forKey:@"2.5.8"]; + [oid setObject:@"X.500-Alg-Encryption" forKey:@"2.5.8.1"]; + [oid setObject:@"rsa" forKey:@"2.5.8.1.1"]; + [oid setObject:@"accessControlScheme" forKey:@"2.5.24.1"]; + [oid setObject:@"prescriptiveACI" forKey:@"2.5.24.4"]; + [oid setObject:@"entryACI" forKey:@"2.5.24.5"]; + [oid setObject:@"subentryACI" forKey:@"2.5.24.6"]; + [oid setObject:@"createTimestamp" forKey:@"2.5.18.1"]; + [oid setObject:@"modifyTimestamp" forKey:@"2.5.18.2"]; + [oid setObject:@"creatorsName" forKey:@"2.5.18.3"]; + [oid setObject:@"modifiersName" forKey:@"2.5.18.4"]; + [oid setObject:@"administrativeRole" forKey:@"2.5.18.5"]; + [oid setObject:@"subtreeSpecification" forKey:@"2.5.18.6"]; + [oid setObject:@"collectiveExclusions" forKey:@"2.5.18.7"]; + [oid setObject:@"hasSubordinates" forKey:@"2.5.18.9"]; + [oid setObject:@"subschemaSubentry" forKey:@"2.5.18.10"]; + [oid setObject:@"authorityKeyIdentifier" forKey:@"2.5.29.1"]; + [oid setObject:@"keyAttributes" forKey:@"2.5.29.2"]; + [oid setObject:@"certificatePolicies" forKey:@"2.5.29.3"]; + [oid setObject:@"keyUsageRestriction" forKey:@"2.5.29.4"]; + [oid setObject:@"policyMapping" forKey:@"2.5.29.5"]; + [oid setObject:@"subtreesConstraint" forKey:@"2.5.29.6"]; + [oid setObject:@"subjectAltName" forKey:@"2.5.29.7"]; + [oid setObject:@"issuerAltName" forKey:@"2.5.29.8"]; + [oid setObject:@"subjectDirectoryAttributes" forKey:@"2.5.29.9"]; + [oid setObject:@"basicConstraints" forKey:@"2.5.29.10"]; + [oid setObject:@"nameConstraints" forKey:@"2.5.29.11"]; + [oid setObject:@"policyConstraints" forKey:@"2.5.29.12"]; + [oid setObject:@"basicConstraints" forKey:@"2.5.29.13"]; + [oid setObject:@"subjectKeyIdentifier" forKey:@"2.5.29.14"]; + [oid setObject:@"keyUsage" forKey:@"2.5.29.15"]; + [oid setObject:@"privateKeyUsagePeriod" forKey:@"2.5.29.16"]; + [oid setObject:@"subjectAltName" forKey:@"2.5.29.17"]; + [oid setObject:@"issuerAltName" forKey:@"2.5.29.18"]; + [oid setObject:@"basicConstraints" forKey:@"2.5.29.19"]; + [oid setObject:@"cRLNumber" forKey:@"2.5.29.20"]; + [oid setObject:@"cRLReason" forKey:@"2.5.29.21"]; + [oid setObject:@"expirationDate" forKey:@"2.5.29.22"]; + [oid setObject:@"instructionCode" forKey:@"2.5.29.23"]; + [oid setObject:@"invalidityDate" forKey:@"2.5.29.24"]; + [oid setObject:@"cRLDistributionPoints" forKey:@"2.5.29.25"]; + [oid setObject:@"issuingDistributionPoint" forKey:@"2.5.29.26"]; + [oid setObject:@"deltaCRLIndicator" forKey:@"2.5.29.27"]; + [oid setObject:@"issuingDistributionPoint" forKey:@"2.5.29.28"]; + [oid setObject:@"certificateIssuer" forKey:@"2.5.29.29"]; + [oid setObject:@"nameConstraints" forKey:@"2.5.29.30"]; + [oid setObject:@"cRLDistributionPoints" forKey:@"2.5.29.31"]; + [oid setObject:@"certificatePolicies" forKey:@"2.5.29.32"]; + [oid setObject:@"anyPolicy" forKey:@"2.5.29.32.0"]; + [oid setObject:@"policyMappings" forKey:@"2.5.29.33"]; + [oid setObject:@"policyConstraints" forKey:@"2.5.29.34"]; + [oid setObject:@"authorityKeyIdentifier" forKey:@"2.5.29.35"]; + [oid setObject:@"policyConstraints" forKey:@"2.5.29.36"]; + [oid setObject:@"extKeyUsage" forKey:@"2.5.29.37"]; + [oid setObject:@"freshestCRL" forKey:@"2.5.29.46"]; + [oid setObject:@"inhibitAnyPolicy" forKey:@"2.5.29.54"]; + [oid setObject:@"sdnsSignatureAlgorithm" forKey:@"2.16.840.1.101.2.1.1.1"]; + [oid setObject:@"fortezzaSignatureAlgorithm" forKey:@"2.16.840.1.101.2.1.1.2"]; + [oid setObject:@"sdnsConfidentialityAlgorithm" forKey:@"2.16.840.1.101.2.1.1.3"]; + [oid setObject:@"fortezzaConfidentialityAlgorithm" forKey:@"2.16.840.1.101.2.1.1.4"]; + [oid setObject:@"sdnsIntegrityAlgorithm" forKey:@"2.16.840.1.101.2.1.1.5"]; + [oid setObject:@"fortezzaIntegrityAlgorithm" forKey:@"2.16.840.1.101.2.1.1.6"]; + [oid setObject:@"sdnsTokenProtectionAlgorithm" forKey:@"2.16.840.1.101.2.1.1.7"]; + [oid setObject:@"fortezzaTokenProtectionAlgorithm" forKey:@"2.16.840.1.101.2.1.1.8"]; + [oid setObject:@"sdnsKeyManagementAlgorithm" forKey:@"2.16.840.1.101.2.1.1.9"]; + [oid setObject:@"fortezzaKeyManagementAlgorithm" forKey:@"2.16.840.1.101.2.1.1.10"]; + [oid setObject:@"sdnsKMandSigAlgorithm" forKey:@"2.16.840.1.101.2.1.1.11"]; + [oid setObject:@"fortezzaKMandSigAlgorithm" forKey:@"2.16.840.1.101.2.1.1.12"]; + [oid setObject:@"suiteASignatureAlgorithm" forKey:@"2.16.840.1.101.2.1.1.13"]; + [oid setObject:@"suiteAConfidentialityAlgorithm" forKey:@"2.16.840.1.101.2.1.1.14"]; + [oid setObject:@"suiteAIntegrityAlgorithm" forKey:@"2.16.840.1.101.2.1.1.15"]; + [oid setObject:@"suiteATokenProtectionAlgorithm" forKey:@"2.16.840.1.101.2.1.1.16"]; + [oid setObject:@"suiteAKeyManagementAlgorithm" forKey:@"2.16.840.1.101.2.1.1.17"]; + [oid setObject:@"suiteAKMandSigAlgorithm" forKey:@"2.16.840.1.101.2.1.1.18"]; + [oid setObject:@"fortezzaUpdatedSigAlgorithm" forKey:@"2.16.840.1.101.2.1.1.19"]; + [oid setObject:@"fortezzaKMandUpdSigAlgorithms" forKey:@"2.16.840.1.101.2.1.1.20"]; + [oid setObject:@"fortezzaUpdatedIntegAlgorithm" forKey:@"2.16.840.1.101.2.1.1.21"]; + [oid setObject:@"keyExchangeAlgorithm" forKey:@"2.16.840.1.101.2.1.1.22"]; + [oid setObject:@"fortezzaWrap80Algorithm" forKey:@"2.16.840.1.101.2.1.1.23"]; + [oid setObject:@"kEAKeyEncryptionAlgorithm" forKey:@"2.16.840.1.101.2.1.1.24"]; + [oid setObject:@"rfc822MessageFormat" forKey:@"2.16.840.1.101.2.1.2.1"]; + [oid setObject:@"emptyContent" forKey:@"2.16.840.1.101.2.1.2.2"]; + [oid setObject:@"cspContentType" forKey:@"2.16.840.1.101.2.1.2.3"]; + [oid setObject:@"mspRev3ContentType" forKey:@"2.16.840.1.101.2.1.2.42"]; + [oid setObject:@"mspContentType" forKey:@"2.16.840.1.101.2.1.2.48"]; + [oid setObject:@"mspRekeyAgentProtocol" forKey:@"2.16.840.1.101.2.1.2.49"]; + [oid setObject:@"mspMMP" forKey:@"2.16.840.1.101.2.1.2.50"]; + [oid setObject:@"mspRev3-1ContentType" forKey:@"2.16.840.1.101.2.1.2.66"]; + [oid setObject:@"forwardedMSPMessageBodyPart" forKey:@"2.16.840.1.101.2.1.2.72"]; + [oid setObject:@"mspForwardedMessageParameters" forKey:@"2.16.840.1.101.2.1.2.73"]; + [oid setObject:@"forwardedCSPMsgBodyPart" forKey:@"2.16.840.1.101.2.1.2.74"]; + [oid setObject:@"cspForwardedMessageParameters" forKey:@"2.16.840.1.101.2.1.2.75"]; + [oid setObject:@"mspMMP2" forKey:@"2.16.840.1.101.2.1.2.76"]; + [oid setObject:@"sdnsSecurityPolicy" forKey:@"2.16.840.1.101.2.1.3.1"]; + [oid setObject:@"sdnsPRBAC" forKey:@"2.16.840.1.101.2.1.3.2"]; + [oid setObject:@"mosaicPRBAC" forKey:@"2.16.840.1.101.2.1.3.3"]; + [oid setObject:@"siSecurityPolicy" forKey:@"2.16.840.1.101.2.1.3.10"]; + [oid setObject:@"siNASP" forKey:@"2.16.840.1.101.2.1.3.10.0"]; + [oid setObject:@"siELCO" forKey:@"2.16.840.1.101.2.1.3.10.1"]; + [oid setObject:@"siTK" forKey:@"2.16.840.1.101.2.1.3.10.2"]; + [oid setObject:@"siDSAP" forKey:@"2.16.840.1.101.2.1.3.10.3"]; + [oid setObject:@"siSSSS" forKey:@"2.16.840.1.101.2.1.3.10.4"]; + [oid setObject:@"siDNASP" forKey:@"2.16.840.1.101.2.1.3.10.5"]; + [oid setObject:@"siBYEMAN" forKey:@"2.16.840.1.101.2.1.3.10.6"]; + [oid setObject:@"siREL-US" forKey:@"2.16.840.1.101.2.1.3.10.7"]; + [oid setObject:@"siREL-AUS" forKey:@"2.16.840.1.101.2.1.3.10.8"]; + [oid setObject:@"siREL-CAN" forKey:@"2.16.840.1.101.2.1.3.10.9"]; + [oid setObject:@"siREL_UK" forKey:@"2.16.840.1.101.2.1.3.10.10"]; + [oid setObject:@"siREL-NZ" forKey:@"2.16.840.1.101.2.1.3.10.11"]; + [oid setObject:@"siGeneric" forKey:@"2.16.840.1.101.2.1.3.10.12"]; + [oid setObject:@"genser" forKey:@"2.16.840.1.101.2.1.3.11"]; + [oid setObject:@"genserNations" forKey:@"2.16.840.1.101.2.1.3.11.0"]; + [oid setObject:@"genserComsec" forKey:@"2.16.840.1.101.2.1.3.11.1"]; + [oid setObject:@"genserAcquisition" forKey:@"2.16.840.1.101.2.1.3.11.2"]; + [oid setObject:@"genserSecurityCategories" forKey:@"2.16.840.1.101.2.1.3.11.3"]; + [oid setObject:@"genserTagSetName" forKey:@"2.16.840.1.101.2.1.3.11.3.0"]; + [oid setObject:@"defaultSecurityPolicy" forKey:@"2.16.840.1.101.2.1.3.12"]; + [oid setObject:@"capcoMarkings" forKey:@"2.16.840.1.101.2.1.3.13"]; + [oid setObject:@"capcoSecurityCategories" forKey:@"2.16.840.1.101.2.1.3.13.0"]; + [oid setObject:@"capcoTagSetName1" forKey:@"2.16.840.1.101.2.1.3.13.0.1"]; + [oid setObject:@"capcoTagSetName2" forKey:@"2.16.840.1.101.2.1.3.13.0.2"]; + [oid setObject:@"capcoTagSetName3" forKey:@"2.16.840.1.101.2.1.3.13.0.3"]; + [oid setObject:@"capcoTagSetName4" forKey:@"2.16.840.1.101.2.1.3.13.0.4"]; + [oid setObject:@"sdnsKeyManagementCertificate" forKey:@"2.16.840.1.101.2.1.5.1"]; + [oid setObject:@"sdnsUserSignatureCertificate" forKey:@"2.16.840.1.101.2.1.5.2"]; + [oid setObject:@"sdnsKMandSigCertificate" forKey:@"2.16.840.1.101.2.1.5.3"]; + [oid setObject:@"fortezzaKeyManagementCertificate" forKey:@"2.16.840.1.101.2.1.5.4"]; + [oid setObject:@"fortezzaKMandSigCertificate" forKey:@"2.16.840.1.101.2.1.5.5"]; + [oid setObject:@"fortezzaUserSignatureCertificate" forKey:@"2.16.840.1.101.2.1.5.6"]; + [oid setObject:@"fortezzaCASignatureCertificate" forKey:@"2.16.840.1.101.2.1.5.7"]; + [oid setObject:@"sdnsCASignatureCertificate" forKey:@"2.16.840.1.101.2.1.5.8"]; + [oid setObject:@"auxiliaryVector" forKey:@"2.16.840.1.101.2.1.5.10"]; + [oid setObject:@"mlReceiptPolicy" forKey:@"2.16.840.1.101.2.1.5.11"]; + [oid setObject:@"mlMembership" forKey:@"2.16.840.1.101.2.1.5.12"]; + [oid setObject:@"mlAdministrators" forKey:@"2.16.840.1.101.2.1.5.13"]; + [oid setObject:@"alid" forKey:@"2.16.840.1.101.2.1.5.14"]; + [oid setObject:@"janUKMs" forKey:@"2.16.840.1.101.2.1.5.20"]; + [oid setObject:@"febUKMs" forKey:@"2.16.840.1.101.2.1.5.21"]; + [oid setObject:@"marUKMs" forKey:@"2.16.840.1.101.2.1.5.22"]; + [oid setObject:@"aprUKMs" forKey:@"2.16.840.1.101.2.1.5.23"]; + [oid setObject:@"mayUKMs" forKey:@"2.16.840.1.101.2.1.5.24"]; + [oid setObject:@"junUKMs" forKey:@"2.16.840.1.101.2.1.5.25"]; + [oid setObject:@"julUKMs" forKey:@"2.16.840.1.101.2.1.5.26"]; + [oid setObject:@"augUKMs" forKey:@"2.16.840.1.101.2.1.5.27"]; + [oid setObject:@"sepUKMs" forKey:@"2.16.840.1.101.2.1.5.28"]; + [oid setObject:@"octUKMs" forKey:@"2.16.840.1.101.2.1.5.29"]; + [oid setObject:@"novUKMs" forKey:@"2.16.840.1.101.2.1.5.30"]; + [oid setObject:@"decUKMs" forKey:@"2.16.840.1.101.2.1.5.31"]; + [oid setObject:@"metaSDNSckl" forKey:@"2.16.840.1.101.2.1.5.40"]; + [oid setObject:@"sdnsCKL" forKey:@"2.16.840.1.101.2.1.5.41"]; + [oid setObject:@"metaSDNSsignatureCKL" forKey:@"2.16.840.1.101.2.1.5.42"]; + [oid setObject:@"sdnsSignatureCKL" forKey:@"2.16.840.1.101.2.1.5.43"]; + [oid setObject:@"sdnsCertificateRevocationList" forKey:@"2.16.840.1.101.2.1.5.44"]; + [oid setObject:@"fortezzaCertificateRevocationList" forKey:@"2.16.840.1.101.2.1.5.45"]; + [oid setObject:@"fortezzaCKL" forKey:@"2.16.840.1.101.2.1.5.46"]; + [oid setObject:@"alExemptedAddressProcessor" forKey:@"2.16.840.1.101.2.1.5.47"]; + [oid setObject:@"guard" forKey:@"2.16.840.1.101.2.1.5.48"]; + [oid setObject:@"algorithmsSupported" forKey:@"2.16.840.1.101.2.1.5.49"]; + [oid setObject:@"suiteAKeyManagementCertificate" forKey:@"2.16.840.1.101.2.1.5.50"]; + [oid setObject:@"suiteAKMandSigCertificate" forKey:@"2.16.840.1.101.2.1.5.51"]; + [oid setObject:@"suiteAUserSignatureCertificate" forKey:@"2.16.840.1.101.2.1.5.52"]; + [oid setObject:@"prbacInfo" forKey:@"2.16.840.1.101.2.1.5.53"]; + [oid setObject:@"prbacCAConstraints" forKey:@"2.16.840.1.101.2.1.5.54"]; + [oid setObject:@"sigOrKMPrivileges" forKey:@"2.16.840.1.101.2.1.5.55"]; + [oid setObject:@"commPrivileges" forKey:@"2.16.840.1.101.2.1.5.56"]; + [oid setObject:@"labeledAttribute" forKey:@"2.16.840.1.101.2.1.5.57"]; + [oid setObject:@"policyInformationFile" forKey:@"2.16.840.1.101.2.1.5.58"]; + [oid setObject:@"secPolicyInformationFile" forKey:@"2.16.840.1.101.2.1.5.59"]; + [oid setObject:@"cAClearanceConstraint" forKey:@"2.16.840.1.101.2.1.5.60"]; + [oid setObject:@"cspExtns" forKey:@"2.16.840.1.101.2.1.7.1"]; + [oid setObject:@"cspCsExtn" forKey:@"2.16.840.1.101.2.1.7.1.0"]; + [oid setObject:@"mISSISecurityCategories" forKey:@"2.16.840.1.101.2.1.8.1"]; + [oid setObject:@"standardSecurityLabelPrivileges" forKey:@"2.16.840.1.101.2.1.8.2"]; + [oid setObject:@"sigPrivileges" forKey:@"2.16.840.1.101.2.1.10.1"]; + [oid setObject:@"kmPrivileges" forKey:@"2.16.840.1.101.2.1.10.2"]; + [oid setObject:@"namedTagSetPrivilege" forKey:@"2.16.840.1.101.2.1.10.3"]; + [oid setObject:@"ukDemo" forKey:@"2.16.840.1.101.2.1.11.1"]; + [oid setObject:@"usDODClass2" forKey:@"2.16.840.1.101.2.1.11.2"]; + [oid setObject:@"usMediumPilot" forKey:@"2.16.840.1.101.2.1.11.3"]; + [oid setObject:@"usDODClass4" forKey:@"2.16.840.1.101.2.1.11.4"]; + [oid setObject:@"usDODClass3" forKey:@"2.16.840.1.101.2.1.11.5"]; + [oid setObject:@"usDODClass5" forKey:@"2.16.840.1.101.2.1.11.6"]; + [oid setObject:@"testSecurityPolicy" forKey:@"2.16.840.1.101.2.1.12.0"]; + [oid setObject:@"tsp1" forKey:@"2.16.840.1.101.2.1.12.0.1"]; + [oid setObject:@"tsp1SecurityCategories" forKey:@"2.16.840.1.101.2.1.12.0.1.0"]; + [oid setObject:@"tsp1TagSetZero" forKey:@"2.16.840.1.101.2.1.12.0.1.0.0"]; + [oid setObject:@"tsp1TagSetOne" forKey:@"2.16.840.1.101.2.1.12.0.1.0.1"]; + [oid setObject:@"tsp1TagSetTwo" forKey:@"2.16.840.1.101.2.1.12.0.1.0.2"]; + [oid setObject:@"tsp2" forKey:@"2.16.840.1.101.2.1.12.0.2"]; + [oid setObject:@"tsp2SecurityCategories" forKey:@"2.16.840.1.101.2.1.12.0.2.0"]; + [oid setObject:@"tsp2TagSetZero" forKey:@"2.16.840.1.101.2.1.12.0.2.0.0"]; + [oid setObject:@"tsp2TagSetOne" forKey:@"2.16.840.1.101.2.1.12.0.2.0.1"]; + [oid setObject:@"tsp2TagSetTwo" forKey:@"2.16.840.1.101.2.1.12.0.2.0.2"]; + [oid setObject:@"kafka" forKey:@"2.16.840.1.101.2.1.12.0.3"]; + [oid setObject:@"kafkaSecurityCategories" forKey:@"2.16.840.1.101.2.1.12.0.3.0"]; + [oid setObject:@"kafkaTagSetName1" forKey:@"2.16.840.1.101.2.1.12.0.3.0.1"]; + [oid setObject:@"kafkaTagSetName2" forKey:@"2.16.840.1.101.2.1.12.0.3.0.2"]; + [oid setObject:@"kafkaTagSetName3" forKey:@"2.16.840.1.101.2.1.12.0.3.0.3"]; + [oid setObject:@"tcp1" forKey:@"2.16.840.1.101.2.1.12.1.1"]; + [oid setObject:@"slabel" forKey:@"2.16.840.1.101.3.1"]; + [oid setObject:@"pki" forKey:@"2.16.840.1.101.3.2"]; + [oid setObject:@"GAK policyIdentifier" forKey:@"2.16.840.1.101.3.2.1"]; + [oid setObject:@"FBCA-Rudimentary policyIdentifier" forKey:@"2.16.840.1.101.3.2.1.3.1"]; + [oid setObject:@"FBCA-Basic policyIdentifier" forKey:@"2.16.840.1.101.3.2.1.3.2"]; + [oid setObject:@"FBCA-Medium policyIdentifier" forKey:@"2.16.840.1.101.3.2.1.3.3"]; + [oid setObject:@"FBCA-High policyIdentifier" forKey:@"2.16.840.1.101.3.2.1.3.4"]; + [oid setObject:@"GAK" forKey:@"2.16.840.1.101.3.2.2"]; + [oid setObject:@"kRAKey" forKey:@"2.16.840.1.101.3.2.2.1"]; + [oid setObject:@"extensions" forKey:@"2.16.840.1.101.3.2.3"]; + [oid setObject:@"kRTechnique" forKey:@"2.16.840.1.101.3.2.3.1"]; + [oid setObject:@"kRecoveryCapable" forKey:@"2.16.840.1.101.3.2.3.2"]; + [oid setObject:@"kR" forKey:@"2.16.840.1.101.3.2.3.3"]; + [oid setObject:@"keyrecoveryschemes" forKey:@"2.16.840.1.101.3.2.4"]; + [oid setObject:@"krapola" forKey:@"2.16.840.1.101.3.2.5"]; + [oid setObject:@"arpa" forKey:@"2.16.840.1.101.3.3"]; + [oid setObject:@"nistAlgorithm" forKey:@"2.16.840.1.101.3.4"]; + [oid setObject:@"aes" forKey:@"2.16.840.1.101.3.4.1"]; + [oid setObject:@"aes128-ECB" forKey:@"2.16.840.1.101.3.4.1.1"]; + [oid setObject:@"aes128-CBC" forKey:@"2.16.840.1.101.3.4.1.2"]; + [oid setObject:@"aes128-OFB" forKey:@"2.16.840.1.101.3.4.1.3"]; + [oid setObject:@"aes128-CFB" forKey:@"2.16.840.1.101.3.4.1.4"]; + [oid setObject:@"aes192-ECB" forKey:@"2.16.840.1.101.3.4.1.21"]; + [oid setObject:@"aes192-CBC" forKey:@"2.16.840.1.101.3.4.1.22"]; + [oid setObject:@"aes192-OFB" forKey:@"2.16.840.1.101.3.4.1.23"]; + [oid setObject:@"aes192-CFB" forKey:@"2.16.840.1.101.3.4.1.24"]; + [oid setObject:@"aes256-ECB" forKey:@"2.16.840.1.101.3.4.1.41"]; + [oid setObject:@"aes256-CBC" forKey:@"2.16.840.1.101.3.4.1.42"]; + [oid setObject:@"aes256-OFB" forKey:@"2.16.840.1.101.3.4.1.43"]; + [oid setObject:@"aes256-CFB" forKey:@"2.16.840.1.101.3.4.1.44"]; + [oid setObject:@"sha2-256" forKey:@"2.16.840.1.101.3.4.2.1"]; + [oid setObject:@"sha2-384" forKey:@"2.16.840.1.101.3.4.2.2"]; + [oid setObject:@"sha2-512" forKey:@"2.16.840.1.101.3.4.2.3"]; + [oid setObject:@"novellAlgorithm" forKey:@"2.16.840.1.113719.1.2.8"]; + [oid setObject:@"desCbcIV8" forKey:@"2.16.840.1.113719.1.2.8.22"]; + [oid setObject:@"desCbcPadIV8" forKey:@"2.16.840.1.113719.1.2.8.23"]; + [oid setObject:@"desEDE2CbcIV8" forKey:@"2.16.840.1.113719.1.2.8.24"]; + [oid setObject:@"desEDE2CbcPadIV8" forKey:@"2.16.840.1.113719.1.2.8.25"]; + [oid setObject:@"desEDE3CbcIV8" forKey:@"2.16.840.1.113719.1.2.8.26"]; + [oid setObject:@"desEDE3CbcPadIV8" forKey:@"2.16.840.1.113719.1.2.8.27"]; + [oid setObject:@"rc5CbcPad" forKey:@"2.16.840.1.113719.1.2.8.28"]; + [oid setObject:@"md2WithRSAEncryptionBSafe1" forKey:@"2.16.840.1.113719.1.2.8.29"]; + [oid setObject:@"md5WithRSAEncryptionBSafe1" forKey:@"2.16.840.1.113719.1.2.8.30"]; + [oid setObject:@"sha1WithRSAEncryptionBSafe1" forKey:@"2.16.840.1.113719.1.2.8.31"]; + [oid setObject:@"LMDigest" forKey:@"2.16.840.1.113719.1.2.8.32"]; + [oid setObject:@"MD2" forKey:@"2.16.840.1.113719.1.2.8.40"]; + [oid setObject:@"MD5" forKey:@"2.16.840.1.113719.1.2.8.50"]; + [oid setObject:@"IKEhmacWithSHA1-RSA" forKey:@"2.16.840.1.113719.1.2.8.51"]; + [oid setObject:@"IKEhmacWithMD5-RSA" forKey:@"2.16.840.1.113719.1.2.8.52"]; + [oid setObject:@"rc2CbcPad" forKey:@"2.16.840.1.113719.1.2.8.69"]; + [oid setObject:@"SHA-1" forKey:@"2.16.840.1.113719.1.2.8.82"]; + [oid setObject:@"rc2BSafe1Cbc" forKey:@"2.16.840.1.113719.1.2.8.92"]; + [oid setObject:@"MD4" forKey:@"2.16.840.1.113719.1.2.8.95"]; + [oid setObject:@"MD4Packet" forKey:@"2.16.840.1.113719.1.2.8.130"]; + [oid setObject:@"rsaEncryptionBsafe1" forKey:@"2.16.840.1.113719.1.2.8.131"]; + [oid setObject:@"NWPassword" forKey:@"2.16.840.1.113719.1.2.8.132"]; + [oid setObject:@"novellObfuscate-1" forKey:@"2.16.840.1.113719.1.2.8.133"]; + [oid setObject:@"pki" forKey:@"2.16.840.1.113719.1.9"]; + [oid setObject:@"pkiAttributeType" forKey:@"2.16.840.1.113719.1.9.4"]; + [oid setObject:@"securityAttributes" forKey:@"2.16.840.1.113719.1.9.4.1"]; + [oid setObject:@"relianceLimit" forKey:@"2.16.840.1.113719.1.9.4.2"]; + [oid setObject:@"cert-extension" forKey:@"2.16.840.1.113730.1"]; + [oid setObject:@"netscape-cert-type" forKey:@"2.16.840.1.113730.1.1"]; + [oid setObject:@"netscape-base-url" forKey:@"2.16.840.1.113730.1.2"]; + [oid setObject:@"netscape-revocation-url" forKey:@"2.16.840.1.113730.1.3"]; + [oid setObject:@"netscape-ca-revocation-url" forKey:@"2.16.840.1.113730.1.4"]; + [oid setObject:@"netscape-cert-renewal-url" forKey:@"2.16.840.1.113730.1.7"]; + [oid setObject:@"netscape-ca-policy-url" forKey:@"2.16.840.1.113730.1.8"]; + [oid setObject:@"HomePage-url" forKey:@"2.16.840.1.113730.1.9"]; + [oid setObject:@"EntityLogo" forKey:@"2.16.840.1.113730.1.10"]; + [oid setObject:@"UserPicture" forKey:@"2.16.840.1.113730.1.11"]; + [oid setObject:@"netscape-ssl-server-name" forKey:@"2.16.840.1.113730.1.12"]; + [oid setObject:@"netscape-comment" forKey:@"2.16.840.1.113730.1.13"]; + [oid setObject:@"data-type" forKey:@"2.16.840.1.113730.2"]; + [oid setObject:@"dataGIF" forKey:@"2.16.840.1.113730.2.1"]; + [oid setObject:@"dataJPEG" forKey:@"2.16.840.1.113730.2.2"]; + [oid setObject:@"dataURL" forKey:@"2.16.840.1.113730.2.3"]; + [oid setObject:@"dataHTML" forKey:@"2.16.840.1.113730.2.4"]; + [oid setObject:@"certSequence" forKey:@"2.16.840.1.113730.2.5"]; + [oid setObject:@"certURL" forKey:@"2.16.840.1.113730.2.6"]; + [oid setObject:@"directory" forKey:@"2.16.840.1.113730.3"]; + [oid setObject:@"ldapDefinitions" forKey:@"2.16.840.1.113730.3.1"]; + [oid setObject:@"carLicense" forKey:@"2.16.840.1.113730.3.1.1"]; + [oid setObject:@"departmentNumber" forKey:@"2.16.840.1.113730.3.1.2"]; + [oid setObject:@"employeeNumber" forKey:@"2.16.840.1.113730.3.1.3"]; + [oid setObject:@"employeeType" forKey:@"2.16.840.1.113730.3.1.4"]; + [oid setObject:@"inetOrgPerson" forKey:@"2.16.840.1.113730.3.2.2"]; + [oid setObject:@"serverGatedCrypto" forKey:@"2.16.840.1.113730.4.1"]; + [oid setObject:@"verisignCZAG" forKey:@"2.16.840.1.113733.1.6.3"]; + [oid setObject:@"verisignInBox" forKey:@"2.16.840.1.113733.1.6.6"]; + [oid setObject:@"Unknown Verisign VPN extension" forKey:@"2.16.840.1.113733.1.6.11"]; + [oid setObject:@"Unknown Verisign VPN extension" forKey:@"2.16.840.1.113733.1.6.13"]; + [oid setObject:@"Verisign serverID" forKey:@"2.16.840.1.113733.1.6.15"]; + [oid setObject:@"Verisign policyIdentifier" forKey:@"2.16.840.1.113733.1.7.1.1"]; + [oid setObject:@"verisignCPSv1notice" forKey:@"2.16.840.1.113733.1.7.1.1.1"]; + [oid setObject:@"verisignCPSv1nsi" forKey:@"2.16.840.1.113733.1.7.1.1.2"]; + [oid setObject:@"Verisign SGC CA?" forKey:@"2.16.840.1.113733.1.8.1"]; + [oid setObject:@"contentType" forKey:@"2.23.42.0"]; + [oid setObject:@"PANData" forKey:@"2.23.42.0.0"]; + [oid setObject:@"PANToken" forKey:@"2.23.42.0.1"]; + [oid setObject:@"PANOnly" forKey:@"2.23.42.0.2"]; + [oid setObject:@"msgExt" forKey:@"2.23.42.1"]; + [oid setObject:@"field" forKey:@"2.23.42.2"]; + [oid setObject:@"fullName" forKey:@"2.23.42.2.0"]; + [oid setObject:@"givenName" forKey:@"2.23.42.2.1"]; + [oid setObject:@"familyName" forKey:@"2.23.42.2.2"]; + [oid setObject:@"birthFamilyName" forKey:@"2.23.42.2.3"]; + [oid setObject:@"placeName" forKey:@"2.23.42.2.4"]; + [oid setObject:@"identificationNumber" forKey:@"2.23.42.2.5"]; + [oid setObject:@"month" forKey:@"2.23.42.2.6"]; + [oid setObject:@"date" forKey:@"2.23.42.2.7"]; + [oid setObject:@"address" forKey:@"2.23.42.2.8"]; + [oid setObject:@"telephone" forKey:@"2.23.42.2.9"]; + [oid setObject:@"amount" forKey:@"2.23.42.2.10"]; + [oid setObject:@"accountNumber" forKey:@"2.23.42.2.7.11"]; + [oid setObject:@"passPhrase" forKey:@"2.23.42.2.7.12"]; + [oid setObject:@"attribute" forKey:@"2.23.42.3"]; + [oid setObject:@"cert" forKey:@"2.23.42.3.0"]; + [oid setObject:@"rootKeyThumb" forKey:@"2.23.42.3.0.0"]; + [oid setObject:@"additionalPolicy" forKey:@"2.23.42.3.0.1"]; + [oid setObject:@"algorithm" forKey:@"2.23.42.4"]; + [oid setObject:@"policy" forKey:@"2.23.42.5"]; + [oid setObject:@"root" forKey:@"2.23.42.5.0"]; + [oid setObject:@"module" forKey:@"2.23.42.6"]; + [oid setObject:@"certExt" forKey:@"2.23.42.7"]; + [oid setObject:@"hashedRootKey" forKey:@"2.23.42.7.0"]; + [oid setObject:@"certificateType" forKey:@"2.23.42.7.1"]; + [oid setObject:@"merchantData" forKey:@"2.23.42.7.2"]; + [oid setObject:@"cardCertRequired" forKey:@"2.23.42.7.3"]; + [oid setObject:@"tunneling" forKey:@"2.23.42.7.4"]; + [oid setObject:@"setExtensions" forKey:@"2.23.42.7.5"]; + [oid setObject:@"setQualifier" forKey:@"2.23.42.7.6"]; + [oid setObject:@"brand" forKey:@"2.23.42.8"]; + [oid setObject:@"IATA-ATA" forKey:@"2.23.42.8.1"]; + [oid setObject:@"VISA" forKey:@"2.23.42.8.4"]; + [oid setObject:@"MasterCard" forKey:@"2.23.42.8.5"]; + [oid setObject:@"Diners" forKey:@"2.23.42.8.30"]; + [oid setObject:@"AmericanExpress" forKey:@"2.23.42.8.34"]; + [oid setObject:@"Novus" forKey:@"2.23.42.8.6011"]; + [oid setObject:@"vendor" forKey:@"2.23.42.9"]; + [oid setObject:@"GlobeSet" forKey:@"2.23.42.9.0"]; + [oid setObject:@"IBM" forKey:@"2.23.42.9.1"]; + [oid setObject:@"CyberCash" forKey:@"2.23.42.9.2"]; + [oid setObject:@"Terisa" forKey:@"2.23.42.9.3"]; + [oid setObject:@"RSADSI" forKey:@"2.23.42.9.4"]; + [oid setObject:@"VeriFone" forKey:@"2.23.42.9.5"]; + [oid setObject:@"TrinTech" forKey:@"2.23.42.9.6"]; + [oid setObject:@"BankGate" forKey:@"2.23.42.9.7"]; + [oid setObject:@"GTE" forKey:@"2.23.42.9.8"]; + [oid setObject:@"CompuSource" forKey:@"2.23.42.9.9"]; + [oid setObject:@"Griffin" forKey:@"2.23.42.9.10"]; + [oid setObject:@"Certicom" forKey:@"2.23.42.9.11"]; + [oid setObject:@"OSS" forKey:@"2.23.42.9.12"]; + [oid setObject:@"TenthMountain" forKey:@"2.23.42.9.13"]; + [oid setObject:@"Antares" forKey:@"2.23.42.9.14"]; + [oid setObject:@"ECC" forKey:@"2.23.42.9.15"]; + [oid setObject:@"Maithean" forKey:@"2.23.42.9.16"]; + [oid setObject:@"Netscape" forKey:@"2.23.42.9.17"]; + [oid setObject:@"Verisign" forKey:@"2.23.42.9.18"]; + [oid setObject:@"BlueMoney" forKey:@"2.23.42.9.19"]; + [oid setObject:@"Lacerte" forKey:@"2.23.42.9.20"]; + [oid setObject:@"Fujitsu" forKey:@"2.23.42.9.21"]; + [oid setObject:@"eLab" forKey:@"2.23.42.9.22"]; + [oid setObject:@"Entrust" forKey:@"2.23.42.9.23"]; + [oid setObject:@"VIAnet" forKey:@"2.23.42.9.24"]; + [oid setObject:@"III" forKey:@"2.23.42.9.25"]; + [oid setObject:@"OpenMarket" forKey:@"2.23.42.9.26"]; + [oid setObject:@"Lexem" forKey:@"2.23.42.9.27"]; + [oid setObject:@"Intertrader" forKey:@"2.23.42.9.28"]; + [oid setObject:@"Persimmon" forKey:@"2.23.42.9.29"]; + [oid setObject:@"NABLE" forKey:@"2.23.42.9.30"]; + [oid setObject:@"espace-net" forKey:@"2.23.42.9.31"]; + [oid setObject:@"Hitachi" forKey:@"2.23.42.9.32"]; + [oid setObject:@"Microsoft" forKey:@"2.23.42.9.33"]; + [oid setObject:@"NEC" forKey:@"2.23.42.9.34"]; + [oid setObject:@"Mitsubishi" forKey:@"2.23.42.9.35"]; + [oid setObject:@"NCR" forKey:@"2.23.42.9.36"]; + [oid setObject:@"e-COMM" forKey:@"2.23.42.9.37"]; + [oid setObject:@"Gemplus" forKey:@"2.23.42.9.38"]; + [oid setObject:@"national" forKey:@"2.23.42.10"]; + [oid setObject:@"Japan" forKey:@"2.23.42.10.392"]; + [oid setObject:@"hashedRootKey" forKey:@"2.54.1775.2"]; + [oid setObject:@"certificateType" forKey:@"2.54.1775.3"]; + [oid setObject:@"merchantData" forKey:@"2.54.1775.4"]; + [oid setObject:@"cardCertRequired" forKey:@"2.54.1775.5"]; + [oid setObject:@"tunneling" forKey:@"2.54.1775.6"]; + [oid setObject:@"setQualifier" forKey:@"2.54.1775.7"]; + [oid setObject:@"set-data" forKey:@"2.54.1775.99"]; + } + *decapsulatePos = -1; + *decapsulateLen = -1; + switch (tag->t_class) { + case UNIVERSAL: + switch (tag->t_tagnum) { + case ASN1_BOOLEAN: // BOOLEAN + c = [d byteAtOffset:pos++]; + if (c == 0xff) + value = [NSString stringWithString: @"TRUE"]; + else if (c == 0x00) + value = [NSString stringWithString: @"FALSE"]; + else + value = [NSString stringWithFormat: @"0x%02x", c]; + break; + case ASN1_INTEGER: // INTEGER + c = [d byteAtOffset:pos++]; + if (c & 0x80) // Negative + iv = (signed char)c; + else + iv = (unsigned char)c; + for (n = 1; n < len; n++) + iv = (iv << 8) | [d byteAtOffset:pos++]; + value = [NSString stringWithFormat:@"%ld", iv]; + break; + case ASN1_OBJECT_IDENTIFIER: // OID + iv = 0; + NSMutableString *oidString = [NSMutableString string]; + for (n = 0; n < len; n++) { + c = [d byteAtOffset:pos++]; + iv = (iv << 7) | (c & 0x7f); + if (c & 0x80) + continue; + if (n == 0) { + if (iv < 40) + [oidString appendFormat:@"0.%ld", iv]; + else if (iv < 80) + [oidString appendFormat:@"1.%ld", iv - 40]; + else + [oidString appendFormat:@"2.%ld", iv - 80]; + } else { + [oidString appendFormat:@".%ld", iv]; + } + iv = 0; + } + value = [oid valueForKey:oidString]; + if (value == nil) + value = oidString; + break; + case ASN1_BIT_STRING: // BIT STRING + // BIT STRINGs may encapsulate stuff after the + // leading "unused-bits" octet, which is why + // the +1 and -1 are needed + if (isEncapsulated(d, pos + 1, len - 1)) { + [value appendString:@" encapsulating {"]; + *decapsulatePos = pos + 1; + *decapsulateLen = len - 1; + // dump(d, pos, pos + len - 1, parent, standard); + } else { + [value appendString:printBit(d, pos, len)]; + pos += len; + } + break; + case ASN1_OCTET_STRING: + if (isEncapsulated(d, pos, len)) { + [value appendString:@" encapsulating {"]; + *decapsulatePos = pos; + *decapsulateLen = len; + //pos = dump(d, pos, pos + len, parent, standard); + } else { + if (textoctets) { + [value appendString:@"\""]; + [value appendString:printText(d, pos, len)]; + [value appendString:@"\""]; + pos += len; + } else if (len > 0) { + [value appendString:@"0x"]; + [value appendString:printOctet(d, pos, len)]; + pos += len; + } + } + break; + default: // OCTET STRING, anything else + if (textoctets) { + [value appendString:@"\""]; + [value appendString:printText(d, pos, len)]; + [value appendString:@"\""]; + pos += len; + } else if (len > 0) { + [value appendString:@"0x"]; + [value appendString:printOctet(d, pos, len)]; + pos += len; + } + break; + case ASN1_NULL: // NULL + break; + case ASN1_ENUMERATED: // ENUMERATED + if (len > 0) { + [value appendString:@"0x"]; + [value appendString:printOctet(d, pos, len)]; + pos += len; + } + break; + case ASN1_ObjectDescriptor: + case ASN1_NumericString: + case ASN1_UTF8String: + case ASN1_PrintableString: + case ASN1_TeletexString: + case ASN1_VideotexString: + case ASN1_IA5String: + case ASN1_UTCTime: + case ASN1_GeneralizedTime: + case ASN1_GraphicString: + case ASN1_VisibleString: + case ASN1_GeneralString: + [value appendString:@"\""]; + [value appendString:printText(d, pos, len)]; + [value appendString:@"\""]; + pos += len; + break; + } + break; + case APPLICATION: + case CONTEXT: + case PRIVATE: // Treat other stuff as an OCTET + if (textoctets) { // STRING. + [value appendString:@"\""]; + [value appendString:printText(d, pos, len)]; + [value appendString:@"\""]; + pos += len; + } else { + [value appendString:@"0x"]; + [value appendString:printOctet(d, pos, len)]; + pos += len; + } + break; + } + return value; +} + +/* + * Dump BER-encoded data from the file, until a checkpoint is reached + * (which is the calculated sequence end). Indent automatically. + * Handles indefinite length encoding by decoding the constructed values + * (this is a recursive definition) until finding a 0x0000 tag/length. + * It then rewinds *back*, and the length is then calculated using ftell() + * + */ +NSInteger dump(NSData *d, NSInteger pos, NSInteger checkpt, ASN1Node *parent, enum Display display) +{ + Tag tag; + enum Display subdisplay; + int c; + long len; + + for (;;) { + NSInteger startpos = pos; + if (pos != 0 && pos == checkpt) { // 0 is the special starting case + return pos; // Reached a sequence end + } + + pos = readT(d, pos, &tag); + +/* + * Get length, which is either indefinite (so we decode the sub-structs, + * and then seek back); or long (a number of octets, preceded by the count); + * or short (in the single octet) + * + */ + c = [d byteAtOffset:pos++]; + +/* + * If we are have a 0x00 0x00 then we are at the end of an indefinite + * constructed type, and we should return now. + * + */ + if (tag.t_class == 0 && + tag.t_encode == 0 && + tag.t_tagnum == 0 && + c == 0) { + return pos; + } +/* + * We now have something worth printing + * + */ + if (c == 0x80) { + NSInteger newpos = dump(d, pos, 0, parent, none); // Dummy checkpoint value + len = newpos - pos; + } else if (c & 0x80) { + long nlen; + len = 0; + nlen = c & 0x7f; + for (c = 0; c < nlen; c++) { + len = (len << 8) | ([d byteAtOffset:pos++] & 0xff); + // Potential overflow... + } + } else { + len = c & 0x7f; + } +/* + * Got tag and length + * Display if required + * First see if we are going to want to fold together a constructed type + * We need to know this now, so we can change the printTL() behaviour. + * + */ + subdisplay = display; + if (tag.t_encode == 1 && tag.t_class == 0 && + fold == 1 && display != none) + switch (tag.t_tagnum) { + case ASN1_BIT_STRING: + subdisplay = foldbit; + break; + case ASN1_OCTET_STRING: + subdisplay = foldoctet; + break; + case ASN1_ObjectDescriptor: + case ASN1_NumericString: + case ASN1_PrintableString: + case ASN1_TeletexString: + case ASN1_VideotexString: + case ASN1_IA5String: + case ASN1_UTCTime: + case ASN1_GeneralizedTime: + case ASN1_GraphicString: + case ASN1_VisibleString: + case ASN1_GeneralString: + subdisplay = foldtext; + break; + } + + ASN1Node *cons = parent; + if (display == standard) { + cons = printTL(&tag, startpos, len, subdisplay); + [parent addChild: cons]; + } + + if (tag.t_encode == 1) { // We have TL and no value + dump(d, pos, pos + len, cons, subdisplay); + pos += len; + if (display != none && subdisplay == standard) { + [parent addChild:[ASN1Node nodeWithTag:@"}"]]; + } + } else { // We have TLV, so skip value + NSInteger decapsulatePos; + long decapsulateLen; + switch (display) { + case none: + pos += len; + break; + case standard: + [cons setValue:printV(d, pos, &tag, len, &decapsulatePos, &decapsulateLen)]; + if (decapsulatePos != -1) { + dump(d, decapsulatePos, decapsulatePos + decapsulateLen, cons, subdisplay); + [parent addChild:[ASN1Node nodeWithTag:@"}"]]; + } + pos += len; + break; + case foldtext: + [cons setValue:printText(d, pos, len)]; + pos += len; + break; + case foldoctet: + [cons setValue:textoctets ? printText(d, pos, len) : printOctet(d, pos, len)]; + pos += len; + break; + case foldbit: + [cons setValue:printBit(d, pos, len)]; + pos += len; + break; + } + } + + } +} + +/* End of berd.m */ diff --git a/main.m b/main.m new file mode 100644 index 0000000..7c5e10e --- /dev/null +++ b/main.m @@ -0,0 +1,14 @@ +// +// main.m +// ASN.1 Dump +// +// Created by Chris on 03/08/2008. +// Copyright 2008-2012 Chris Ridd. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **) argv); +}