Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial import

The PEM reading code probably doesn't work.
  • Loading branch information...
commit eda1c58cf38a662f1e73147e77bf8c89adf2502b 1 parent 84162b4
@chrisridd authored
View
1  .gitignore
@@ -13,3 +13,4 @@ build/*
xcuserdata
profile
*.moved-aside
+.DS_Store
View
BIN  ASN.1 Dump.xcodeproj/TemplateIcon.icns
Binary file not shown
View
351 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 = "<group>"; };
+ 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+ 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MyDocument.xib; sourceTree = "<group>"; };
+ 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MyDocument.m; sourceTree = "<group>"; };
+ 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = "<group>"; };
+ 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+ 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
+ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32DBCF750370BD2300C91783 /* ASN.1 Dump_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASN.1 Dump_Prefix.pch"; sourceTree = "<group>"; };
+ 67743C7F15AA190E00AFD9A3 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = "<group>"; };
+ 67826B0B0E4D8000009312C6 /* HexNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexNumberFormatter.h; sourceTree = "<group>"; };
+ 67826B0C0E4D8000009312C6 /* HexNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HexNumberFormatter.m; sourceTree = "<group>"; };
+ 67C9B85F0E46027C004DB4E9 /* ASN1Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASN1Node.h; sourceTree = "<group>"; };
+ 67C9B8600E46027C004DB4E9 /* ASN1Node.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASN1Node.m; sourceTree = "<group>"; };
+ 67C9B8950E4607FD004DB4E9 /* berd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = berd.m; sourceTree = "<group>"; };
+ 67C9B89B0E460999004DB4E9 /* NSData+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Utils.h"; sourceTree = "<group>"; };
+ 67C9B89C0E460999004DB4E9 /* NSData+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Utils.m"; sourceTree = "<group>"; };
+ 67C9B8C80E4611AC004DB4E9 /* berd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = berd.h; sourceTree = "<group>"; };
+ 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 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 = "<group>";
+ };
+ 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */,
+ 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */,
+ 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FB0FE9D524F11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D15AC370486D014006FF6A4 /* ASN.1 Dump.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 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 = "<group>";
+ };
+ 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 = "<group>";
+ };
+ 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32DBCF750370BD2300C91783 /* ASN.1 Dump_Prefix.pch */,
+ 2A37F4B0FDCFA73011CA2CEA /* main.m */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 2A37F4B8FDCFA73011CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */,
+ 8D15AC360486D014006FF6A4 /* Info.plist */,
+ 089C165FFE840EACC02AAC07 /* InfoPlist.strings */,
+ 1DDD58280DA1D0D100B32029 /* MyDocument.xib */,
+ 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */,
+ 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 67743C8115AA192A00AFD9A3 /* Documentation */ = {
+ isa = PBXGroup;
+ children = (
+ 67743C7F15AA190E00AFD9A3 /* README.md */,
+ );
+ name = Documentation;
+ sourceTree = "<group>";
+ };
+/* 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 = "<group>";
+ };
+ 1DDD58280DA1D0D100B32029 /* MyDocument.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1DDD58290DA1D0D100B32029 /* English */,
+ );
+ name = MyDocument.xib;
+ sourceTree = "<group>";
+ };
+ 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 1DDD582B0DA1D0D100B32029 /* English */,
+ );
+ name = MainMenu.xib;
+ sourceTree = "<group>";
+ };
+ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 2A37F4BAFDCFA73011CA2CEA /* English */,
+ );
+ name = Credits.rtf;
+ sourceTree = "<group>";
+ };
+/* 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 */;
+}
View
7 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 <Cocoa/Cocoa.h>
+#endif
View
34 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 <Cocoa/Cocoa.h>
+
+@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
View
110 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
View
29 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\
+}
View
BIN  English.lproj/InfoPlist.strings
Binary file not shown
View
2,995 English.lproj/MainMenu.xib
2,995 additions, 0 deletions not shown
View
507 English.lproj/MyDocument.xib
@@ -0,0 +1,507 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">11E53</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
+ <string key="IBDocument.AppKitVersion">1138.47</string>
+ <string key="IBDocument.HIToolboxVersion">569.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">2182</string>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSView</string>
+ <string>NSOutlineView</string>
+ <string>NSScrollView</string>
+ <string>NSWindowTemplate</string>
+ <string>NSTextFieldCell</string>
+ <string>NSTableHeaderView</string>
+ <string>NSTableColumn</string>
+ <string>NSScroller</string>
+ <string>NSCustomObject</string>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+ <integer value="1" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="580458321">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="512844837">
+ <string key="NSClassName">MyDocument</string>
+ </object>
+ <object class="NSCustomObject" id="613418571">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSWindowTemplate" id="275939982">
+ <int key="NSWindowStyleMask">15</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{133, 277}, {465, 371}}</string>
+ <int key="NSWTFlags">1886912512</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <string key="NSViewClass">View</string>
+ <nil key="NSUserInterfaceItemIdentifier"/>
+ <string key="NSWindowContentMinSize">{94, 86}</string>
+ <object class="NSView" key="NSWindowView" id="568628114">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSScrollView" id="295938316">
+ <reference key="NSNextResponder" ref="568628114"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="27984675">
+ <reference key="NSNextResponder" ref="295938316"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSOutlineView" id="882924216">
+ <reference key="NSNextResponder" ref="27984675"/>
+ <int key="NSvFlags">4352</int>
+ <string key="NSFrameSize">{465, 355}</string>
+ <reference key="NSSuperview" ref="27984675"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTableHeaderView" key="NSHeaderView" id="1043681964">
+ <reference key="NSNextResponder" ref="861097598"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrameSize">{465, 17}</string>
+ <reference key="NSSuperview" ref="861097598"/>
+ <reference key="NSTableView" ref="882924216"/>
+ </object>
+ <object class="_NSCornerView" key="NSCornerView">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{451, 0}, {16, 17}}</string>
+ </object>
+ <object class="NSMutableArray" key="NSTableColumns">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTableColumn" id="656425940">
+ <string key="NSIdentifier">offset</string>
+ <double key="NSWidth">92</double>
+ <double key="NSMinWidth">40</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Offset</string>
+ <object class="NSFont" key="NSSupport" id="26">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">11</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <object class="NSColor" key="NSBackgroundColor" id="864022125">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC4zMzMzMzI5OQA</bytes>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="56605323">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">headerTextColor</string>
+ <object class="NSColor" key="NSColor" id="933498335">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="797795252">
+ <int key="NSCellFlags">67239488</int>
+ <int key="NSCellFlags2">272761856</int>
+ <string key="NSContents">Text</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="882924216"/>
+ <object class="NSColor" key="NSBackgroundColor" id="722869432">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor" id="63499305">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="1066392012">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <reference key="NSColor" ref="933498335"/>
+ </object>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="882924216"/>
+ </object>
+ <object class="NSTableColumn" id="773600022">
+ <string key="NSIdentifier">string</string>
+ <double key="NSWidth">367</double>
+ <double key="NSMinWidth">16</double>
+ <double key="NSMaxWidth">1000</double>
+ <object class="NSTableHeaderCell" key="NSHeaderCell">
+ <int key="NSCellFlags">75628096</int>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">ASN.1</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSBackgroundColor" ref="864022125"/>
+ <reference key="NSTextColor" ref="56605323"/>
+ </object>
+ <object class="NSTextFieldCell" key="NSDataCell" id="708525812">
+ <int key="NSCellFlags">67239488</int>
+ <int key="NSCellFlags2">272761856</int>
+ <string key="NSContents">Text</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="882924216"/>
+ <reference key="NSBackgroundColor" ref="722869432"/>
+ <reference key="NSTextColor" ref="1066392012"/>
+ </object>
+ <int key="NSResizingMask">3</int>
+ <bool key="NSIsResizeable">YES</bool>
+ <reference key="NSTableView" ref="882924216"/>
+ </object>
+ </object>
+ <double key="NSIntercellSpacingWidth">3</double>
+ <double key="NSIntercellSpacingHeight">2</double>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="NSGridColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">gridColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ <double key="NSRowHeight">17</double>
+ <int key="NSTvFlags">-759169024</int>
+ <reference key="NSDelegate"/>
+ <reference key="NSDataSource"/>
+ <int key="NSColumnAutoresizingStyle">4</int>
+ <int key="NSDraggingSourceMaskForLocal">15</int>
+ <int key="NSDraggingSourceMaskForNonLocal">0</int>
+ <bool key="NSAllowsTypeSelect">YES</bool>
+ <int key="NSTableViewDraggingDestinationStyle">0</int>
+ <int key="NSTableViewGroupRowStyle">1</int>
+ <float key="NSOutlineViewIndentationPerLevelKey">11</float>
+ <reference key="NSOutlineViewOutlineTableColumnKey" ref="773600022"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 17}, {465, 355}}</string>
+ <reference key="NSSuperview" ref="295938316"/>
+ <reference key="NSNextKeyView" ref="882924216"/>
+ <reference key="NSDocView" ref="882924216"/>
+ <object class="NSColor" key="NSBGColor" id="475971635">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlBackgroundColor</string>
+ <reference key="NSColor" ref="63499305"/>
+ </object>
+ <int key="NScvFlags">4</int>
+ </object>
+ <object class="NSScroller" id="167209416">
+ <reference key="NSNextResponder" ref="295938316"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{451, 17}, {15, 349}}</string>
+ <reference key="NSSuperview" ref="295938316"/>
+ <reference key="NSTarget" ref="295938316"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">37</double>
+ <double key="NSPercent">0.13909779999999999</double>
+ </object>
+ <object class="NSScroller" id="279451952">
+ <reference key="NSNextResponder" ref="295938316"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{1, 357}, {459, 15}}</string>
+ <reference key="NSSuperview" ref="295938316"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="295938316"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">0.99778270000000002</double>
+ </object>
+ <object class="NSClipView" id="861097598">
+ <reference key="NSNextResponder" ref="295938316"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1043681964"/>
+ </object>
+ <string key="NSFrame">{{1, 0}, {465, 17}}</string>
+ <reference key="NSSuperview" ref="295938316"/>
+ <reference key="NSNextKeyView" ref="1043681964"/>
+ <reference key="NSDocView" ref="1043681964"/>
+ <reference key="NSBGColor" ref="475971635"/>
+ <int key="NScvFlags">4</int>
+ </object>
+ </object>
+ <string key="NSFrame">{{-1, -1}, {467, 373}}</string>
+ <reference key="NSSuperview" ref="568628114"/>
+ <reference key="NSNextKeyView" ref="27984675"/>
+ <int key="NSsFlags">133170</int>
+ <reference key="NSVScroller" ref="167209416"/>
+ <reference key="NSHScroller" ref="279451952"/>
+ <reference key="NSContentView" ref="27984675"/>
+ <reference key="NSHeaderClipView" ref="861097598"/>
+ <bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
+ </object>
+ </object>
+ <string key="NSFrameSize">{465, 371}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
+ <string key="NSMinSize">{94, 108}</string>
+ <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
+ <bool key="NSWindowIsRestorable">YES</bool>
+ </object>
+ <object class="NSCustomObject" id="796877042">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="275939982"/>
+ </object>
+ <int key="connectionID">18</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">outline</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="882924216"/>
+ </object>
+ <int key="connectionID">100030</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="275939982"/>
+ <reference key="destination" ref="512844837"/>
+ </object>
+ <int key="connectionID">17</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">dataSource</string>
+ <reference key="source" ref="882924216"/>
+ <reference key="destination" ref="512844837"/>
+ </object>
+ <int key="connectionID">100031</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="580458321"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="512844837"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="613418571"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="275939982"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="568628114"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Window</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="568628114"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="295938316"/>
+ </object>
+ <reference key="parent" ref="275939982"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="796877042"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100021</int>
+ <reference key="object" ref="295938316"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="167209416"/>
+ <reference ref="279451952"/>
+ <reference ref="882924216"/>
+ <reference ref="1043681964"/>
+ </object>
+ <reference key="parent" ref="568628114"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100022</int>
+ <reference key="object" ref="167209416"/>
+ <reference key="parent" ref="295938316"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100023</int>
+ <reference key="object" ref="279451952"/>
+ <reference key="parent" ref="295938316"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100024</int>
+ <reference key="object" ref="882924216"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="773600022"/>
+ <reference ref="656425940"/>
+ </object>
+ <reference key="parent" ref="295938316"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100025</int>
+ <reference key="object" ref="1043681964"/>
+ <reference key="parent" ref="295938316"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100026</int>
+ <reference key="object" ref="773600022"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="708525812"/>
+ </object>
+ <reference key="parent" ref="882924216"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100027</int>
+ <reference key="object" ref="656425940"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="797795252"/>
+ </object>
+ <reference key="parent" ref="882924216"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100032</int>
+ <reference key="object" ref="797795252"/>
+ <reference key="parent" ref="656425940"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">100033</int>
+ <reference key="object" ref="708525812"/>
+ <reference key="parent" ref="773600022"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>100021.IBPluginDependency</string>
+ <string>100022.IBPluginDependency</string>
+ <string>100023.IBPluginDependency</string>
+ <string>100024.IBPluginDependency</string>
+ <string>100025.IBPluginDependency</string>
+ <string>100026.IBPluginDependency</string>
+ <string>100027.IBPluginDependency</string>
+ <string>100032.IBPluginDependency</string>
+ <string>100033.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>5.IBWindowTemplateEditedContentRect</string>
+ <string>6.IBPluginDependency</string>
+ </object>
+ <object class="NSArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{89, 280}, {465, 371}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">100033</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">MyDocument</string>
+ <string key="superclassName">NSDocument</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">outline</string>
+ <string key="NS.object.0">NSOutlineView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">outline</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">outline</string>
+ <string key="candidateClassName">NSOutlineView</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/MyDocument.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1050" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
View
15 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 <Cocoa/Cocoa.h>
+
+@interface HexNumberFormatter : NSFormatter {
+
+}
+
+@end
View
21 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
View
55 Info.plist
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>cer</string>
+ <string>ber</string>
+ <string>der</string>
+ <string>bin</string>
+ <string>p7b</string>
+ <string>p12</string>
+ <string>pfx</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string></string>
+ <key>CFBundleTypeName</key>
+ <string>DocumentType</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>????</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ <key>NSDocumentClass</key>
+ <string>MyDocument</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
View
18 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 <Cocoa/Cocoa.h>
+
+@class ASN1Node;
+@interface MyDocument : NSDocument
+{
+ IBOutlet NSOutlineView *outline;
+ ASN1Node *doc;
+}
+@end
View
116 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
View
21 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 <Cocoa/Cocoa.h>
+
+
+@interface NSData (Utils)
+
+- (NSInteger)byteAtOffset:(NSInteger)p;
+
+- (NSData *)dataFromPEMData;
+
+- (id)initWithBase64Bytes:(const char *)base64Bytes
+ length:(unsigned long)lentext;
+
+@end
View
113 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
View
2  README.md
@@ -1,4 +1,4 @@
asn1-dump
=========
-Display the structured content of ASN.1 encoded files
View
7 berd.h
@@ -0,0 +1,7 @@
+#import <Foundation/Foundation.h>
+
+enum Display {none = 0, standard, foldtext, foldoctet, foldbit};
+
+@class ASN1Node;
+
+extern NSInteger dump(NSData *, NSInteger, NSInteger, ASN1Node *, enum Display);
View
1,967 berd.m
1,967 additions, 0 deletions not shown
View
14 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 <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **) argv);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.