[squeak-dev] The Inbox: CryptoCertsTests-rww.1.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Aug 28 10:56:36 UTC 2010


A new version of CryptoCertsTests was added to project The Inbox:
http://source.squeak.org/inbox/CryptoCertsTests-rww.1.mcz

==================== Summary ====================

Name: CryptoCertsTests-rww.1
Author: rww
Time: 28 August 2010, 6:55:56.552 am
UUID: bae0f39d-a2ac-3e49-b065-225ea6d92184
Ancestors: 

initial submission

==================== Snapshot ====================

SystemOrganization addCategory: #CryptoCertsTests!

TestCase subclass: #CryptoASN1Test
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'CryptoCertsTests'!

----- Method: CryptoASN1Test>>testBMPString (in category 'tests - base') -----
testBMPString

	| bytes obj newBytes testObj |
	bytes := #(30 11 104 101 108 108 111 32 119 111 114 108 100).
	testObj := 'hello world'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testBaseExplicitType (in category 'tests - defined types') -----
testBaseExplicitType

	| bytes obj newBytes type |
	(ASN1Module name: #test) explicit: #TestExplicit type: #ASN1IntegerType tag: 0.

	type := (ASN1Module name: #test) find: #TestExplicit.
	bytes := #(160 4 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testBaseImplicitConstructedType (in category 'tests - defined types') -----
testBaseImplicitConstructedType

	| bytes obj newBytes type |
	(ASN1Module name: #test) implicit: #TestImplicit type: #ASN1SequenceType tag: 0.

	type := (ASN1Module name: #test) find: #TestImplicit.
	bytes := #(160 4 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj = (OrderedCollection with: 789)).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testBaseImplicitPrimitiveType (in category 'tests - defined types') -----
testBaseImplicitPrimitiveType

	| bytes obj newBytes type |
	(ASN1Module name: #test) implicit: #TestImplicit type: #ASN1IntegerType tag: 0.

	type := (ASN1Module name: #test) find: #TestImplicit.
	bytes := #(128 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testBitString (in category 'tests - base') -----
testBitString

	| bytes obj newBytes testObj |
	bytes := #(3 3 3 168 121).
	testObj := ASN1BitString new 
		bytes: #(168 121); 
		bitsPadding: 3; 
		yourself.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testBoolean (in category 'tests - base') -----
testBoolean

	| bytes obj newBytes testObj |
	bytes := #(1 1 255).
	testObj := true.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testByteArray (in category 'tests - base') -----
testByteArray

	| bytes obj newBytes testObj |
	bytes := #(4 5 3 21 55 43 76).
	testObj := #(3 21 55 43 76) asByteArray.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testConstructedBMPString (in category 'tests - BER') -----
testConstructedBMPString

	| bytes obj testObj |
	bytes := #(62 15 30 5 84 101 115 116 32 30 6 85 115 101 114 32 49).
	testObj := 'Test User 1'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedBitString (in category 'tests - BER') -----
testConstructedBitString

	| bytes obj testObj |
	bytes := #(35 9 3 3 0 110 93 3 2 6 192).
	testObj := ASN1BitString new
		bytes: #(110 93 192) asByteArray;
		bitsPadding: 6;
		yourself.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedByteArray (in category 'tests - BER') -----
testConstructedByteArray

	| bytes obj testObj |
	bytes := #(36 12 4 4 1 35 69 103 4 4 137 171 205 239).
	testObj :=#(1 35 69 103 137 171 205 239) asByteArray.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedIA5String (in category 'tests - BER') -----
testConstructedIA5String

	| bytes obj testObj |
	bytes := #(54 15 22 5 84 101 115 116 32 22 6 85 115 101 114 32 49).
	testObj := 'Test User 1'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedPrintableString (in category 'tests - BER') -----
testConstructedPrintableString

	| bytes obj testObj |
	bytes := #(51 15 19 5 84 101 115 116 32 19 6 85 115 101 114 32 49).
	testObj := 'Test User 1'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedTeletexString (in category 'tests - BER') -----
testConstructedTeletexString

	| bytes obj testObj |
	bytes := #(52 15 20 5 84 101 115 116 32 20 6 85 115 101 114 32 49).
	testObj := 'Test User 1'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedUTF8String (in category 'tests - BER') -----
testConstructedUTF8String

	| bytes obj testObj |
	bytes := #(44 15 12 5 84 101 115 116 32 12 6 85 115 101 114 32 49).
	testObj := 'Test User 1'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testConstructedUniversalString (in category 'tests - BER') -----
testConstructedUniversalString

	| bytes obj testObj |
	bytes := #(60 15 28 5 84 101 115 116 32 28 6 85 115 101 114 32 49).
	testObj := 'Test User 1'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testDefinedAnyDefinedByType (in category 'tests - defined types') -----
testDefinedAnyDefinedByType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1ObjectIdentifierType;
		add: #testSlot2 type: #TestAnyDefinedBy;
		yourself.
	((ASN1Module name: #test) any: #TestAnyDefinedBy definedBy: #testSlot1)
		at: (ASN1ObjectId fromString: '1.1') put: #ASN1BooleanType;
		at: (ASN1ObjectId fromString: '1.2') put: #ASN1IntegerType;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.

	bytes := #(48 6 6 1 41 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = (ASN1ObjectId fromString: '1.1')).
	self assert: (obj testSlot2 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).

	bytes := #(48 7 6 1 42 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = (ASN1ObjectId fromString: '1.2')).
	self assert: (obj testSlot2 = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedAnyType (in category 'tests - defined types') -----
testDefinedAnyType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1AnyType;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.

	bytes := #(48 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).

	bytes := #(48 4 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedChoiceType (in category 'tests - defined types') -----
testDefinedChoiceType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #TestChoice;
		yourself.
	((ASN1Module name: #test) choice: #TestChoice)
		add: #boolean type: #ASN1BooleanType;
		add: #integer type: #ASN1IntegerType;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.

	bytes := #(48 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).

	bytes := #(48 4 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedExplicitType (in category 'tests - defined types') -----
testDefinedExplicitType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1IntegerType explicitTag: 0;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 6 160 4 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedImplicitConstructedType (in category 'tests - defined types') -----
testDefinedImplicitConstructedType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1SequenceType implicitTag: 0;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 6 160 4 2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = (OrderedCollection with: 789)).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedImplicitPrimitiveType (in category 'tests - defined types') -----
testDefinedImplicitPrimitiveType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1IntegerType implicitTag: 0;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 4 128 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedMappedBMPStringType (in category 'tests - mapped') -----
testDefinedMappedBMPStringType

	| bytes obj newBytes type |
	((ASN1Module name: #test) mapped: #TestMapped)
		mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1BMPStringType.
	type := (ASN1Module name: #test) find: #TestMapped.

	bytes := #(30 11 104 101 108 108 111 32 119 111 114 108 100).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 'hello world').
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedMappedBooleanType (in category 'tests - mapped') -----
testDefinedMappedBooleanType

	| bytes obj newBytes type |
	((ASN1Module name: #test) mapped: #TestMapped)
		mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1BooleanType.
	type := (ASN1Module name: #test) find: #TestMapped.

	bytes := #(1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedMappedIntegerType (in category 'tests - mapped') -----
testDefinedMappedIntegerType

	| bytes obj newBytes type |
	((ASN1Module name: #test) mapped: #TestMapped)
		mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1IntegerType.
	type := (ASN1Module name: #test) find: #TestMapped.

	bytes := #(2 2 3 21).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 789).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedMappedSequenceType (in category 'tests - mapped') -----
testDefinedMappedSequenceType

	| bytes obj newBytes type |
	((ASN1Module name: #test) mapped: #TestMapped)
		mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #TestSequence.
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1BooleanType.
	type := (ASN1Module name: #test) find: #TestMapped.

	bytes := #(48 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 testSlot1 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedMappedUTF8StringType (in category 'tests - mapped') -----
testDefinedMappedUTF8StringType

	| bytes obj newBytes type |
	((ASN1Module name: #test) mapped: #TestMapped)
		mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1StringType.
	type := (ASN1Module name: #test) find: #TestMapped.

	bytes := #(12 11 104 101 108 108 111 32 119 111 114 108 100).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = 'hello world').
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedSequenceOfType (in category 'tests - defined types') -----
testDefinedSequenceOfType

	| bytes obj newBytes type |
	(ASN1Module name: #test) sequence: #TestSequence of: #ASN1BooleanType.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: OrderedCollection).
	self assert: (obj first = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedSequenceType (in category 'tests - defined types') -----
testDefinedSequenceType

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1BooleanType;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedSequenceTypeDefault (in category 'tests - defined types') -----
testDefinedSequenceTypeDefault

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1BooleanType default: false;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 0).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = false).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedSequenceTypeOptional (in category 'tests - defined types') -----
testDefinedSequenceTypeOptional

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		addOptional: #testSlot1 type: #ASN1BooleanType;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 0).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedSequenceTypeOptionalDefault (in category 'tests - defined types') -----
testDefinedSequenceTypeOptionalDefault

	| bytes obj newBytes type |
	((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel)
		addOptional: #testSlot1 type: #ASN1BooleanType default: false;
		yourself.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 0).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = false).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedSetType (in category 'tests - defined types') -----
testDefinedSetType

	| bytes obj newBytes type |
	((ASN1Module name: #test) set: #TestSet mapping: ASN1TestModel)
		add: #testSlot1 type: #ASN1BooleanType;
		yourself.

	type := (ASN1Module name: #test) find: #TestSet.
	bytes := #(49 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: ASN1TestModel).
	self assert: (obj testSlot1 = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedUnmappedSequenceType (in category 'tests - defined types') -----
testDefinedUnmappedSequenceType

	| bytes obj newBytes type |
	(ASN1Module name: #test) sequence: #TestSequence.

	type := (ASN1Module name: #test) find: #TestSequence.
	bytes := #(48 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: OrderedCollection).
	self assert: (obj first = true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testDefinedUnmappedSetType (in category 'tests - defined types') -----
testDefinedUnmappedSetType

	| bytes obj newBytes type |
	(ASN1Module name: #test) set: #TestSet.

	type := (ASN1Module name: #test) find: #TestSet.
	bytes := #(49 3 1 1 255).
	obj := ASN1Stream decodeBytes: bytes withType: type.
	self assert: (obj isKindOf: OrderedSet).
	self assert: (obj includes: true).
	newBytes := ASN1Stream encode: obj withType: type.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testEqualsChecksType (in category 'tests - base') -----
testEqualsChecksType

	self deny: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.8.5') = Object new
!

----- Method: CryptoASN1Test>>testIA5String (in category 'tests - base') -----
testIA5String

	| bytes obj newBytes testObj |
	bytes := #(22 11 104 101 108 108 111 32 119 111 114 108 100).
	testObj := 'hello world'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testIndefiniteLengthSequence (in category 'tests - BER') -----
testIndefiniteLengthSequence

	| bytes obj testObj |
	bytes := #(48 128 1 1 255 2 2 3 21 4 2 108 100 0 0).
	testObj := OrderedCollection new
		add: true;
		add: 789;
		add: #(108 100) asByteArray;
		yourself.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
!

----- Method: CryptoASN1Test>>testInteger (in category 'tests - base') -----
testInteger

	| bytes obj newBytes testObj |
	bytes := #(2 2 3 21).
	testObj := 789.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testNull (in category 'tests - base') -----
testNull

	| bytes obj newBytes |
	bytes := #(5 0).
	obj := ASN1Stream decodeBytes: bytes.
	self assert: obj isNil.
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testObjectIdentifier (in category 'tests - base') -----
testObjectIdentifier

	| bytes obj newBytes testObj |
	bytes := #(6 8 43 6 1 5 5 7 8 5).
	testObj := ASN1ObjectId new
		oid: '1.3.6.1.5.5.7.8.5';
		yourself.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testPrintableString (in category 'tests - base') -----
testPrintableString

	| bytes obj newBytes testObj |
	bytes := #(19 11 104 101 108 108 111 32 119 111 114 108 100).
	testObj := 'hello world'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testSequence (in category 'tests - base') -----
testSequence

	| bytes obj newBytes testObj |
	bytes := #(48 11 1 1 255 2 2 3 21 4 2 108 100).
	testObj := OrderedCollection new
		add: true;
		add: 789;
		add: #(108 100) asByteArray;
		yourself.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testSet (in category 'tests - base') -----
testSet

	| bytes obj newBytes testObj |
	bytes := #(49 11 1 1 255 4 2 108 100 2 2 3 21 ).
	testObj := OrderedSet new
		add: true;
		add: #(108 100) asByteArray;
		add: 789;
		yourself.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testString (in category 'tests - base') -----
testString

	| bytes obj newBytes testObj |
	bytes := #(12 11 104 101 108 108 111 32 119 111 114 108 100).
	testObj := 'hello world'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testTeletexString (in category 'tests - base') -----
testTeletexString

	| bytes obj newBytes testObj |
	bytes := #(20 11 104 101 108 108 111 32 119 111 114 108 100).
	testObj := 'hello world'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testUTCTime (in category 'tests - base') -----
testUTCTime

	| bytes obj newBytes testObj |
	bytes := #(23 13 48 55 48 51 50 50 49 53 53 56 49 55 90).
	testObj := DateAndTime fromString: '2007-03-22T15:58:17+00:00'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

----- Method: CryptoASN1Test>>testUniversalString (in category 'tests - base') -----
testUniversalString

	| bytes obj newBytes testObj |
	bytes := #(28 11 104 101 108 108 111 32 119 111 114 108 100).
	testObj := 'hello world'.
	obj := ASN1Stream decodeBytes: bytes.
	self assert: (obj = testObj).
	newBytes := ASN1Stream encode: obj.
	self assert: (bytes asByteArray = newBytes).
!

TestCase subclass: #CryptoPKCS12Test
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'CryptoCertsTests'!

----- Method: CryptoPKCS12Test>>test1 (in category 'testing') -----
test1

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 2 
		fromPassword: 'smeg' 
		salt: #(10 88 207 100 83 13 130 63)
		iterations: 1
		size: 8) hex.
	self assert: key = '79993DFE048D3B76'
!

----- Method: CryptoPKCS12Test>>test10 (in category 'testing') -----
test10

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 1
		fromPassword: 'queeg' 
		salt: #(22 130 192 252 91 63 126 197)
		iterations: 1000
		size: 24) hex.
	self assert: key = '483DD6E919D7DE2E8E648BA8F862F3FBFBDC2BCB2C02957F'
!

----- Method: CryptoPKCS12Test>>test2 (in category 'testing') -----
test2

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 2 
		fromPassword: 'smeg' 
		salt: #(100 43 153 171 68 251 75 31)
		iterations: 1
		size: 8) hex.
	self assert: key = 'C0A38D64A79BEA1D'
!

----- Method: CryptoPKCS12Test>>test3 (in category 'testing') -----
test3

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 2 
		fromPassword: 'queeg' 
		salt: #(5 222 201 89 172 255 114 247)
		iterations: 1000
		size: 8) hex.
	self assert: key = '11DEDAD7758D4860'
!

----- Method: CryptoPKCS12Test>>test4 (in category 'testing') -----
test4

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 2 
		fromPassword: 'queeg' 
		salt: #(22 130 192 252 91 63 126 197)
		iterations: 1000
		size: 8) hex.
	self assert: key = '9D461D1B00355C50'
!

----- Method: CryptoPKCS12Test>>test5 (in category 'testing') -----
test5

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 3 
		fromPassword: 'smeg' 
		salt: #(61 131 192 228 84 106 193 64)
		iterations: 1
		size: 20) hex.
	self assert: key = '8D967D88F6CAA9D714800AB3D48051D63F73A312'
!

----- Method: CryptoPKCS12Test>>test6 (in category 'testing') -----
test6

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 3 
		fromPassword: 'queeg' 
		salt: #(38 50 22 252 194 250 179 28)
		iterations: 1000
		size: 20) hex.
	self assert: key = '5EC4C7A80DF652294C3925B6489A7AB857C83476'
!

----- Method: CryptoPKCS12Test>>test7 (in category 'testing') -----
test7

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 1
		fromPassword: 'smeg' 
		salt: #(10 88 207 100 83 13 130 63)
		iterations: 1
		size: 24) hex.
	self assert: key = '8AAAE6297B6CB04642AB5B077851284EB7128F1A2A7FBCA3'
!

----- Method: CryptoPKCS12Test>>test8 (in category 'testing') -----
test8

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 1
		fromPassword: 'smeg' 
		salt: #(100 43 153 171 68 251 75 31)
		iterations: 1
		size: 24) hex.
	self assert: key = 'F3A95FEC48D7711E985CFE67908C5AB79FA3D7C5CAA5D966'
!

----- Method: CryptoPKCS12Test>>test9 (in category 'testing') -----
test9

	| key |
	key := (Pkcs12KeyDerivationFunction new
		derivedKeyWithId: 1
		fromPassword: 'queeg' 
		salt: #(5 222 201 89 172 255 114 247)
		iterations: 1000
		size: 24) hex.
	self assert: key = 'ED2034E36328830FF09DF1E1A07DD357185DAC0D4F9EB3D4'
!

TestCase subclass: #CryptoX509Test
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'CryptoCertsTests'!

----- Method: CryptoX509Test>>certificate1 (in category 'as yet unclassified') -----
certificate1

	^ X509Certificate fromBytes: self certificate1DerBytes.
!

----- Method: CryptoX509Test>>certificate1DerBytes (in category 'as yet unclassified') -----
certificate1DerBytes

	^ #(48 130 7 61 48 130 5 37 160 3 2 1 2 2 1 0 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 30 23 13 48 51 48 51 51 48 49 50 50 57 52 57 90 23 13 51 51 48 51 50 57 49 50 50 57 52 57 90 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 130 2 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 2 15 0 48 130 2 10 2 130 2 1 0 206 34 192 226 70 125 236 54 40 7 80 150 242 160 51 64 140 75 241 59 102 63 49 229 107 2 54 219 214 124 246 241 136 143 78 119 54 5 65 149 249 9 240 18 207 70 134 115 96 183 110 126 232 192 88 100 174 205 176 173 69 23 12 99 250 103 10 232 214 210 191 62 231 152 196 240 76 250 224 3 187 53 93 108 33 222 158 32 217 186 205 102 50 55 114 250 247 8 245 199 205 88 201 142 231 14 94 234 62 254 28 161 20 10 21 108 134 132 91 100 102 42 122 169 75 83 121 245 136 162 123 238 47 10 97 43 141 178 126 77 86 165 19 236 234 218 146 158 172 68 65 30 88 96 101 5 102 248 192 68 189 203 148 247 66 126 11 247 101 104 152 81 5 240 243 5 145 4 29 27 23 130 236 200 87 187 195 107 122 136 241 176 114 204 37 91 32 145 236 22 2 18 143 50 233 23 24 72 208 199 5 46 2 48 66 184 37 156 5 107 63 170 58 167 235 83 72 247 232 210 182 7 152 220 27 198 52 127 127 201 28 130 122 5 88 43 8 91 243 56 162 171 23 93 102 201 152 215 158 16 139 162 210 221 116 154 247 113 12 114 96 223 205 111 152 51 157 150 52 118 62 36 122 146 176 14 149 30 111 230 160 69 56 71 170 215 65 237 74 183 18 246 215 27 131 138 15 46 216 9 182 89 215 170 4 255 210 147 125 104 46 221 139 75 171 88 186 47 141 234 149 167 160 195 84 137 165 251 219 139 81 34 157 178 195 190 17 190 44 145 134 139 150 120 173 32 211 138 47 26 63 198 208 81 101 135 33 177 25 1 101 127 69 28 135 245 124 208 65 76 79 41 152 33 253 51 31 117 12 4 81 250 25 119 219 212 20 28 238 129 195 29 245 152 183 105 6 145 34 221 0 80 204 129 49 172 18 7 123 56 218 104 91 230 43 212 126 201 95 173 232 235 114 76 243 1 229 75 32 191 154 166 87 202 145 0 1 139 161 117 33 55 181 99 13 103 62 70 79 112 32 103 206 197 214 89 219 2 224 240 210 203 205 186 98 183 144 65 232 221 32 228 41 188 100 41 66 200 34 220 120 154 255 67 236 152 27 9 81 75 90 90 194 113 241 196 203 115 169 229 161 11 2 3 1 0 1 163 130 1 206 48 130 1 202 48 29 6 3 85 29 14 4 22 4 20 22 181 50 27 212 199 243 224 230 142 243 189 210 176 58 238 178 57 24 209 48 129 163 6 3 85 29 35 4 129 155 48 129 152 128 20 22 181 50 27 212 199 243 224 230 142 243 189 210 176 58 238 178 57 24 209 161 125 164 123 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 130 1 0 48 15 6 3 85 29 19 1 1 255 4 5 48 3 1 1 255 48 50 6 3 85 29 31 4 43 48 41 48 39 160 37 160 35 134 33 104 116 116 112 115 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 114 101 118 111 107 101 46 99 114 108 48 48 6 9 96 134 72 1 134 248 66 1 4 4 35 22 33 104 116 116 112 115 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 114 101 118 111 107 101 46 99 114 108 48 52 6 9 96 134 72 1 134 248 66 1 8 4 39 22 37 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 105 110 100 101 120 46 112 104 112 63 105 100 61 49 48 48 86 6 9 96 134 72 1 134 248 66 1 13 4 73 22 71 84 111 32 103 101 116 32 121 111 117 114 32 111 119 110 32 99 101 114 116 105 102 105 99 97 116 101 32 102 111 114 32 70 82 69 69 32 104 101 97 100 32 111 118 101 114 32 116 111 32 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 3 130 2 1 0 40 199 238 156 130 2 186 92 128 18 202 53 10 29 129 111 137 106 153 204 242 104 15 127 167 225 141 88 149 62 189 242 6 195 144 90 172 181 96 246 153 67 1 163 136 112 156 157 98 157 164 135 175 103 88 13 48 54 59 230 173 72 211 203 116 2 134 113 62 226 43 3 104 241 52 98 64 70 59 83 234 40 244 172 251 102 149 83 138 77 93 253 59 217 96 215 202 121 105 59 177 101 146 166 198 129 130 92 156 205 235 77 1 138 165 223 17 85 170 21 202 31 55 192 130 152 112 97 219 106 124 150 163 142 46 84 62 79 33 169 144 239 220 130 191 220 232 69 173 77 144 115 8 60 148 101 176 4 153 118 127 226 188 194 106 21 170 151 4 55 36 216 30 148 78 109 14 81 190 214 196 143 202 150 109 247 67 223 232 48 101 39 59 123 187 67 67 99 196 67 247 178 236 104 204 225 25 142 34 251 152 225 123 90 62 1 55 59 139 8 176 162 243 149 78 26 203 155 205 154 177 219 178 112 240 45 74 219 216 176 227 111 69 72 51 18 255 254 60 50 42 84 247 196 247 138 240 136 35 194 71 254 100 122 113 192 209 30 166 99 176 7 126 164 47 211 1 143 220 159 43 182 198 8 169 15 147 72 37 252 18 253 159 66 220 243 196 62 246 87 176 215 221 105 209 6 119 52 10 75 210 202 160 255 28 198 140 201 22 190 196 204 50 55 104 115 95 8 251 81 247 73 83 54 5 10 149 2 76 242 121 26 16 246 216 58 117 156 243 29 241 162 13 112 103 134 27 179 22 245 47 229 164 235 121 134 249 61 11 194 115 11 165 153 172 111 252 103 184 229 47 11 166 24 36 141 123 209 72 53 41 24 64 172 147 96 225 150 134 80 180 122 89 216 143 33 11 159 207 130 145 198 59 191 107 220 7 145 185 151 86 35 170 182 108 148 198 72 6 60 228 206 78 170 228 246 47 9 220 83 111 46 252 116 235 58 99 153 194 166 172 137 188 167 178 68 160 13 138 16 227 108 242 36 203 250 155 159 112 71 46 222 20 139 212 178 32 9 150 162 100 241 36 28 220 161 53 156 21 178 212 188 85 46 125 6 245 156 14 85 244 90 214 147 218 118 173 37 115 76 197 67) asByteArray.
!

----- Method: CryptoX509Test>>certificate2 (in category 'as yet unclassified') -----
certificate2

	^ X509Certificate fromBytes: self certificate2DerBytes.
!

----- Method: CryptoX509Test>>certificate2DerBytes (in category 'as yet unclassified') -----
certificate2DerBytes

	^ #(48 130 6 8 48 130 3 240 160 3 2 1 2 2 1 1 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 30 23 13 48 53 49 48 49 52 48 55 51 54 53 53 90 23 13 51 51 48 51 50 56 48 55 51 54 53 53 90 48 84 49 20 48 18 6 3 85 4 10 19 11 67 65 99 101 114 116 32 73 110 99 46 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 49 28 48 26 6 3 85 4 3 19 19 67 65 99 101 114 116 32 67 108 97 115 115 32 51 32 82 111 111 116 48 130 2 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 2 15 0 48 130 2 10 2 130 2 1 0 171 73 53 17 72 124 210 38 126 83 148 207 67 169 221 40 215 66 42 139 243 135 120 25 88 124 15 158 218 137 125 225 251 235 114 144 13 116 161 150 100 171 159 160 36 153 115 218 226 85 118 199 23 123 245 4 172 70 184 195 190 127 100 141 16 108 36 243 97 156 192 242 144 250 81 230 245 105 1 99 195 15 86 226 74 66 207 226 68 140 37 40 168 197 121 9 125 70 185 138 243 233 243 52 41 8 69 228 28 159 203 148 4 28 129 168 20 179 152 101 196 67 236 78 130 141 9 209 189 170 91 141 146 208 236 222 144 197 127 10 194 227 235 230 49 90 94 116 62 151 51 89 232 195 3 61 96 51 191 247 209 111 71 196 205 238 98 131 82 110 46 8 154 164 217 21 24 145 166 133 146 71 176 174 72 235 109 183 33 236 133 26 104 114 53 171 255 240 16 93 192 244 148 167 106 213 59 146 126 76 144 5 126 147 193 44 139 164 142 98 116 21 113 110 11 113 3 234 175 21 56 154 212 210 5 114 111 140 249 43 235 90 114 37 249 57 70 227 114 27 62 4 195 100 39 34 16 42 138 79 88 167 3 173 190 180 46 19 237 93 170 72 215 213 125 212 42 123 92 250 70 4 80 228 204 14 66 91 140 237 219 242 207 252 150 147 224 219 17 54 84 98 52 56 143 12 96 155 59 151 86 56 173 243 210 91 139 160 91 234 78 150 184 124 215 213 160 134 112 64 211 145 41 183 162 60 173 245 140 187 207 26 146 138 228 52 123 192 216 108 95 233 10 194 195 167 32 154 90 223 44 93 82 92 186 71 213 155 239 36 40 112 56 32 47 213 127 41 192 178 65 3 104 146 204 224 156 204 151 75 69 239 58 16 10 171 112 58 152 149 112 173 53 177 234 133 43 164 28 128 33 49 169 174 96 122 128 38 72 0 184 1 192 147 99 85 34 145 60 86 231 175 219 58 37 243 143 49 84 234 38 139 129 89 249 161 209 83 17 197 123 157 3 246 116 17 224 109 177 44 63 44 134 145 153 113 154 166 119 139 52 96 209 20 180 44 172 157 175 140 16 211 159 196 106 248 111 19 252 115 89 247 102 66 116 30 138 227 248 220 210 111 152 156 203 71 152 149 64 5 251 233 2 3 1 0 1 163 129 191 48 129 188 48 15 6 3 85 29 19 1 1 255 4 5 48 3 1 1 255 48 93 6 8 43 6 1 5 5 7 1 1 4 81 48 79 48 35 6 8 43 6 1 5 5 7 48 1 134 23 104 116 116 112 58 47 47 111 99 115 112 46 67 65 99 101 114 116 46 111 114 103 47 48 40 6 8 43 6 1 5 5 7 48 2 134 28 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 47 99 97 46 99 114 116 48 74 6 3 85 29 32 4 67 48 65 48 63 6 8 43 6 1 4 1 129 144 74 48 51 48 49 6 8 43 6 1 5 5 7 2 1 22 37 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 47 105 110 100 101 120 46 112 104 112 63 105 100 61 49 48 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 3 130 2 1 0 127 8 136 161 218 26 80 73 218 137 251 161 8 114 243 138 247 30 196 58 180 121 91 32 48 177 69 222 194 93 211 101 105 241 194 93 84 84 60 133 95 185 123 66 145 194 153 253 27 81 155 171 70 165 161 16 83 158 109 136 172 115 110 44 51 166 240 244 158 224 117 193 62 136 69 169 225 102 67 254 86 90 209 122 65 120 247 64 218 74 58 241 11 91 165 187 22 6 230 194 231 147 185 133 77 151 79 177 30 56 67 128 239 155 13 140 239 184 167 96 0 135 87 125 30 68 28 203 35 239 155 60 153 157 175 181 41 28 69 121 22 150 77 39 109 241 28 108 195 194 85 100 179 188 20 226 243 164 31 30 50 252 39 21 5 207 221 46 174 62 130 97 123 240 33 16 24 246 68 234 83 57 249 220 208 154 32 224 198 187 224 187 90 79 196 153 200 7 189 181 189 162 219 46 98 13 66 52 65 188 255 139 138 245 81 34 170 136 48 0 226 176 212 188 190 101 186 213 3 87 121 155 232 220 200 77 248 80 237 145 165 82 40 162 172 251 54 88 62 233 148 43 145 80 135 27 214 94 214 140 204 247 15 16 12 82 78 208 22 97 229 229 10 108 191 23 199 114 70 87 156 152 245 108 96 99 122 111 94 185 78 47 200 185 185 187 106 133 188 152 13 237 249 62 151 132 52 148 174 0 175 161 229 231 146 110 78 189 243 226 217 20 139 92 210 235 1 108 160 23 165 45 16 235 156 122 74 189 189 238 206 253 237 34 64 171 112 56 136 245 10 135 106 194 171 5 96 201 72 5 218 83 193 222 68 119 106 179 243 60 60 237 128 188 166 56 74 41 36 95 254 89 59 155 37 122 86 99 0 100 185 93 164 98 125 87 54 79 173 131 239 31 146 83 160 142 119 87 221 229 97 17 61 35 0 144 76 60 250 163 96 147 4 163 175 53 246 14 106 143 79 74 96 167 133 5 108 70 161 143 244 199 118 227 161 89 87 247 113 178 196 110 20 92 109 109 65 102 223 27 147 177 212 0 195 238 203 207 60 61 33 128 169 95 99 101 252 221 224 95 164 244 43 240 133 113 65 212 103 37 251 26 177 151 174 214 153 130 19 65 210 110 165 27 153 39 128 231 11 169 168 0) asByteArray.
!

----- Method: CryptoX509Test>>certificate3 (in category 'as yet unclassified') -----
certificate3

	^ X509Certificate fromBytes: self certificate3DerBytes.
!

----- Method: CryptoX509Test>>certificate3DerBytes (in category 'as yet unclassified') -----
certificate3DerBytes

	^ #(48 130 3 218 48 130 3 67 160 3 2 1 2 2 9 0 140 185 190 232 201 54 220 170 48 13 6 9 42 134 72 134 247 13 1 1 5 5 0 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 30 23 13 48 54 49 48 48 55 48 50 48 56 51 48 90 23 13 48 55 49 48 48 55 48 50 48 56 51 48 90 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 129 159 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 129 141 0 48 129 137 2 129 129 0 173 143 214 185 218 87 229 44 80 166 163 79 54 238 238 119 250 53 201 194 83 47 165 93 236 136 156 46 77 254 204 84 226 23 111 253 38 70 57 58 130 98 203 75 33 203 85 148 159 177 158 236 221 210 151 41 37 7 83 177 232 28 230 226 191 202 195 198 223 81 96 247 16 120 199 245 55 1 145 99 139 182 214 231 29 109 72 55 73 246 85 59 164 254 31 162 150 99 140 150 67 8 16 83 63 207 232 61 89 54 141 207 173 40 23 78 187 244 106 67 120 163 239 85 59 200 124 61 2 3 1 0 1 163 130 1 14 48 130 1 10 48 29 6 3 85 29 14 4 22 4 20 67 174 154 200 134 183 132 64 188 62 117 70 124 98 142 30 69 38 161 230 48 129 218 6 3 85 29 35 4 129 210 48 129 207 128 20 67 174 154 200 134 183 132 64 188 62 117 70 124 98 142 30 69 38 161 230 161 129 171 164 129 168 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 130 9 0 140 185 190 232 201 54 220 170 48 12 6 3 85 29 19 4 5 48 3 1 1 255 48 13 6 9 42 134 72 134 247 13 1 1 5 5 0 3 129 129 0 79 3 254 24 194 236 174 88 62 93 13 195 62 47 243 181 54 113 91 48 128 148 120 173 2 1 51 18 196 218 199 69 29 231 71 24 218 25 17 243 248 83 91 122 39 123 67 16 98 89 209 5 21 66 13 136 121 140 204 84 230 21 24 192 227 5 43 17 247 76 225 145 99 92 76 8 36 109 101 240 168 154 255 189 83 12 33 102 59 37 143 208 66 84 85 31 168 17 247 136 63 139 191 106 35 64 245 22 196 75 35 38 0 254 250 220 45 51 223 179 185 178 240 208 173 126 147 152) asByteArray.
!

----- Method: CryptoX509Test>>certificate4 (in category 'as yet unclassified') -----
certificate4

	^ X509Certificate fromBytes: self certificate4DerBytes.
!

----- Method: CryptoX509Test>>certificate4DerBytes (in category 'as yet unclassified') -----
certificate4DerBytes

	^ #(48 130 4 137 48 130 4 73 160 3 2 1 2 2 9 0 154 108 174 196 121 225 111 157 48 9 6 7 42 134 72 206 56 4 3 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 30 23 13 48 54 48 57 50 56 48 52 49 53 51 51 90 23 13 48 54 49 48 50 56 48 52 49 53 51 51 90 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 130 1 183 48 130 1 44 6 7 42 134 72 206 56 4 1 48 130 1 31 2 129 129 0 250 96 75 234 179 162 106 27 210 120 121 182 48 224 158 231 231 116 83 4 28 182 178 246 152 16 150 177 67 14 236 84 56 64 219 142 235 4 111 152 120 85 6 62 102 184 175 81 233 109 104 178 27 106 172 97 253 21 99 12 140 21 14 216 115 42 143 224 135 188 153 111 36 159 142 12 41 238 55 59 94 180 57 133 189 198 57 4 163 61 51 142 29 231 71 224 122 161 249 134 11 134 43 20 141 119 35 142 141 59 209 199 110 252 23 73 58 69 117 164 138 128 254 190 152 130 42 65 2 21 0 159 107 157 78 74 110 231 182 181 187 55 19 124 95 51 60 134 133 168 103 2 129 129 0 214 76 85 195 53 194 159 183 253 102 252 10 113 203 200 193 57 75 243 100 44 206 117 94 67 207 50 1 64 23 204 213 112 114 34 195 102 129 186 25 125 252 4 201 46 88 162 165 78 87 59 206 12 166 187 218 247 64 250 138 202 204 155 26 15 109 105 56 169 238 90 33 62 138 79 38 71 61 46 141 66 61 61 110 131 118 161 114 217 62 223 157 179 210 149 43 42 107 71 46 117 53 119 94 53 254 235 66 211 152 65 189 249 159 197 241 44 226 46 18 12 93 15 214 27 124 253 79 3 129 132 0 2 129 128 84 161 136 129 16 99 74 218 90 65 16 71 166 38 143 10 165 41 134 237 141 14 5 87 20 71 3 94 182 16 107 16 91 12 143 147 6 170 148 250 182 123 86 130 79 57 254 4 127 138 195 16 101 241 185 100 136 27 253 136 126 59 165 82 146 162 56 39 152 46 131 55 63 82 49 139 225 16 22 149 83 96 162 233 177 202 22 57 248 74 120 243 187 167 234 144 229 181 193 42 251 189 228 84 111 147 98 118 135 146 234 67 51 70 126 83 150 165 232 238 137 129 6 68 227 141 211 183 163 130 1 9 48 130 1 5 48 29 6 3 85 29 14 4 22 4 20 209 186 247 182 110 187 240 40 78 115 97 182 249 254 36 98 42 89 70 8 48 129 213 6 3 85 29 35 4 129 205 48 129 202 128 20 209 186 247 182 110 187 240 40 78 115 97 182 249 254 36 98 42 89 70 8 161 129 166 164 129 163 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 130 9 0 154 108 174 196 121 225 111 157 48 12 6 3 85 29 19 4 5 48 3 1 1 255 48 9 6 7 42 134 72 206 56 4 3 3 47 0 48 44 2 20 25 205 133 210 227 114 134 176 207 219 77 229 215 40 87 0 147 167 239 95 2 20 16 53 89 74 65 85 26 169 123 55 90 120 145 26 152 190 159 192 92 212) asByteArray.
!

----- Method: CryptoX509Test>>testAsnDerEncoding (in category 'as yet unclassified') -----
testAsnDerEncoding

	self assert: self certificate1 asAsn1Bytes = self certificate1DerBytes.
	self assert: self certificate2 asAsn1Bytes = self certificate2DerBytes.
	self assert: self certificate3 asAsn1Bytes = self certificate3DerBytes.
	self assert: self certificate4 asAsn1Bytes = self certificate4DerBytes.
!

----- Method: CryptoX509Test>>testSignatureValidation (in category 'as yet unclassified') -----
testSignatureValidation

	self assert: (self certificate1 verifyFromParentCertificate: self certificate1).
!

Object subclass: #ASN1TestModel
	instanceVariableNames: 'testSlot1 testSlot2'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'CryptoCertsTests'!

----- Method: ASN1TestModel>>testSlot1 (in category 'accessing') -----
testSlot1
	"Answer the value of testSlot1"

	^ testSlot1!

----- Method: ASN1TestModel>>testSlot1: (in category 'accessing') -----
testSlot1: anObject
	"Set the value of testSlot1"

	testSlot1 := anObject!

----- Method: ASN1TestModel>>testSlot2 (in category 'accessing') -----
testSlot2
	"Answer the value of testSlot2"

	^ testSlot2!

----- Method: ASN1TestModel>>testSlot2: (in category 'accessing') -----
testSlot2: anObject
	"Set the value of testSlot2"

	testSlot2 := anObject!




More information about the Squeak-dev mailing list