From 38e1ea7c48b4bb62f5aade73943dce269bf6a464 Mon Sep 17 00:00:00 2001 From: Norbert Hartl Date: Tue, 23 Sep 2025 15:39:40 +0200 Subject: [PATCH] - introduced tracking of values that have been added through a default setting. - additionally enable the write visitor to skip elements that have been added by default in order to produce a structure that is comparable to the one being read --- .../ASN1AdaptiveTypeCollection.class.st | 33 +++--- ASN1-Model/ASN1AdaptiveTypeExternal.class.st | 29 ++--- ASN1-Model/ASN1AdaptiveTypeObject.class.st | 102 ++++++++++-------- ASN1-Model/ASN1AdaptiveTypeValue.class.st | 27 ++--- ASN1-Model/ASN1AnyType.class.st | 13 +-- ASN1-Model/ASN1Array.class.st | 39 +++---- ASN1-Model/ASN1BMPStringType.class.st | 15 +-- ASN1-Model/ASN1BasicObject.class.st | 23 ++-- ASN1-Model/ASN1BasicObject.extension.st | 11 -- ASN1-Model/ASN1BinaryBitStringValue.class.st | 9 +- ASN1-Model/ASN1BitStringType.class.st | 35 +++--- ASN1-Model/ASN1BitStringValue.class.st | 33 +++--- ASN1-Model/ASN1BooleanType.class.st | 17 +-- ASN1-Model/ASN1CachedModelRoot.class.st | 23 ++-- ASN1-Model/ASN1ChoiceType.class.st | 15 +-- ASN1-Model/ASN1ChoiceValue.class.st | 13 +-- ASN1-Model/ASN1ClassType.class.st | 9 +- ASN1-Model/ASN1CollectionType.class.st | 27 ++--- ASN1-Model/ASN1ComponentType.class.st | 45 ++++---- ASN1-Model/ASN1Composite.class.st | 17 +-- ASN1-Model/ASN1Constraint.class.st | 17 +-- ASN1-Model/ASN1ConstructedType.class.st | 7 +- ASN1-Model/ASN1Context.class.st | 23 ++-- ASN1-Model/ASN1CurrentContext.class.st | 13 +-- ASN1-Model/ASN1DefinitionObject.class.st | 17 +-- ASN1-Model/ASN1Dictionary.class.st | 47 ++++---- ASN1-Model/ASN1ElementCollection.class.st | 13 +-- ASN1-Model/ASN1ElementComplement.class.st | 21 ++-- ASN1-Model/ASN1ElementSet.class.st | 7 +- ASN1-Model/ASN1EncodedType.class.st | 27 ++--- ASN1-Model/ASN1EnumeratedType.class.st | 33 +++--- ASN1-Model/ASN1EnumeratedValue.class.st | 11 +- ASN1-Model/ASN1Extension.class.st | 19 ++-- ASN1-Model/ASN1ExternalType.class.st | 19 ++-- ASN1-Model/ASN1ExternalValue.class.st | 15 +-- ASN1-Model/ASN1FindByKeyVisitor.class.st | 18 ++-- ASN1-Model/ASN1GeneralizedTimeType.class.st | 15 +-- ASN1-Model/ASN1HexBitStringValue.class.st | 9 +- ASN1-Model/ASN1IA5StringType.class.st | 15 +-- ASN1-Model/ASN1IntegerType.class.st | 23 ++-- ASN1-Model/ASN1IntegerValue.class.st | 11 +- ASN1-Model/ASN1Intersection.class.st | 9 +- ASN1-Model/ASN1InvalidFieldName.class.st | 8 +- ASN1-Model/ASN1InvalidValue.class.st | 8 +- ASN1-Model/ASN1ModelConfiguration.class.st | 13 +-- ASN1-Model/ASN1ModelRoot.class.st | 41 +++---- ASN1-Model/ASN1ModelVisitor.class.st | 78 +++++++------- ASN1-Model/ASN1ModifierDefaultValue.class.st | 17 +-- ASN1-Model/ASN1ModifierOptional.class.st | 15 +-- ASN1-Model/ASN1Module.class.st | 61 +++++------ ASN1-Model/ASN1NamedNumber.class.st | 21 ++-- ASN1-Model/ASN1NamedValue.class.st | 19 ++-- ASN1-Model/ASN1NullType.class.st | 17 +-- ASN1-Model/ASN1NumericStringType.class.st | 15 +-- ASN1-Model/ASN1ObjectIdentifier.class.st | 25 ++--- ASN1-Model/ASN1ObjectIdentifierType.class.st | 19 ++-- ASN1-Model/ASN1ObjectType.class.st | 27 ++--- ASN1-Model/ASN1ObjectType.extension.st | 6 -- ASN1-Model/ASN1OctetStringType.class.st | 21 ++-- ASN1-Model/ASN1OctetStringValue.class.st | 27 ++--- ASN1-Model/ASN1OpenType.class.st | 23 ++-- ASN1-Model/ASN1OpenValue.class.st | 11 +- ASN1-Model/ASN1Parameter.class.st | 15 +-- ASN1-Model/ASN1PrematureEndOfStream.class.st | 8 +- ASN1-Model/ASN1PrimitiveType.class.st | 25 ++--- ASN1-Model/ASN1PrimitiveValue.class.st | 29 ++--- ASN1-Model/ASN1PrintableStringType.class.st | 17 +-- ASN1-Model/ASN1SequenceType.class.st | 17 +-- ASN1-Model/ASN1SequenceValue.class.st | 11 +- ASN1-Model/ASN1SetType.class.st | 17 +-- ASN1-Model/ASN1TaggedType.class.st | 31 +++--- ASN1-Model/ASN1TaggedValue.class.st | 27 ++--- ASN1-Model/ASN1TeletexStringType.class.st | 15 +-- ASN1-Model/ASN1TypeObject.class.st | 39 +++---- ASN1-Model/ASN1TypedCollectionType.class.st | 17 +-- ASN1-Model/ASN1TypedSequenceType.class.st | 15 +-- ASN1-Model/ASN1TypedSetType.class.st | 11 +- ASN1-Model/ASN1UTCTimeType.class.st | 17 +-- ASN1-Model/ASN1UTF8StringType.class.st | 15 +-- ASN1-Model/ASN1Union.class.st | 9 +- ASN1-Model/ASN1UniversalStringType.class.st | 15 +-- ASN1-Model/ASN1UnresolvedOid.class.st | 18 ++-- ASN1-Model/ASN1ValidatingVisitor.class.st | 18 ++-- ASN1-Model/ASN1ValueObject.class.st | 35 +++--- ASN1-Model/Boolean.extension.st | 4 +- ASN1-Model/ByteArray.extension.st | 6 +- ASN1-Model/ByteString.extension.st | 4 +- ASN1-Model/HashedCollection.extension.st | 4 +- ASN1-Model/Magnitude.extension.st | 4 +- ASN1-Model/Number.extension.st | 4 +- ASN1-Model/Object.extension.st | 20 ++-- ASN1-Model/String.extension.st | 16 +-- ASN1-Model/UndefinedObject.extension.st | 4 +- ASN1-Model/package.st | 2 +- ASN1-Tool/ASN1.extension.st | 52 ++++----- ASN1-Tool/ASN1ChoiceType.extension.st | 6 +- ASN1-Tool/ASN1DefinitionObject.extension.st | 12 +-- ASN1-Tool/ASN1ElementNotFound.class.st | 10 +- ASN1-Tool/ASN1EncodedType.extension.st | 6 +- ASN1-Tool/ASN1ExplicitTags.extension.st | 6 +- ASN1-Tool/ASN1ImplicitTags.extension.st | 6 +- .../ASN1MandatoryElementNotFound.class.st | 10 +- ASN1-Tool/ASN1ModelRoot.extension.st | 12 +-- ASN1-Tool/ASN1Module.extension.st | 16 +-- ASN1-Tool/ASN1ObjectFactory.class.st | 20 ++-- ASN1-Tool/ASN1PrimitiveType.extension.st | 6 +- ASN1-Tool/ASN1ReadVisitor.class.st | 58 +++++----- ASN1-Tool/ASN1StructureError.class.st | 8 +- ASN1-Tool/ASN1TagEnvironment.extension.st | 4 +- ASN1-Tool/ASN1TaggedType.extension.st | 6 +- ASN1-Tool/ASN1UnexpectedType.class.st | 8 +- ASN1-Tool/ASN1WriteVisitor.class.st | 75 +++++++------ ASN1-Tool/Object.extension.st | 4 +- ASN1-Tool/package.st | 2 +- 114 files changed, 1162 insertions(+), 1050 deletions(-) delete mode 100644 ASN1-Model/ASN1BasicObject.extension.st delete mode 100644 ASN1-Model/ASN1ObjectType.extension.st diff --git a/ASN1-Model/ASN1AdaptiveTypeCollection.class.st b/ASN1-Model/ASN1AdaptiveTypeCollection.class.st index eeab1eb..0e2d84e 100644 --- a/ASN1-Model/ASN1AdaptiveTypeCollection.class.st +++ b/ASN1-Model/ASN1AdaptiveTypeCollection.class.st @@ -1,23 +1,24 @@ Class { - #name : #ASN1AdaptiveTypeCollection, - #superclass : #ASN1AdaptiveTypeValue, + #name : 'ASN1AdaptiveTypeCollection', + #superclass : 'ASN1AdaptiveTypeValue', #instVars : [ 'elements' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeCollection >> add: anObject [ elements add: anObject. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1AdaptiveTypeCollection >> addAll: aCollection [ elements addAll: aCollection. ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeCollection >> addUsing: aBlock [ "create a new object of the nested type and hand it over to the given block for initialization. Add the return value in @@ -28,53 +29,53 @@ ASN1AdaptiveTypeCollection >> addUsing: aBlock [ ^ self add: newValue ] -{ #category : #finding } +{ #category : 'finding' } ASN1AdaptiveTypeCollection >> basicFind: aKey [ ^ self find: aKey in: elements ] -{ #category : #iterating } +{ #category : 'iterating' } ASN1AdaptiveTypeCollection >> collect: aBlock [ ^ elements collect: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeCollection >> elements [ ^ elements ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeCollection >> first [ ^ elements first ] -{ #category : #initialization } +{ #category : 'initialization' } ASN1AdaptiveTypeCollection >> initialize [ super initialize. elements := OrderedCollection new ] -{ #category : #initialize } +{ #category : 'initialize' } ASN1AdaptiveTypeCollection >> initializeFrom: anObject [ ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeCollection >> isEmpty [ ^ elements isEmpty ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeCollection >> isEmptyOrNil [ ^ elements isEmptyOrNil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeCollection >> size [ ^ elements size ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeCollection >> value: aCollection [ elements := aCollection asOrderedCollection ] diff --git a/ASN1-Model/ASN1AdaptiveTypeExternal.class.st b/ASN1-Model/ASN1AdaptiveTypeExternal.class.st index 8092071..77c28cd 100644 --- a/ASN1-Model/ASN1AdaptiveTypeExternal.class.st +++ b/ASN1-Model/ASN1AdaptiveTypeExternal.class.st @@ -1,65 +1,66 @@ Class { - #name : #ASN1AdaptiveTypeExternal, - #superclass : #ASN1AdaptiveTypeValue, + #name : 'ASN1AdaptiveTypeExternal', + #superclass : 'ASN1AdaptiveTypeValue', #instVars : [ 'oid', 'value', 'encoded' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> at: aKey [ ^ value at: aKey ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> decoded: anObject [ value := anObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1AdaptiveTypeExternal >> doesNotUnderstand: aMessage [ ^ aMessage sendTo: value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> encoded [ ^ encoded ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> encoded: anObject [ encoded := anObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1AdaptiveTypeExternal >> externalValue [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> oid [ ^ oid ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> oid: anObject [ oid := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> value: anObject [ value := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeExternal >> valueClass [ ^ nil ] diff --git a/ASN1-Model/ASN1AdaptiveTypeObject.class.st b/ASN1-Model/ASN1AdaptiveTypeObject.class.st index 3c6d577..3914c99 100644 --- a/ASN1-Model/ASN1AdaptiveTypeObject.class.st +++ b/ASN1-Model/ASN1AdaptiveTypeObject.class.st @@ -1,31 +1,39 @@ Class { - #name : #ASN1AdaptiveTypeObject, - #superclass : #ASN1AdaptiveTypeValue, + #name : 'ASN1AdaptiveTypeObject', + #superclass : 'ASN1AdaptiveTypeValue', #instVars : [ 'map', - 'selfExpanding' + 'selfExpanding', + 'addedByDefault' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'initailize-release' } +{ #category : 'initailize-release' } ASN1AdaptiveTypeObject class >> asn1TypeName [ ^ self subclassResponsibility ] -{ #category : #'initailize-release' } +{ #category : 'initailize-release' } ASN1AdaptiveTypeObject class >> typedCollection [ ^ ASN1TypedCollectionType type: self ] -{ #category : #accessing } +{ #category : 'accessing' } +ASN1AdaptiveTypeObject >> addedByDefault: aKey [ + addedByDefault ifNil: [ addedByDefault := OrderedCollection new ]. + addedByDefault add: aKey +] + +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> at: aKey [ ^ self at: aKey ifAbsent: [ KeyNotFound signalFor: aKey ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> at: aKey ifAbsent: aBlock [ "a value can be one of three types: primitive, adaptive type or encoded value. In the first case we want to return the unwrapped value. This is to deliver a convenient API @@ -49,7 +57,7 @@ ASN1AdaptiveTypeObject >> at: aKey ifAbsent: aBlock [ ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> at: aKey put: anObject [ | typeForKey | anObject isAsn1 @@ -64,12 +72,12 @@ ASN1AdaptiveTypeObject >> at: aKey put: anObject [ ^ anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> baseValueAt: aString [ ^ ( self privAt: aString ) baseValue ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> baseValueAt: aString put: anObject [ ^ self expandFieldNamed: aString @@ -77,7 +85,7 @@ ASN1AdaptiveTypeObject >> baseValueAt: aString put: anObject [ baseValue: anObject ] -{ #category : #finding } +{ #category : 'finding' } ASN1AdaptiveTypeObject >> basicFind: aKey [ map at: aKey @@ -85,41 +93,41 @@ ASN1AdaptiveTypeObject >> basicFind: aKey [ ^ self find: aKey in: map values ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> basicTypeAt: aKey [ ^ self basicTypeAt: aKey ifAbsent: [ ASN1InvalidFieldName signal: 'cannot find field ', aKey asString ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> basicTypeAt: aKey ifAbsent: aBlock [ ^ type elementAt: aKey ifNone: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> beSelfExpanding [ selfExpanding := true ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> beStrict [ selfExpanding := false ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> contents [ ^ self ] -{ #category : #copying } +{ #category : 'copying' } ASN1AdaptiveTypeObject >> copyContentTo: anObject [ anObject setMap: map ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> doesNotUnderstand: aMessage [ (aMessage arguments size = 0) ifTrue: [ ^ self @@ -133,19 +141,19 @@ ASN1AdaptiveTypeObject >> doesNotUnderstand: aMessage [ ^ super doesNotUnderstand: aMessage ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> expandAt: aString using: aBlock [ aBlock value: (self expandFieldNamed: aString) ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> expandFieldNamed: aFieldName [ ^ self expandFieldNamed: aFieldName type: (self basicTypeAt: aFieldName) ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> expandFieldNamed: aFieldName type: aFieldType [ "if a value for the given fieldName is present just return it" @@ -157,7 +165,7 @@ ASN1AdaptiveTypeObject >> expandFieldNamed: aFieldName type: aFieldType [ initializeFrom: self ) ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> expandFieldNamed: aFieldName type: aFieldType baseValue: aValue [ "if a value for the given fieldName is present just return it" @@ -169,115 +177,121 @@ ASN1AdaptiveTypeObject >> expandFieldNamed: aFieldName type: aFieldType baseValu initializeFrom: self ) ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeObject >> hasField: aString [ ^ ( self basicTypeAt: aString ifAbsent: [ ^ false ] ) notNil ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeObject >> hasSameType: aType [ ^ aType == type ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeObject >> includesKey: anObject [ ^ map includesKey: anObject ] -{ #category : #initialization } +{ #category : 'initialization' } ASN1AdaptiveTypeObject >> initialize [ super initialize. map := SmallDictionary new. selfExpanding := false ] -{ #category : #initialize } +{ #category : 'initialize' } ASN1AdaptiveTypeObject >> initializeFrom: anObject [ selfExpanding := anObject isSelfExpanding ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeObject >> isSelfExpanding [ ^ selfExpanding ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> keys [ ^ map keys ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> keysAndValuesDo: aBlock [ type keys do: [ :key | map at: key ifPresent: [:value| aBlock value: key value: value ] ] ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeObject >> matchesType: aType [ ^ { ASN1SequenceType . ASN1ChoiceType } includes: aType class ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> privAt: aKey [ ^ map at: aKey ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> privAt: aKey ifAbsent: aBlock [ ^ map at: aKey ifAbsent: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> privAt: aKey put: anObject [ ^ map at: aKey put: anObject. ] -{ #category : #removing } +{ #category : 'removing' } ASN1AdaptiveTypeObject >> removeKey: anObject [ ^ map removeKey: anObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1AdaptiveTypeObject >> removeKey: anObject ifAbsent: aBlock [ ^ map removeKey: anObject ifAbsent: aBlock ] -{ #category : #replacing } +{ #category : 'replacing' } ASN1AdaptiveTypeObject >> replaceContentAt: key with: anObject [ self removeKey: key ifAbsent: []. (self expandFieldNamed: key) replaceContentFrom: anObject ] -{ #category : #replacing } +{ #category : 'replacing' } ASN1AdaptiveTypeObject >> replaceContentFrom: anObject [ (anObject hasSameType: type) ifFalse: [ Error signal: 'cannot exchange content from different types' ]. anObject copyContentTo: self. ] -{ #category : #'class membership' } +{ #category : 'class membership' } ASN1AdaptiveTypeObject >> respondsTo: aSymbol [ (aSymbol isUnary and: [ map includesKey: aSymbol asString ]) ifTrue: [ ^ true ]. ^ super respondsTo: aSymbol ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> selfExpanding: aBoolean [ selfExpanding := aBoolean ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> setMap: aDictionary [ map := aDictionary ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> size [ ^ map size ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeObject >> soleValue [ ^ map values first ] + +{ #category : 'as yet unclassified' } +ASN1AdaptiveTypeObject >> wasAddedByDefault: aKey [ + addedByDefault ifNil: [ ^ false ]. + ^ addedByDefault includes: aKey +] diff --git a/ASN1-Model/ASN1AdaptiveTypeValue.class.st b/ASN1-Model/ASN1AdaptiveTypeValue.class.st index a39e967..1fc2890 100644 --- a/ASN1-Model/ASN1AdaptiveTypeValue.class.st +++ b/ASN1-Model/ASN1AdaptiveTypeValue.class.st @@ -1,36 +1,37 @@ Class { - #name : #ASN1AdaptiveTypeValue, - #superclass : #ASN1ValueObject, - #category : 'ASN1-Model' + #name : 'ASN1AdaptiveTypeValue', + #superclass : 'ASN1ValueObject', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'instance-creation' } +{ #category : 'instance-creation' } ASN1AdaptiveTypeValue class >> asAsn1TypeIn: aContext [ ^ (aContext bindingNamed: self asn1TypeName) value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeValue class >> asn1TypeName [ self subclassResponsibility ] -{ #category : #'instance-creation' } +{ #category : 'instance-creation' } ASN1AdaptiveTypeValue class >> type: aType [ ^ self new type: aType ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeValue >> baseValue [ ^ self ] -{ #category : #finding } +{ #category : 'finding' } ASN1AdaptiveTypeValue >> find: aKey [ ^ self basicFind: aKey ] -{ #category : #finding } +{ #category : 'finding' } ASN1AdaptiveTypeValue >> find: aKey in: aCollection [ aCollection do: [:each| each isAsn1Composite ifTrue: [ @@ -39,21 +40,21 @@ ASN1AdaptiveTypeValue >> find: aKey in: aCollection [ ^ nil ] -{ #category : #testing } +{ #category : 'testing' } ASN1AdaptiveTypeValue >> isAsn1Composite [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeValue >> mapKeyForMessage: aMessage [ ^ aMessage selector asString asn1Denormalized ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1AdaptiveTypeValue >> selfExpanding: aBoolean [ ] -{ #category : #validating } +{ #category : 'validating' } ASN1AdaptiveTypeValue >> validate [ type ifNil: [ Error signal: 'type is nil' ]. type validate: self diff --git a/ASN1-Model/ASN1AnyType.class.st b/ASN1-Model/ASN1AnyType.class.st index 5849c10..af5bf10 100644 --- a/ASN1-Model/ASN1AnyType.class.st +++ b/ASN1-Model/ASN1AnyType.class.st @@ -1,20 +1,21 @@ Class { - #name : #ASN1AnyType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1AnyType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1AnyType class >> universalType [ ^ 'ANY TYPE' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1AnyType >> accept: aVisitor [ ^ aVisitor visitAnyType: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1AnyType >> includesTag: aTag [ ^ true ] diff --git a/ASN1-Model/ASN1Array.class.st b/ASN1-Model/ASN1Array.class.st index 024dff1..d1ba485 100644 --- a/ASN1-Model/ASN1Array.class.st +++ b/ASN1-Model/ASN1Array.class.st @@ -1,81 +1,82 @@ Class { - #name : #ASN1Array, - #superclass : #ASN1Composite, + #name : 'ASN1Array', + #superclass : 'ASN1Composite', #instVars : [ 'collection' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array class >> new [ ^ super new ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> add: anObject [ ^ collection add: anObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> addAll: aCollection [ aCollection do: [:each| self add: each ] ] -{ #category : #converting } +{ #category : 'converting' } ASN1Array >> asOrderedCollection [ ^ collection asOrderedCollection ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> basicFind: aKey [ ^ self find: aKey in: collection ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> collect: aBlock [ ^ collection collect: aBlock ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> detect: aBlock [ ^ collection detect: aBlock ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> do: aBlock [ collection do: aBlock ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> elements [ ^ collection ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> first [ ^ collection first ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> initialize [ super initialize. collection := OrderedCollection new ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> jsonWriteOn: aStream [ collection jsonWriteOn: aStream ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> keysAndValuesDo: aBlock [ collection do: [:each| aBlock value: each key value: each value ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> printOn: aStream [ aStream nextPutAll: 'ASN1Array ['. collection do: [:each| @@ -84,12 +85,12 @@ ASN1Array >> printOn: aStream [ aStream nextPutAll: ' ]' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> second [ ^ collection second ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Array >> size [ ^ collection size ] diff --git a/ASN1-Model/ASN1BMPStringType.class.st b/ASN1-Model/ASN1BMPStringType.class.st index ecbea84..c34a06d 100644 --- a/ASN1-Model/ASN1BMPStringType.class.st +++ b/ASN1-Model/ASN1BMPStringType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1BMPStringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1BMPStringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1BMPStringType class >> decode: aByteArray [ | byteStream | ((aByteArray size \\ 2) = 0) ifFalse: [ Error signal: 'encoded BMPString needs to have an odd number of octets' ]. @@ -14,7 +15,7 @@ ASN1BMPStringType class >> decode: aByteArray [ stream nextPut: (Character value: (byteStream next: 2) asInteger) ] ] ] -{ #category : #codec } +{ #category : 'codec' } ASN1BMPStringType class >> encode: aString [ ^ ByteArray streamContents: [ :stream | aString do: [ :char | | asciiValue | @@ -25,12 +26,12 @@ ASN1BMPStringType class >> encode: aString [ stream nextPutAll: asciiValue asByteArray ]] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BMPStringType class >> universalType [ ^ 'BMPString' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1BMPStringType >> accept: aVisitor [ ^ aVisitor visitPrintableString: self ] diff --git a/ASN1-Model/ASN1BasicObject.class.st b/ASN1-Model/ASN1BasicObject.class.st index 364950e..33241ea 100644 --- a/ASN1-Model/ASN1BasicObject.class.st +++ b/ASN1-Model/ASN1BasicObject.class.st @@ -1,47 +1,48 @@ Class { - #name : #ASN1BasicObject, - #superclass : #Object, - #category : 'ASN1-Model' + #name : 'ASN1BasicObject', + #superclass : 'Object', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1BasicObject class >> asn1InstanceFactory [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } ASN1BasicObject class >> isAsn1ModelClass [ ^ false ] -{ #category : #finding } +{ #category : 'finding' } ASN1BasicObject >> findElement: aBlock [ ^ (aBlock value: self) ifTrue: [ self ] ifFalse: [ nil ] ] -{ #category : #testing } +{ #category : 'testing' } ASN1BasicObject >> includes: anObject [ ^ self == anObject ] -{ #category : #'*asn1-model' } +{ #category : 'as yet unclassified' } ASN1BasicObject >> isAsn1 [ ^ true ] -{ #category : #'*asn1-model' } +{ #category : 'as yet unclassified' } ASN1BasicObject >> isAsn1Object [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } ASN1BasicObject >> isExtension [ ^ false ] -{ #category : #printing } +{ #category : 'printing' } ASN1BasicObject >> printOn: aStream [ aStream nextPutAll: self class name ] diff --git a/ASN1-Model/ASN1BasicObject.extension.st b/ASN1-Model/ASN1BasicObject.extension.st deleted file mode 100644 index 520bc45..0000000 --- a/ASN1-Model/ASN1BasicObject.extension.st +++ /dev/null @@ -1,11 +0,0 @@ -Extension { #name : #ASN1BasicObject } - -{ #category : #'*asn1-model' } -ASN1BasicObject >> isAsn1 [ - ^ true -] - -{ #category : #'*asn1-model' } -ASN1BasicObject >> isAsn1Object [ - ^ false -] diff --git a/ASN1-Model/ASN1BinaryBitStringValue.class.st b/ASN1-Model/ASN1BinaryBitStringValue.class.st index 04aba6f..e046ae9 100644 --- a/ASN1-Model/ASN1BinaryBitStringValue.class.st +++ b/ASN1-Model/ASN1BinaryBitStringValue.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1BinaryBitStringValue, - #superclass : #ASN1BitStringValue, - #category : 'ASN1-Model' + #name : 'ASN1BinaryBitStringValue', + #superclass : 'ASN1BitStringValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1BinaryBitStringValue >> contents: aString [ contents := aString ] diff --git a/ASN1-Model/ASN1BitStringType.class.st b/ASN1-Model/ASN1BitStringType.class.st index ed34bf0..c04222c 100644 --- a/ASN1-Model/ASN1BitStringType.class.st +++ b/ASN1-Model/ASN1BitStringType.class.st @@ -1,13 +1,14 @@ Class { - #name : #ASN1BitStringType, - #superclass : #ASN1PrimitiveType, + #name : 'ASN1BitStringType', + #superclass : 'ASN1PrimitiveType', #instVars : [ 'namedBits' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1BitStringType class >> decode: aCollection [ "bits of all octets are concatenated to get the numerical value. The first octet gives the amount of unused bits in the last octet and is not part of the resulting number " @@ -34,7 +35,7 @@ ASN1BitStringType class >> decode: aCollection [ ^ stream contents ] -{ #category : #codec } +{ #category : 'codec' } ASN1BitStringType class >> encode: anObject [ "encode an 8-padded bytearray for the bits in the bit string. The first octet contains the number of unused bits. " @@ -62,66 +63,66 @@ ASN1BitStringType class >> encode: anObject [ ^ octets asByteArray ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType class >> universalType [ ^ 'BIT STRING' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1BitStringType >> accept: aVisitor [ ^ aVisitor visitBitStringType: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1BitStringType >> acceptsValue: aByteArray [ ^ aByteArray class == ByteArray ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> asn1ValueClass [ ^ ASN1BitStringValue ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> bitNameAtIndex: aNumber [ ^ (self namedBits detect: [ :each | each value = aNumber ]) name ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> bitNames [ ^ self namedBits collect: #name ] -{ #category : #testing } +{ #category : 'testing' } ASN1BitStringType >> hasBitNamed: aString [ ^ (self namedBits detect: [ :each | each name = aString ] ifNone: [ nil ]) notNil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> indexOfBitNamed: aString [ ^ (self namedBits detect: [ :each | each name = aString ] ifNone: [ Error signal: 'cannot find bit named ', aString asString,' in bit string type ', self asString ] ) value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> namedBits [ ^ namedBits ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> namedBits: anArray [ namedBits := anArray ifNil: [ Array new ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringType >> numberOfBits [ ^ self namedBits size ] -{ #category : #printing } +{ #category : 'printing' } ASN1BitStringType >> printOn: aStream [ super printOn: aStream. aStream nextPut: $(. diff --git a/ASN1-Model/ASN1BitStringValue.class.st b/ASN1-Model/ASN1BitStringValue.class.st index d5b0c7c..aa84a2e 100644 --- a/ASN1-Model/ASN1BitStringValue.class.st +++ b/ASN1-Model/ASN1BitStringValue.class.st @@ -1,15 +1,16 @@ Class { - #name : #ASN1BitStringValue, - #superclass : #ASN1PrimitiveValue, - #category : 'ASN1-Model' + #name : 'ASN1BitStringValue', + #superclass : 'ASN1PrimitiveValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1BitStringValue >> accept: aVisitor [ ^ aVisitor visitBitStringValue: self ] -{ #category : #adding } +{ #category : 'adding' } ASN1BitStringValue >> addNamedBit: aString [ "add a single named bit to the binary string representation. " | index | @@ -23,7 +24,7 @@ ASN1BitStringValue >> addNamedBit: aString [ contents at: index put: $1 ] -{ #category : #converting } +{ #category : 'converting' } ASN1BitStringValue >> adjustContentsSize [ "adjust the size of the binary string representation to the amount of named bits available" @@ -34,7 +35,7 @@ ASN1BitStringValue >> adjustContentsSize [ stream nextPut: $0 ] ] ] ] -{ #category : #converting } +{ #category : 'converting' } ASN1BitStringValue >> adjustContentsSize: aNumber [ "adjust the size of the binary string representation to aNumber size" contents := String streamContents: [ :stream | @@ -42,23 +43,23 @@ ASN1BitStringValue >> adjustContentsSize: aNumber [ aNumber timesRepeat: [ stream nextPut: $0 ] ] ] -{ #category : #testing } +{ #category : 'testing' } ASN1BitStringValue >> allBitsAreSet [ ^ (self namedBits difference: self type bitNames ) isEmpty ] -{ #category : #testing } +{ #category : 'testing' } ASN1BitStringValue >> bitEquals: anArray [ ^ (self namedBits difference: anArray) isEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringValue >> contents [ ^ contents ifNil: [ contents := '' ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringValue >> contents: aCollectionOrString [ "enable the setting for the bit string either as binary string or as collection of bit names." @@ -70,17 +71,17 @@ ASN1BitStringValue >> contents: aCollectionOrString [ ] -{ #category : #testing } +{ #category : 'testing' } ASN1BitStringValue >> includesBit: aString [ ^ self namedBits includes: aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringValue >> indexOfBitNamed: aByteString [ self shouldBeImplemented. ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringValue >> namedBits [ "decode binary contents into there named counterparts" | namedBits | @@ -92,7 +93,7 @@ ASN1BitStringValue >> namedBits [ ^ namedBits ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BitStringValue >> namedBits: aCollection [ "encode aCollection of named bits into there binary string representation. Bits need to be kept in binary form because there can be bit strings without named bits" @@ -106,7 +107,7 @@ ASN1BitStringValue >> namedBits: aCollection [ contents := (number printStringBase: 2 length: type namedBits size padded: true) reversed ] -{ #category : #printing } +{ #category : 'printing' } ASN1BitStringValue >> printOn: aStream [ self type numberOfBits isZero ifTrue: [ aStream nextPutAll: '(no named bits)' ] diff --git a/ASN1-Model/ASN1BooleanType.class.st b/ASN1-Model/ASN1BooleanType.class.st index ba82e98..0db374b 100644 --- a/ASN1-Model/ASN1BooleanType.class.st +++ b/ASN1-Model/ASN1BooleanType.class.st @@ -1,32 +1,33 @@ Class { - #name : #ASN1BooleanType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1BooleanType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1BooleanType class >> decode: aByteArray [ ^ aByteArray first ~= 0 ] -{ #category : #codec } +{ #category : 'codec' } ASN1BooleanType class >> encode: aBoolean [ ^ aBoolean ifTrue: #[ 16rff ] ifFalse: #[ 16r00 ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1BooleanType class >> universalType [ ^ 'BOOLEAN' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1BooleanType >> accept: aVisitor [ ^ aVisitor visitBooleanType: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1BooleanType >> acceptsValue: anObject [ ^ anObject isKindOf: Boolean ] diff --git a/ASN1-Model/ASN1CachedModelRoot.class.st b/ASN1-Model/ASN1CachedModelRoot.class.st index ba81fc2..e894c1a 100644 --- a/ASN1-Model/ASN1CachedModelRoot.class.st +++ b/ASN1-Model/ASN1CachedModelRoot.class.st @@ -1,21 +1,22 @@ Class { - #name : #ASN1CachedModelRoot, - #superclass : #ASN1ModelRoot, + #name : 'ASN1CachedModelRoot', + #superclass : 'ASN1ModelRoot', #instVars : [ 'types', 'modulesByOid', 'moduleByName' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1CachedModelRoot class >> on: anASN1ModelRoot [ ^ self new initializeFromModelRoot: anASN1ModelRoot ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CachedModelRoot >> bindingNamed: aString [ types at: aString @@ -23,7 +24,7 @@ ASN1CachedModelRoot >> bindingNamed: aString [ ^ super bindingNamed: aString ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CachedModelRoot >> initialize [ super initialize. types := IdentityDictionary new. @@ -31,33 +32,33 @@ ASN1CachedModelRoot >> initialize [ moduleByName := IdentityDictionary new ] -{ #category : #initialization } +{ #category : 'initialization' } ASN1CachedModelRoot >> initializeFromModelRoot: aModelRoot [ ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1CachedModelRoot >> moduleDefiningOid: anOid [ ^ modulesByOid at: anOid ifAbsentPut: [ super moduleDefiningOid: anOid ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1CachedModelRoot >> moduleNamed: aString [ ^ moduleByName at: aString asSymbol ifAbsentPut: [ super moduleNamed: aString ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CachedModelRoot >> reset [ types := IdentityDictionary new. modulesByOid := Dictionary new. moduleByName := IdentityDictionary new ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1CachedModelRoot >> typeNamed: aString [ | type | type := types at: aString asSymbol ifPresent: [ :v | ^ v ]. diff --git a/ASN1-Model/ASN1ChoiceType.class.st b/ASN1-Model/ASN1ChoiceType.class.st index 7336eea..9cc4337 100644 --- a/ASN1-Model/ASN1ChoiceType.class.st +++ b/ASN1-Model/ASN1ChoiceType.class.st @@ -1,27 +1,28 @@ Class { - #name : #ASN1ChoiceType, - #superclass : #ASN1CollectionType, - #category : 'ASN1-Model' + #name : 'ASN1ChoiceType', + #superclass : 'ASN1CollectionType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ChoiceType >> accept: aVisitor [ ^ aVisitor visitChoiceType: self ] -{ #category : #testing } +{ #category : 'testing' } ASN1ChoiceType >> includesTag: aTag [ ^ (self elements detect: [:each| each value includesTag: aTag ] ifNone: [ nil ]) notNil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ChoiceType >> tagEnvironment [ ^ ASN1ExplicitTags ] -{ #category : #validating } +{ #category : 'validating' } ASN1ChoiceType >> validate: aValue [ (aValue size = 1) ifFalse: [ diff --git a/ASN1-Model/ASN1ChoiceValue.class.st b/ASN1-Model/ASN1ChoiceValue.class.st index 2cf0993..93dc044 100644 --- a/ASN1-Model/ASN1ChoiceValue.class.st +++ b/ASN1-Model/ASN1ChoiceValue.class.st @@ -1,23 +1,24 @@ Class { - #name : #ASN1ChoiceValue, - #superclass : #ASN1ValueObject, + #name : 'ASN1ChoiceValue', + #superclass : 'ASN1ValueObject', #instVars : [ 'value' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ChoiceValue >> accept: aVisitor [ ^ aVisitor visitChoiceValue: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ChoiceValue >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ChoiceValue >> value: anObject [ value := anObject ] diff --git a/ASN1-Model/ASN1ClassType.class.st b/ASN1-Model/ASN1ClassType.class.st index 394493b..1bb7c96 100644 --- a/ASN1-Model/ASN1ClassType.class.st +++ b/ASN1-Model/ASN1ClassType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1ClassType, - #superclass : #ASN1TypeObject, - #category : 'ASN1-Model' + #name : 'ASN1ClassType', + #superclass : 'ASN1TypeObject', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ClassType >> accept: aVisitor [ ^ aVisitor visitClass: self ] diff --git a/ASN1-Model/ASN1CollectionType.class.st b/ASN1-Model/ASN1CollectionType.class.st index 879d3f7..6a88835 100644 --- a/ASN1-Model/ASN1CollectionType.class.st +++ b/ASN1-Model/ASN1CollectionType.class.st @@ -1,62 +1,63 @@ Class { - #name : #ASN1CollectionType, - #superclass : #ASN1ConstructedType, + #name : 'ASN1CollectionType', + #superclass : 'ASN1ConstructedType', #instVars : [ 'elements' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1CollectionType >> asn1ValueClass [ ^ ASN1AdaptiveTypeObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CollectionType >> elementAt: aString [ ^ elements at: aString ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CollectionType >> elementAt: aString ifNone: aBlock [ ^ elements at: aString ifAbsent: aBlock ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CollectionType >> elementWithTag: aTag [ ^ self elementWithTag: aTag ifNone: [ NotFound signal ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CollectionType >> elementWithTag: aTag ifNone: aBlock [ elements associationsDo: [ :each | (each value tag = aTag) ifTrue: [ ^ each ] ]. aBlock value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1CollectionType >> elements [ ^ elements ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1CollectionType >> elements: anObject [ elements := anObject ] -{ #category : #testing } +{ #category : 'testing' } ASN1CollectionType >> hasElementWithTag: aTag [ ^ ([ self elementWithTag: aTag ] on: NotFound do: [ :err| nil ]) notNil ] -{ #category : #testing } +{ #category : 'testing' } ASN1CollectionType >> hasElements [ ^ elements notNil and: [ elements notEmpty ] ] -{ #category : #validating } +{ #category : 'validating' } ASN1CollectionType >> validateType: aType value: aValue [ (aValue isAsn1Value and: [ aValue type notNil ]) ifTrue: [ diff --git a/ASN1-Model/ASN1ComponentType.class.st b/ASN1-Model/ASN1ComponentType.class.st index 566d1a0..357f98d 100644 --- a/ASN1-Model/ASN1ComponentType.class.st +++ b/ASN1-Model/ASN1ComponentType.class.st @@ -1,34 +1,35 @@ Class { - #name : #ASN1ComponentType, - #superclass : #ASN1TypeObject, + #name : 'ASN1ComponentType', + #superclass : 'ASN1TypeObject', #instVars : [ 'type', 'modifier' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ComponentType >> accept: aVisitor [ ^ aVisitor visitComponentType: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> asn1ValueClass [ ^ type asn1ValueClass ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> basicType [ ^ type basicType ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> defaultValue [ ^ modifier value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> doesNotUnderstand: aMessage [ [ ^ aMessage sendTo: type ] on: Error @@ -36,72 +37,72 @@ ASN1ComponentType >> doesNotUnderstand: aMessage [ ^ super doesNotUnderstand: aMessage ] -{ #category : #testing } +{ #category : 'testing' } ASN1ComponentType >> hasDefaultValue [ ^ modifier notNil and: [ modifier isDefaultValue ] ] -{ #category : #testing } +{ #category : 'testing' } ASN1ComponentType >> includesTag: aTag [ ^ self type includesTag: aTag ] -{ #category : #testing } +{ #category : 'testing' } ASN1ComponentType >> isOptional [ ^ modifier notNil and: [ modifier isOptional ] ] -{ #category : #testing } +{ #category : 'testing' } ASN1ComponentType >> matchesValue: aValue [ ^ type matchesValue: aValue ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> modifier [ ^ modifier ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> modifier: aModifier [ modifier := aModifier ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> newBaseValue: anObject [ ^ type newBaseValue: anObject ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1ComponentType >> newValue [ ^ type newValue ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1ComponentType >> newValue: anObject [ ^ type newValue: anObject ] -{ #category : #testing } +{ #category : 'testing' } ASN1ComponentType >> providesScope [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> tag [ ^ type tag ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> type [ ^ type ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ComponentType >> type: anObject [ type := anObject ] -{ #category : #validating } +{ #category : 'validating' } ASN1ComponentType >> validate: anObject [ type validate: anObject ] diff --git a/ASN1-Model/ASN1Composite.class.st b/ASN1-Model/ASN1Composite.class.st index e783e0b..cb8e34e 100644 --- a/ASN1-Model/ASN1Composite.class.st +++ b/ASN1-Model/ASN1Composite.class.st @@ -1,25 +1,26 @@ Class { - #name : #ASN1Composite, - #superclass : #ASN1ValueObject, - #category : 'ASN1-Model' + #name : 'ASN1Composite', + #superclass : 'ASN1ValueObject', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #associating } +{ #category : 'associating' } ASN1Composite >> -> aSymbol [ ^ self find: aSymbol asString ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Composite >> basicFind: aKey [ self subclassResponsibility ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Composite >> find: aKey [ ^ self basicFind: aKey ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Composite >> find: aKey in: aCollection [ aCollection do: [:each| each isAsn1Composite ifTrue: [ @@ -28,7 +29,7 @@ ASN1Composite >> find: aKey in: aCollection [ ^ nil ] -{ #category : #testing } +{ #category : 'testing' } ASN1Composite >> isAsn1Composite [ ^ true ] diff --git a/ASN1-Model/ASN1Constraint.class.st b/ASN1-Model/ASN1Constraint.class.st index 5203933..28cad6f 100644 --- a/ASN1-Model/ASN1Constraint.class.st +++ b/ASN1-Model/ASN1Constraint.class.st @@ -1,34 +1,35 @@ Class { - #name : #ASN1Constraint, - #superclass : #ASN1BasicObject, + #name : 'ASN1Constraint', + #superclass : 'ASN1BasicObject', #instVars : [ 'constraint', 'exception' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1Constraint >> constraint [ ^ constraint ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Constraint >> constraint: anObject [ constraint := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Constraint >> exception [ ^ exception ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Constraint >> exception: anObject [ exception := anObject ] -{ #category : #testing } +{ #category : 'testing' } ASN1Constraint >> includes: anObject [ ^ (constraint includes: anObject) and: [ exception notNil and: [ (exception includes: anObject) not ] ] diff --git a/ASN1-Model/ASN1ConstructedType.class.st b/ASN1-Model/ASN1ConstructedType.class.st index f7ba204..36bc7a2 100644 --- a/ASN1-Model/ASN1ConstructedType.class.st +++ b/ASN1-Model/ASN1ConstructedType.class.st @@ -1,5 +1,6 @@ Class { - #name : #ASN1ConstructedType, - #superclass : #ASN1EncodedType, - #category : 'ASN1-Model' + #name : 'ASN1ConstructedType', + #superclass : 'ASN1EncodedType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } diff --git a/ASN1-Model/ASN1Context.class.st b/ASN1-Model/ASN1Context.class.st index 287af66..739e2c5 100644 --- a/ASN1-Model/ASN1Context.class.st +++ b/ASN1-Model/ASN1Context.class.st @@ -1,55 +1,56 @@ Class { - #name : #ASN1Context, - #superclass : #Object, + #name : 'ASN1Context', + #superclass : 'Object', #instVars : [ 'model', 'factory' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Context >> defaultFactoryClass [ ^ TCAPObjectFactory ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Context >> do: aBlock [ ^ ASN1CurrentContext value: self during: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Context >> factory [ ^ factory ifNil: [ factory := self defaultFactoryClass new asn1Model: model ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Context >> factory: anObject [ factory := anObject. model ifNotNil: [ factory asn1Model: model ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Context >> model [ ^ model ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Context >> model: anObject [ model := anObject. factory ifNotNil: [ factory asn1Model: model ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Context >> moduleDefiningOid: aString [ ^ factory moduleDefiningOid: aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Context >> typeNamed: aString [ ^ self factory typeNamed: aString ] diff --git a/ASN1-Model/ASN1CurrentContext.class.st b/ASN1-Model/ASN1CurrentContext.class.st index d8e309f..3e62c95 100644 --- a/ASN1-Model/ASN1CurrentContext.class.st +++ b/ASN1-Model/ASN1CurrentContext.class.st @@ -1,23 +1,24 @@ Class { - #name : #ASN1CurrentContext, - #superclass : #DynamicVariable, + #name : 'ASN1CurrentContext', + #superclass : 'DynamicVariable', #classInstVars : [ 'default' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1CurrentContext class >> default [ ^ default ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1CurrentContext class >> default: anObject [ default := anObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1CurrentContext >> default [ ^ self class default ] diff --git a/ASN1-Model/ASN1DefinitionObject.class.st b/ASN1-Model/ASN1DefinitionObject.class.st index e1d7712..c8fd3ac 100644 --- a/ASN1-Model/ASN1DefinitionObject.class.st +++ b/ASN1-Model/ASN1DefinitionObject.class.st @@ -1,33 +1,34 @@ Class { - #name : #ASN1DefinitionObject, - #superclass : #ASN1BasicObject, + #name : 'ASN1DefinitionObject', + #superclass : 'ASN1BasicObject', #instVars : [ 'module' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1DefinitionObject >> asn1TypeNamed: aString [ ^ self modelRoot typeNamed: aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1DefinitionObject >> modelRoot [ ^ self module modelRoot ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1DefinitionObject >> module [ ^ module ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1DefinitionObject >> module: anObject [ module := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1DefinitionObject >> originalBindingName [ "finds the left value of the assignment in the module where the type has been originally defined. Mostly useful for convenience and debugging purposes. diff --git a/ASN1-Model/ASN1Dictionary.class.st b/ASN1-Model/ASN1Dictionary.class.st index f3e11c7..8dc4565 100644 --- a/ASN1-Model/ASN1Dictionary.class.st +++ b/ASN1-Model/ASN1Dictionary.class.st @@ -1,19 +1,20 @@ Class { - #name : #ASN1Dictionary, - #superclass : #ASN1Composite, + #name : 'ASN1Dictionary', + #superclass : 'ASN1Composite', #instVars : [ 'keys', 'values' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #converting } +{ #category : 'converting' } ASN1Dictionary >> asAsn1Dictionary [ ^ self ] -{ #category : #converting } +{ #category : 'converting' } ASN1Dictionary >> asDictionary [ | dict | dict := Dictionary new. @@ -22,7 +23,7 @@ ASN1Dictionary >> asDictionary [ ^ dict ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> at: aKey [ | index | index := keys indexOf: aKey. @@ -31,17 +32,17 @@ ASN1Dictionary >> at: aKey [ ifFalse: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> at: anObject ifAbsent: aBlock [ ^ (self at: anObject) ifNil: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> at: anObject ifPresent: aBlock [ ^ (self at: anObject) ifNotNil: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> at: aKey put: anObject [ (keys includes: aKey) ifTrue: [ @@ -53,7 +54,7 @@ ASN1Dictionary >> at: aKey put: anObject [ values add: anObject ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> basicFind: aKey [ self at: aKey @@ -61,13 +62,13 @@ ASN1Dictionary >> basicFind: aKey [ ^ self find: aKey in: values ] -{ #category : #copying } +{ #category : 'copying' } ASN1Dictionary >> copyFrom: aASN1Dictionary [ aASN1Dictionary keys do: [ :key | self at: key put: (aASN1Dictionary at: key) ]. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> doesNotUnderstand: aMessage [ aMessage selector isUnary ifTrue: [ ^ self at: aMessage selector asString asn1Denormalized ]. @@ -76,40 +77,40 @@ ASN1Dictionary >> doesNotUnderstand: aMessage [ ^ super doesNotUnderstand: aMessage ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> externalValue [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } ASN1Dictionary >> includesKey: anObject [ ^ keys includes: anObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> initialize [ super initialize. keys := OrderedCollection new. values := OrderedCollection new. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> keys [ ^ keys ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> keysAndValuesDo: aBlock [ ^ (1 to: keys size) do: [:index| aBlock value: (keys at: index) value: (values at: index)] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> privAt: aKey [ ^ self at: aKey ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> removeKey: anObject [ | index | index := keys indexOf: anObject. @@ -119,22 +120,22 @@ ASN1Dictionary >> removeKey: anObject [ values removeAt: index ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> size [ ^ keys size ] -{ #category : #validating } +{ #category : 'validating' } ASN1Dictionary >> validate [ ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Dictionary >> valueForKey: aKey type: aType [ ^ self class new ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Dictionary >> values [ ^ values ] diff --git a/ASN1-Model/ASN1ElementCollection.class.st b/ASN1-Model/ASN1ElementCollection.class.st index 57c8c64..c191577 100644 --- a/ASN1-Model/ASN1ElementCollection.class.st +++ b/ASN1-Model/ASN1ElementCollection.class.st @@ -1,23 +1,24 @@ Class { - #name : #ASN1ElementCollection, - #superclass : #ASN1ElementSet, + #name : 'ASN1ElementCollection', + #superclass : 'ASN1ElementSet', #instVars : [ 'elements' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1ElementCollection >> elements [ ^ elements ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ElementCollection >> elements: anObject [ elements := anObject ] -{ #category : #finding } +{ #category : 'finding' } ASN1ElementCollection >> findElement: aBlock [ elements do: [ :each | (each findElement: aBlock) ifNotNil: [ :result| ^ result ] ]. diff --git a/ASN1-Model/ASN1ElementComplement.class.st b/ASN1-Model/ASN1ElementComplement.class.st index dcc49a4..9c67ce0 100644 --- a/ASN1-Model/ASN1ElementComplement.class.st +++ b/ASN1-Model/ASN1ElementComplement.class.st @@ -1,44 +1,45 @@ Class { - #name : #ASN1ElementComplement, - #superclass : #ASN1ElementSet, + #name : 'ASN1ElementComplement', + #superclass : 'ASN1ElementSet', #instVars : [ 'included', 'excluded' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ElementComplement >> accept: anASN1ModelBuilderVisitor [ self shouldBeImplemented. ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ElementComplement >> excluded [ ^ excluded ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ElementComplement >> excluded: anObject [ excluded := anObject ] -{ #category : #finding } +{ #category : 'finding' } ASN1ElementComplement >> findElement: aBlock [ ^ included findElement: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ElementComplement >> included [ ^ included ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ElementComplement >> included: anObject [ included := anObject ] -{ #category : #testing } +{ #category : 'testing' } ASN1ElementComplement >> includes: aType [ ^ (included includes: aType) and: [ excluded isNil or: [ (excluded includes: aType) not ] ] diff --git a/ASN1-Model/ASN1ElementSet.class.st b/ASN1-Model/ASN1ElementSet.class.st index 607b1ce..e39bca4 100644 --- a/ASN1-Model/ASN1ElementSet.class.st +++ b/ASN1-Model/ASN1ElementSet.class.st @@ -1,5 +1,6 @@ Class { - #name : #ASN1ElementSet, - #superclass : #ASN1BasicObject, - #category : 'ASN1-Model' + #name : 'ASN1ElementSet', + #superclass : 'ASN1BasicObject', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } diff --git a/ASN1-Model/ASN1EncodedType.class.st b/ASN1-Model/ASN1EncodedType.class.st index d01740a..af5dc83 100644 --- a/ASN1-Model/ASN1EncodedType.class.st +++ b/ASN1-Model/ASN1EncodedType.class.st @@ -1,6 +1,6 @@ Class { - #name : #ASN1EncodedType, - #superclass : #ASN1TypeObject, + #name : 'ASN1EncodedType', + #superclass : 'ASN1TypeObject', #instVars : [ 'tagEnvironment' ], @@ -10,10 +10,11 @@ Class { #classInstVars : [ 'universalTag' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EncodedType class >> buildUniversalTag [ ^ ASN1Tag new @@ -21,7 +22,7 @@ ASN1EncodedType class >> buildUniversalTag [ number: self tagNumber ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EncodedType class >> createUniversalTagNumberMap [ ^ (Dictionary new) at: 'BOOLEAN' put: 1; @@ -44,45 +45,45 @@ ASN1EncodedType class >> createUniversalTagNumberMap [ yourself. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EncodedType class >> resetUniversalTagNumbers [ tagNumbers := nil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EncodedType class >> tagNumber [ ^ self universalTagNumbers at: self universalType ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EncodedType class >> universalTag [ ^ universalTag ifNil: [ universalTag := self buildUniversalTag ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EncodedType class >> universalTagNumbers [ ^ tagNumbers ifNil: [ tagNumbers := self createUniversalTagNumberMap ] ] -{ #category : #testing } +{ #category : 'testing' } ASN1EncodedType >> includesTag: aTag [ ^ self tag = aTag ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EncodedType >> tagEnvironment [ ^ tagEnvironment ifNil: [ tagEnvironment := self module tagEnvironment ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EncodedType >> tagEnvironment: anObject [ tagEnvironment := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EncodedType >> universalTag [ ^ self class universalTag ] diff --git a/ASN1-Model/ASN1EnumeratedType.class.st b/ASN1-Model/ASN1EnumeratedType.class.st index bce207d..677e603 100644 --- a/ASN1-Model/ASN1EnumeratedType.class.st +++ b/ASN1-Model/ASN1EnumeratedType.class.st @@ -1,77 +1,78 @@ Class { - #name : #ASN1EnumeratedType, - #superclass : #ASN1PrimitiveType, + #name : 'ASN1EnumeratedType', + #superclass : 'ASN1PrimitiveType', #instVars : [ 'elements' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1EnumeratedType class >> decode: aCollection [ ^ aCollection first ] -{ #category : #codec } +{ #category : 'codec' } ASN1EnumeratedType class >> encode: anInteger [ ^ ASN1IntegerType encode: anInteger ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EnumeratedType class >> universalType [ ^ 'ENUMERATED' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1EnumeratedType >> accept: aVisitor [ ^ aVisitor visitEnumeratedType: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1EnumeratedType >> acceptsValue: aString [ ^ aString isString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EnumeratedType >> asn1ValueClass [ ^ ASN1EnumeratedValue ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EnumeratedType >> atName: aString [ ^ elements detect: [:each| each name = aString ] ifNone: [ nil ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EnumeratedType >> atNumber: aNumber [ ^ self namedElements detect: [:each| each number = aNumber ] ifNone: [ ASN1ElementNotFound signal: 'no entry for number ', aNumber asString, ' found' ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EnumeratedType >> elements [ ^ elements ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EnumeratedType >> elements: anObject [ elements := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1EnumeratedType >> namedElements [ ^ self elements reject: #isExtension ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1EnumeratedType >> printOn: aStream [ aStream nextPutAll: 'ENUMERATED' ] -{ #category : #sanitizing } +{ #category : 'sanitizing' } ASN1EnumeratedType >> sanitizeValues [ "enumerated values can be a mix of named numbers and identifiers. In case of identifiers we need to automatically assign numbers. We count from zero on upwards. For every number that has not diff --git a/ASN1-Model/ASN1EnumeratedValue.class.st b/ASN1-Model/ASN1EnumeratedValue.class.st index 72e668f..62a5def 100644 --- a/ASN1-Model/ASN1EnumeratedValue.class.st +++ b/ASN1-Model/ASN1EnumeratedValue.class.st @@ -1,15 +1,16 @@ Class { - #name : #ASN1EnumeratedValue, - #superclass : #ASN1PrimitiveValue, - #category : 'ASN1-Model' + #name : 'ASN1EnumeratedValue', + #superclass : 'ASN1PrimitiveValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1EnumeratedValue >> accept: aVisitor [ ^ aVisitor visitEnumeratedValue: self ] -{ #category : #converting } +{ #category : 'converting' } ASN1EnumeratedValue >> encodedValue [ "an enumerated is encoded as an integer. The integer is the numeric presentation of the enum selected by the label" diff --git a/ASN1-Model/ASN1Extension.class.st b/ASN1-Model/ASN1Extension.class.st index 545db07..4de1ff6 100644 --- a/ASN1-Model/ASN1Extension.class.st +++ b/ASN1-Model/ASN1Extension.class.st @@ -1,35 +1,36 @@ Class { - #name : #ASN1Extension, - #superclass : #ASN1BasicObject, - #category : 'ASN1-Model' + #name : 'ASN1Extension', + #superclass : 'ASN1BasicObject', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1Extension >> accept: aVisitor [ ^ aVisitor visitExtension: self ] -{ #category : #testing } +{ #category : 'testing' } ASN1Extension >> hasDefaultValue [ ^ false ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Extension >> includesTag: anASN1Tag [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } ASN1Extension >> isExtension [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } ASN1Extension >> isOptional [ ^ true ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1Extension >> tag [ ^ nil ] diff --git a/ASN1-Model/ASN1ExternalType.class.st b/ASN1-Model/ASN1ExternalType.class.st index 2878bca..7983d5f 100644 --- a/ASN1-Model/ASN1ExternalType.class.st +++ b/ASN1-Model/ASN1ExternalType.class.st @@ -1,36 +1,37 @@ Class { - #name : #ASN1ExternalType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1ExternalType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1ExternalType class >> universalType [ ^ 'EXTERNAL TYPE' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ExternalType >> accept: aVisitor [ ^ aVisitor visitExternalType: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ExternalType >> asn1ValueClass [ ^ ASN1AdaptiveTypeExternal ] -{ #category : #testing } +{ #category : 'testing' } ASN1ExternalType >> isAsn1ExternalType [ ^ true ] -{ #category : #printing } +{ #category : 'printing' } ASN1ExternalType >> printOn: aStream [ aStream nextPutAll: 'external' ] -{ #category : #validating } +{ #category : 'validating' } ASN1ExternalType >> validate: anObject [ super validate: anObject diff --git a/ASN1-Model/ASN1ExternalValue.class.st b/ASN1-Model/ASN1ExternalValue.class.st index 1343b7a..fa707df 100644 --- a/ASN1-Model/ASN1ExternalValue.class.st +++ b/ASN1-Model/ASN1ExternalValue.class.st @@ -1,28 +1,29 @@ Class { - #name : #ASN1ExternalValue, - #superclass : #ASN1PrimitiveValue, + #name : 'ASN1ExternalValue', + #superclass : 'ASN1PrimitiveValue', #instVars : [ 'oid' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ExternalValue >> accept: aVisitor [ ^ aVisitor visitExternalValue: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ExternalValue >> externalValue [ ^ contents ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ExternalValue >> oid [ ^ oid ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ExternalValue >> oid: anObject [ oid := anObject ] diff --git a/ASN1-Model/ASN1FindByKeyVisitor.class.st b/ASN1-Model/ASN1FindByKeyVisitor.class.st index e2fd9a5..51b46cc 100644 --- a/ASN1-Model/ASN1FindByKeyVisitor.class.st +++ b/ASN1-Model/ASN1FindByKeyVisitor.class.st @@ -1,25 +1,27 @@ Class { - #name : #ASN1FindByKeyVisitor, - #superclass : #ASN1ModelVisitor, + #name : 'ASN1FindByKeyVisitor', + #superclass : 'ASN1ModelVisitor', #instVars : [ 'key', 'objects' ], - #category : 'ASN1-Model-Visitor' + #category : 'ASN1-Model-Visitor', + #package : 'ASN1-Model', + #tag : 'Visitor' } -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } ASN1FindByKeyVisitor >> initialize [ super initialize. objects := OrderedCollection new ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1FindByKeyVisitor >> key: aString [ key := aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1FindByKeyVisitor >> object [ (objects size > 1) ifTrue: [ self error: 'multiple objects found with key ', key asString ]. @@ -28,12 +30,12 @@ ASN1FindByKeyVisitor >> object [ ifEmpty: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1FindByKeyVisitor >> objects [ ^ objects ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1FindByKeyVisitor >> visitCollection: aCollection [ ^ aCollection elements associations collect: [:each| diff --git a/ASN1-Model/ASN1GeneralizedTimeType.class.st b/ASN1-Model/ASN1GeneralizedTimeType.class.st index 9bfa3de..b628072 100644 --- a/ASN1-Model/ASN1GeneralizedTimeType.class.st +++ b/ASN1-Model/ASN1GeneralizedTimeType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1GeneralizedTimeType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1GeneralizedTimeType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1GeneralizedTimeType class >> decode: anObject [ | stream year month day hour minute second nanoSecond offset | stream := anObject readStream. @@ -40,7 +41,7 @@ ASN1GeneralizedTimeType class >> decode: anObject [ ] -{ #category : #codec } +{ #category : 'codec' } ASN1GeneralizedTimeType class >> encode: aDateAndTime [ ^ String streamContents: [ :stream | stream @@ -64,12 +65,12 @@ ASN1GeneralizedTimeType class >> encode: aDateAndTime [ stream nextPutAll: (aDateAndTime offset minutes printPaddedWith: $0 to: 2 ). ] ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1GeneralizedTimeType class >> universalType [ ^ 'GeneralizedTime' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1GeneralizedTimeType >> accept: aVisitor [ ^ aVisitor visitPrintableString: self ] diff --git a/ASN1-Model/ASN1HexBitStringValue.class.st b/ASN1-Model/ASN1HexBitStringValue.class.st index 616511a..9f65491 100644 --- a/ASN1-Model/ASN1HexBitStringValue.class.st +++ b/ASN1-Model/ASN1HexBitStringValue.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1HexBitStringValue, - #superclass : #ASN1BitStringValue, - #category : 'ASN1-Model' + #name : 'ASN1HexBitStringValue', + #superclass : 'ASN1BitStringValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1HexBitStringValue >> contents: aString [ | hexString | hexString := aString size odd diff --git a/ASN1-Model/ASN1IA5StringType.class.st b/ASN1-Model/ASN1IA5StringType.class.st index 031035d..b921689 100644 --- a/ASN1-Model/ASN1IA5StringType.class.st +++ b/ASN1-Model/ASN1IA5StringType.class.st @@ -1,25 +1,26 @@ Class { - #name : #ASN1IA5StringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1IA5StringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1IA5StringType class >> decode: anObject [ ^anObject asString ] -{ #category : #codec } +{ #category : 'codec' } ASN1IA5StringType class >> encode: anObject [ ^anObject asByteArray ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1IA5StringType class >> universalType [ ^ 'IA5String' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1IA5StringType >> accept: aVisitor [ ^ aVisitor visitIA5StringType: self ] diff --git a/ASN1-Model/ASN1IntegerType.class.st b/ASN1-Model/ASN1IntegerType.class.st index e052c7b..8e27a1d 100644 --- a/ASN1-Model/ASN1IntegerType.class.st +++ b/ASN1-Model/ASN1IntegerType.class.st @@ -1,13 +1,14 @@ Class { - #name : #ASN1IntegerType, - #superclass : #ASN1PrimitiveType, + #name : 'ASN1IntegerType', + #superclass : 'ASN1PrimitiveType', #instVars : [ 'namedNumbers' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1IntegerType class >> decode: aCollection [ | value | "Decode a ByteArray to a two's complement value. The first byte has the @@ -29,7 +30,7 @@ ASN1IntegerType class >> decode: aCollection [ ^ value ] -{ #category : #codec } +{ #category : 'codec' } ASN1IntegerType class >> encode: anInteger [ | value bytesNeeded highBitValue | "Encode a signed value to a two's complement byte representation. As we don't know @@ -53,32 +54,32 @@ ASN1IntegerType class >> encode: anInteger [ ^ value asByteArrayOfSize: bytesNeeded ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1IntegerType class >> universalType [ ^ 'INTEGER' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1IntegerType >> accept: aVisitor [ ^ aVisitor visitIntegerType: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1IntegerType >> acceptsValue: anObject [ ^ anObject isNumber ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1IntegerType >> asn1ValueClass [ ^ ASN1IntegerValue ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1IntegerType >> namedNumbers [ ^ namedNumbers ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1IntegerType >> namedNumbers: aCollection [ namedNumbers := aCollection ] diff --git a/ASN1-Model/ASN1IntegerValue.class.st b/ASN1-Model/ASN1IntegerValue.class.st index b653aa0..35bcc6e 100644 --- a/ASN1-Model/ASN1IntegerValue.class.st +++ b/ASN1-Model/ASN1IntegerValue.class.st @@ -1,15 +1,16 @@ Class { - #name : #ASN1IntegerValue, - #superclass : #ASN1PrimitiveValue, - #category : 'ASN1-Model' + #name : 'ASN1IntegerValue', + #superclass : 'ASN1PrimitiveValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1IntegerValue >> accept: aVisitor [ ^ aVisitor visitIntegerValue: self ] -{ #category : #testing } +{ #category : 'testing' } ASN1IntegerValue >> isZero [ ^ contents isZero ] diff --git a/ASN1-Model/ASN1Intersection.class.st b/ASN1-Model/ASN1Intersection.class.st index e0b5e5a..e85ba77 100644 --- a/ASN1-Model/ASN1Intersection.class.st +++ b/ASN1-Model/ASN1Intersection.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1Intersection, - #superclass : #ASN1ElementCollection, - #category : 'ASN1-Model' + #name : 'ASN1Intersection', + #superclass : 'ASN1ElementCollection', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #testing } +{ #category : 'testing' } ASN1Intersection >> includes: aType [ ^ elements allSatisfy: [ :each| each includes: aType ] ] diff --git a/ASN1-Model/ASN1InvalidFieldName.class.st b/ASN1-Model/ASN1InvalidFieldName.class.st index fca8226..49fceba 100644 --- a/ASN1-Model/ASN1InvalidFieldName.class.st +++ b/ASN1-Model/ASN1InvalidFieldName.class.st @@ -1,5 +1,7 @@ Class { - #name : #ASN1InvalidFieldName, - #superclass : #Error, - #category : 'ASN1-Model-Exception' + #name : 'ASN1InvalidFieldName', + #superclass : 'Error', + #category : 'ASN1-Model-Exception', + #package : 'ASN1-Model', + #tag : 'Exception' } diff --git a/ASN1-Model/ASN1InvalidValue.class.st b/ASN1-Model/ASN1InvalidValue.class.st index b1d3877..9d93263 100644 --- a/ASN1-Model/ASN1InvalidValue.class.st +++ b/ASN1-Model/ASN1InvalidValue.class.st @@ -1,5 +1,7 @@ Class { - #name : #ASN1InvalidValue, - #superclass : #Error, - #category : 'ASN1-Model-Exception' + #name : 'ASN1InvalidValue', + #superclass : 'Error', + #category : 'ASN1-Model-Exception', + #package : 'ASN1-Model', + #tag : 'Exception' } diff --git a/ASN1-Model/ASN1ModelConfiguration.class.st b/ASN1-Model/ASN1ModelConfiguration.class.st index ea06006..4623900 100644 --- a/ASN1-Model/ASN1ModelConfiguration.class.st +++ b/ASN1-Model/ASN1ModelConfiguration.class.st @@ -1,22 +1,23 @@ Class { - #name : #ASN1ModelConfiguration, - #superclass : #Object, - #category : 'ASN1-Model' + #name : 'ASN1ModelConfiguration', + #superclass : 'Object', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModelConfiguration >> applyTo: aModel [ self mappings associations do: [ :mapping | (aModel typeNamed: mapping key) valueFactory: mapping value ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModelConfiguration >> clean: aModel [ self mappings associations do: [ :mapping | (aModel typeNamed: mapping key) valueFactory: nil ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModelConfiguration >> mappings [ ^ Dictionary new ] diff --git a/ASN1-Model/ASN1ModelRoot.class.st b/ASN1-Model/ASN1ModelRoot.class.st index c57a802..dcaf2e8 100644 --- a/ASN1-Model/ASN1ModelRoot.class.st +++ b/ASN1-Model/ASN1ModelRoot.class.st @@ -1,13 +1,14 @@ Class { - #name : #ASN1ModelRoot, - #superclass : #Object, + #name : 'ASN1ModelRoot', + #superclass : 'Object', #instVars : [ 'modules' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> abstractSyntaxes [ ^ self modules inject: Set new @@ -15,35 +16,35 @@ ASN1ModelRoot >> abstractSyntaxes [ col addAll: modules abstractSyntaxes ] ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelRoot >> accept: aVisitor [ ^ aVisitor visitModelRoot: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> addModule: aModule [ aModule modelRoot: self. modules add: aModule ] -{ #category : #mapping } +{ #category : 'mapping' } ASN1ModelRoot >> applyMapping: aDictionary [ aDictionary keysAndValuesDo: [ :typeName :factory | (self typeNamed: typeName) valueFactory: factory ] ] -{ #category : #converting } +{ #category : 'converting' } ASN1ModelRoot >> asAsn1Context [ ^ ASN1Context new model: self ] -{ #category : #converting } +{ #category : 'converting' } ASN1ModelRoot >> asModelRootWithClass: aClass [ ^ aClass on: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> bindingNameOfOid: anOidOrString [ modules do: [:each| (each definesOid: anOidOrString asAsn1Oid) ifTrue: [ @@ -51,7 +52,7 @@ ASN1ModelRoot >> bindingNameOfOid: anOidOrString [ ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> bindingNamed: aString [ modules do:[:module| module fields associationsDo: [:field| @@ -60,24 +61,24 @@ ASN1ModelRoot >> bindingNamed: aString [ ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> fieldDefiningOid: anOid [ ^ (self moduleDefiningOid: anOid) fieldDefiningOid: anOid ] -{ #category : #initialize } +{ #category : 'initialize' } ASN1ModelRoot >> initialize [ super initialize. modules := OrderedCollection new ] -{ #category : #initialization } +{ #category : 'initialization' } ASN1ModelRoot >> initializeFromModelRoot: aModelRoot [ modules := aModelRoot modules ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> moduleDefiningOid: anOidOrString [ | oid | oid := anOidOrString asAsn1Oid. @@ -86,17 +87,17 @@ ASN1ModelRoot >> moduleDefiningOid: anOidOrString [ ifNone: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> moduleNamed: aString [ ^ modules detect: [:each| each name = aString ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> modules [ ^ modules ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> objectsWithClass: aString [ | col | col := Dictionary new. @@ -105,7 +106,7 @@ ASN1ModelRoot >> objectsWithClass: aString [ ^ col ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> pduForModule: aModule [ | visitor pdu | visitor := ASN1PDUFindingVisitor new. @@ -124,7 +125,7 @@ ASN1ModelRoot >> pduForModule: aModule [ ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModelRoot >> typeNamed: aString [ ^ (self bindingNamed: aString) value ] diff --git a/ASN1-Model/ASN1ModelVisitor.class.st b/ASN1-Model/ASN1ModelVisitor.class.st index f687601..4219277 100644 --- a/ASN1-Model/ASN1ModelVisitor.class.st +++ b/ASN1-Model/ASN1ModelVisitor.class.st @@ -1,15 +1,17 @@ Class { - #name : #ASN1ModelVisitor, - #superclass : #Object, - #category : 'ASN1-Model-Visitor' + #name : 'ASN1ModelVisitor', + #superclass : 'Object', + #category : 'ASN1-Model-Visitor', + #package : 'ASN1-Model', + #tag : 'Visitor' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visit: anObject [ ^ anObject accept: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModelVisitor >> visitAll: aCollection [ aCollection isNil ifTrue: [ ^ nil ]. ^ aCollection collect: [:each| @@ -17,173 +19,173 @@ ASN1ModelVisitor >> visitAll: aCollection [ ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitBitStringType: aBitStringType [ ^ self visitPrimitiveType: aBitStringType ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitBitStringValue: aBitStringValue [ ^ self visitPrimitiveValue: aBitStringValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitBooleanType: aBooleanType [ ^ self visitPrimitiveType: aBooleanType ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitChoiceType: aChoice [ ^ self visitCollection: aChoice ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitChoiceValue: aChoiceValue [ ^ aChoiceValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitClass: aClass [ ^ aClass ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitCollection: aCollection [ self visitObject: aCollection. ^ aCollection elements collect: [:each| self visit: each] ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitComponentType: aComponentType [ "delegate to inner type" ^ self visit: aComponentType type ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitEnumeratedType: aEnumerated [ ^ aEnumerated ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitExtension: anExtension [ ^ anExtension ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitExternalType: anExternalType [ ^ self visitObject: anExternalType ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitIA5StringType: anInteger [ ^ self visitPrimitiveType: anInteger ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitIntegerType: anInteger [ ^ self visitPrimitiveType: anInteger ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitIntegerValue: anIntegerValue [ ^ self visitPrimitiveValue: anIntegerValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitModelRoot: aModelRoot [ ^ self visitAll: aModelRoot modules ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitModule: aModule [ aModule fields do: [:each| self visit: each ]. ^ aModule ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitNullType: aNullType [ ^ self visitPrimitiveType: aNullType ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitNumericStringType: anOctetString [ ^ self visitPrimitiveType: anOctetString ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModelVisitor >> visitObject: anObject [ ^ anObject ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitObjectIdentifier: anOid [ ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModelVisitor >> visitObjectIdentifierType: anObjectIdentifier [ ^ self visitObject: anObjectIdentifier ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitOctetString: anOctetString [ ^ self visitPrimitiveType: anOctetString ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitOpenType: anOpenType [ ^ self visitObject: anOpenType ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitPrimitiveType: aPrimitive [ ^ self visitObject: aPrimitive ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitPrimitiveValue: anIntegerValue [ ^ anIntegerValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitPrintableString: aPrintableString [ ^ self visitPrimitiveType: aPrintableString ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitSequenceType: aSequence [ ^ self visitCollection: aSequence ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitSet: aSet [ ^ aSet ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitTaggedType: aTaggedType [ ^ self visit: aTaggedType type ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitTypedCollection: aCollection [ self visit: aCollection type. ^ aCollection ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitTypedSequence: aSequence [ ^ self visitTypedCollection: aSequence ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitTypedSet: aSequence [ ^ self visitTypedCollection: aSequence ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ModelVisitor >> visitUTCTimeType: anUTCTimeType [ ^ self visitPrimitiveType: anUTCTimeType ] diff --git a/ASN1-Model/ASN1ModifierDefaultValue.class.st b/ASN1-Model/ASN1ModifierDefaultValue.class.st index f59b34b..2b06948 100644 --- a/ASN1-Model/ASN1ModifierDefaultValue.class.st +++ b/ASN1-Model/ASN1ModifierDefaultValue.class.st @@ -1,34 +1,35 @@ Class { - #name : #ASN1ModifierDefaultValue, - #superclass : #ASN1ModifierOptional, + #name : 'ASN1ModifierDefaultValue', + #superclass : 'ASN1ModifierOptional', #instVars : [ 'value' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ModifierDefaultValue >> contains: anObject [ ^ value contains: anObject ] -{ #category : #testing } +{ #category : 'testing' } ASN1ModifierDefaultValue >> isDefaultValue [ ^ true ] -{ #category : #printing } +{ #category : 'printing' } ASN1ModifierDefaultValue >> printOn: aStream [ aStream nextPutAll: 'defaultvalue: '. value printOn: aStream ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModifierDefaultValue >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModifierDefaultValue >> value: anObject [ value := anObject ] diff --git a/ASN1-Model/ASN1ModifierOptional.class.st b/ASN1-Model/ASN1ModifierOptional.class.st index e253a4e..f625417 100644 --- a/ASN1-Model/ASN1ModifierOptional.class.st +++ b/ASN1-Model/ASN1ModifierOptional.class.st @@ -1,25 +1,26 @@ Class { - #name : #ASN1ModifierOptional, - #superclass : #ASN1BasicObject, - #category : 'ASN1-Model' + #name : 'ASN1ModifierOptional', + #superclass : 'ASN1BasicObject', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #testing } +{ #category : 'testing' } ASN1ModifierOptional >> isDefaultValue [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } ASN1ModifierOptional >> isOptional [ ^ true ] -{ #category : #printing } +{ #category : 'printing' } ASN1ModifierOptional >> printOn: aStream [ aStream nextPutAll: 'optional' ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ModifierOptional >> type: aType [ ] diff --git a/ASN1-Model/ASN1Module.class.st b/ASN1-Model/ASN1Module.class.st index 043e392..3dba903 100644 --- a/ASN1-Model/ASN1Module.class.st +++ b/ASN1-Model/ASN1Module.class.st @@ -1,6 +1,6 @@ Class { - #name : #ASN1Module, - #superclass : #ASN1BasicObject, + #name : 'ASN1Module', + #superclass : 'ASN1BasicObject', #instVars : [ 'name', 'oid', @@ -9,68 +9,69 @@ Class { 'modelRoot', 'pduLabel' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> abstractSyntaxes [ ^ self allObjectsWithClass: 'ABSTRACT-SYNTAX' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1Module >> accept: aVisitor [ ^ aVisitor visitModule: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> addField: anAssociation [ self fields add: anAssociation ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> addFields: aDictionary [ aDictionary associations do: [:field | self addField: field ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> allObjects [ ^ self fields select: [:each| each isAsn1Object ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> allObjectsWithClass: aString [ ^ self allObjects select: [:each| each clazz = aString] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> bindingNameOfOid: aString [ ^ (self fieldDefiningOid: aString) key ] -{ #category : #testing } +{ #category : 'testing' } ASN1Module >> definesOid: anOid [ ^ (self fieldDefiningOid: anOid) notNil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> fieldAt: aString [ ^ self fields at: aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> fieldAt: aString put: anObject [ self fields at: aString put: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> fieldAtValue: anObject [ ^ self fields associations detect: [:each| each value = anObject ] ifNone: [ nil ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> fieldDefiningOid: anOid [ self fields associationsDo: [:each | each value = anOid @@ -78,71 +79,71 @@ ASN1Module >> fieldDefiningOid: anOid [ ^nil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> fields [ ^ fields ifNil: [ fields := Dictionary new ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> fields: anObject [ fields := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } ASN1Module >> initialize [ super initialize. "default tag environment is explicit" tagEnvironment := ASN1ExplicitTags ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> modelRoot [ ^ modelRoot ifNil: [ NotFound signal: 'cannot find model root for ', self asString ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> modelRoot: aModelRoot [ modelRoot := aModelRoot ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> name: anObject [ name := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> objectsWithClass: aString [ ^ self fields select: [:each| each isAsn1Object and: [ each clazz = aString]] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> oid [ ^ oid ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> oid: anObject [ oid := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> pdu [ ^ self fields at: pduLabel ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> pduLabel: aString [ pduLabel := aString ] -{ #category : #printing } +{ #category : 'printing' } ASN1Module >> printOn: aStream [ super printOn: aStream. aStream @@ -153,12 +154,12 @@ ASN1Module >> printOn: aStream [ nextPutAll: ')' ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> tagEnvironment [ ^ tagEnvironment ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Module >> tagEnvironment: aString [ tagEnvironment := aString ] diff --git a/ASN1-Model/ASN1NamedNumber.class.st b/ASN1-Model/ASN1NamedNumber.class.st index 4254102..fdd354a 100644 --- a/ASN1-Model/ASN1NamedNumber.class.st +++ b/ASN1-Model/ASN1NamedNumber.class.st @@ -1,46 +1,47 @@ Class { - #name : #ASN1NamedNumber, - #superclass : #ASN1BasicObject, + #name : 'ASN1NamedNumber', + #superclass : 'ASN1BasicObject', #instVars : [ 'name', 'number' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #creating } +{ #category : 'creating' } ASN1NamedNumber class >> name: aString number: aNumber [ ^ self new name: aString; number:aNumber ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1NamedNumber >> accept: aVisitor [ ^ aVisitor visitNamedNumber: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedNumber >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedNumber >> name: aString [ name := aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedNumber >> number [ ^ number ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedNumber >> number: aNumber [ number := aNumber ] -{ #category : #printing } +{ #category : 'printing' } ASN1NamedNumber >> printOn: aStream [ aStream nextPutAll: 'named number: '; diff --git a/ASN1-Model/ASN1NamedValue.class.st b/ASN1-Model/ASN1NamedValue.class.st index 20ee81e..ad2b642 100644 --- a/ASN1-Model/ASN1NamedValue.class.st +++ b/ASN1-Model/ASN1NamedValue.class.st @@ -1,31 +1,32 @@ Class { - #name : #ASN1NamedValue, - #superclass : #ASN1ValueObject, + #name : 'ASN1NamedValue', + #superclass : 'ASN1ValueObject', #instVars : [ 'name', 'value' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1NamedValue class >> name: aString value: anObject [ ^ self new name: aString; value: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedValue >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedValue >> name: anObject [ name := anObject ] -{ #category : #printing } +{ #category : 'printing' } ASN1NamedValue >> printOn: aStream [ aStream nextPutAll: name asString; @@ -33,12 +34,12 @@ ASN1NamedValue >> printOn: aStream [ nextPutAll: value asString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedValue >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NamedValue >> value: anObject [ value := anObject ] diff --git a/ASN1-Model/ASN1NullType.class.st b/ASN1-Model/ASN1NullType.class.st index b65c4c7..bb063c3 100644 --- a/ASN1-Model/ASN1NullType.class.st +++ b/ASN1-Model/ASN1NullType.class.st @@ -1,30 +1,31 @@ Class { - #name : #ASN1NullType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1NullType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1NullType class >> decode: anArray [ ^ #null ] -{ #category : #codec } +{ #category : 'codec' } ASN1NullType class >> encode: aSymbol [ ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NullType class >> universalType [ ^ 'NULL' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1NullType >> accept: aVisitor [ ^ aVisitor visitNullType: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1NullType >> acceptsValue: anObject [ ^ (anObject value asn1TypeClass = self class) and: [ anObject value isNil ] ] diff --git a/ASN1-Model/ASN1NumericStringType.class.st b/ASN1-Model/ASN1NumericStringType.class.st index 910d9c8..30d384e 100644 --- a/ASN1-Model/ASN1NumericStringType.class.st +++ b/ASN1-Model/ASN1NumericStringType.class.st @@ -1,25 +1,26 @@ Class { - #name : #ASN1NumericStringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1NumericStringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1NumericStringType class >> decode: aCollection [ ^ aCollection asString ] -{ #category : #codec } +{ #category : 'codec' } ASN1NumericStringType class >> encode: aString [ ^ aString asByteArray ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1NumericStringType class >> universalType [ ^ 'NumericString' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1NumericStringType >> accept: aVisitor [ aVisitor visitNumericStringType: self ] diff --git a/ASN1-Model/ASN1ObjectIdentifier.class.st b/ASN1-Model/ASN1ObjectIdentifier.class.st index 3a5b6fc..e43077c 100644 --- a/ASN1-Model/ASN1ObjectIdentifier.class.st +++ b/ASN1-Model/ASN1ObjectIdentifier.class.st @@ -1,54 +1,55 @@ Class { - #name : #ASN1ObjectIdentifier, - #superclass : #ASN1PrimitiveValue, - #category : 'ASN1-Model' + #name : 'ASN1ObjectIdentifier', + #superclass : 'ASN1PrimitiveValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } ASN1ObjectIdentifier class >> string: aString [ ^ self new string: aString ] -{ #category : #comparing } +{ #category : 'comparing' } ASN1ObjectIdentifier >> = anOid [ (anOid class = self class) ifFalse: [ ^ false ]. ^ anOid hasSameValue: contents ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ObjectIdentifier >> accept: aVisitor [ ^ aVisitor visitObjectIdentifier: self ] -{ #category : #converting } +{ #category : 'converting' } ASN1ObjectIdentifier >> asAsn1Oid [ ^ self ] -{ #category : #testing } +{ #category : 'testing' } ASN1ObjectIdentifier >> definesOid: aString [ ^ contents = aString ] -{ #category : #testing } +{ #category : 'testing' } ASN1ObjectIdentifier >> hasSameValue: anObject [ ^ contents = anObject ] -{ #category : #comparing } +{ #category : 'comparing' } ASN1ObjectIdentifier >> hash [ ^ contents hash ] -{ #category : #printing } +{ #category : 'printing' } ASN1ObjectIdentifier >> printOn: aStream [ aStream nextPutAll: 'oid '; nextPutAll: contents asString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectIdentifier >> type [ ^ type ifNil: [ type := ASN1ObjectIdentifierType new ] diff --git a/ASN1-Model/ASN1ObjectIdentifierType.class.st b/ASN1-Model/ASN1ObjectIdentifierType.class.st index 5b77f8f..0c6aa70 100644 --- a/ASN1-Model/ASN1ObjectIdentifierType.class.st +++ b/ASN1-Model/ASN1ObjectIdentifierType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1ObjectIdentifierType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1ObjectIdentifierType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1ObjectIdentifierType class >> decode: anArray [ | objId next val | objId := OrderedCollection new. @@ -26,7 +27,7 @@ ASN1ObjectIdentifierType class >> decode: anArray [ ] -{ #category : #codec } +{ #category : 'codec' } ASN1ObjectIdentifierType class >> encode: anOidOrString [ | components stream octets | octets := OrderedCollection new. @@ -44,22 +45,22 @@ ASN1ObjectIdentifierType class >> encode: anOidOrString [ ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectIdentifierType class >> universalType [ ^ 'OBJECT IDENTIFIER' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ObjectIdentifierType >> accept: aVisitor [ ^ aVisitor visitObjectIdentifierType: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectIdentifierType >> asn1ValueClass [ ^ ASN1ObjectIdentifier ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ObjectIdentifierType >> printOn: aStream [ aStream nextPutAll: 'OID' ] diff --git a/ASN1-Model/ASN1ObjectType.class.st b/ASN1-Model/ASN1ObjectType.class.st index e82d59f..5fc23e5 100644 --- a/ASN1-Model/ASN1ObjectType.class.st +++ b/ASN1-Model/ASN1ObjectType.class.st @@ -1,39 +1,40 @@ Class { - #name : #ASN1ObjectType, - #superclass : #ASN1TypeObject, + #name : 'ASN1ObjectType', + #superclass : 'ASN1TypeObject', #instVars : [ 'clazz', 'attributes' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1ObjectType >> accept: aVisitor [ ^ aVisitor visitObject: self ] -{ #category : #attributes } +{ #category : 'attributes' } ASN1ObjectType >> attributeAt: aString [ ^ attributes at: aString ifAbsent: [ nil ] ] -{ #category : #attributes } +{ #category : 'attributes' } ASN1ObjectType >> attributeAt: aString put: anObject [ attributes at: aString put: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectType >> clazz [ ^ clazz ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectType >> clazz: anObject [ clazz := anObject ] -{ #category : #finding } +{ #category : 'finding' } ASN1ObjectType >> findElement: aBlock [ (aBlock value: self) ifTrue: [ ^ self ] @@ -45,24 +46,24 @@ ASN1ObjectType >> findElement: aBlock [ ^ nil ] -{ #category : #testing } +{ #category : 'testing' } ASN1ObjectType >> includes: aType [ ^ (super includes: aType) or:[ attributes values anySatisfy: [ :each | each isAsn1Type and: [ each includes: aType ] ] ] ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } ASN1ObjectType >> initialize [ super initialize. attributes := Dictionary new ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } ASN1ObjectType >> initializeFromDict: aDictionary [ attributes := aDictionary ] -{ #category : #'*asn1-model' } +{ #category : 'as yet unclassified' } ASN1ObjectType >> isAsn1Object [ ^ true ] diff --git a/ASN1-Model/ASN1ObjectType.extension.st b/ASN1-Model/ASN1ObjectType.extension.st deleted file mode 100644 index 414c8b9..0000000 --- a/ASN1-Model/ASN1ObjectType.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : #ASN1ObjectType } - -{ #category : #'*asn1-model' } -ASN1ObjectType >> isAsn1Object [ - ^ true -] diff --git a/ASN1-Model/ASN1OctetStringType.class.st b/ASN1-Model/ASN1OctetStringType.class.st index 2d4da08..c43a9b9 100644 --- a/ASN1-Model/ASN1OctetStringType.class.st +++ b/ASN1-Model/ASN1OctetStringType.class.st @@ -1,44 +1,45 @@ Class { - #name : #ASN1OctetStringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1OctetStringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1OctetStringType class >> decode: aCollection [ aCollection class == ByteArray ifFalse: [ ^ASN1InvalidValue signal: 'cannot apply value to type ', self universalType]. ^ aCollection ] -{ #category : #codec } +{ #category : 'codec' } ASN1OctetStringType class >> encode: anOctetString [ "an octet string maps 1:1 from data to stream. " ^ anOctetString asByteArray ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1OctetStringType class >> universalType [ ^ 'OCTET STRING' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1OctetStringType >> accept: aVisitor [ ^ aVisitor visitOctetString: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1OctetStringType >> acceptsValue: anObject [ ^ (anObject class = ByteArray) or: [ anObject isByteString ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1OctetStringType >> asn1ValueClass [ ^ ASN1OctetStringValue ] -{ #category : #validating } +{ #category : 'validating' } ASN1OctetStringType >> validate: aString [ super validate: aString. ((aString class = ByteArray) or: [ aString isByteString ]) ifFalse: [ diff --git a/ASN1-Model/ASN1OctetStringValue.class.st b/ASN1-Model/ASN1OctetStringValue.class.st index e007bb0..5b5ae61 100644 --- a/ASN1-Model/ASN1OctetStringValue.class.st +++ b/ASN1-Model/ASN1OctetStringValue.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1OctetStringValue, - #superclass : #ASN1PrimitiveValue, - #category : 'ASN1-Model' + #name : 'ASN1OctetStringValue', + #superclass : 'ASN1PrimitiveValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #comparing } +{ #category : 'comparing' } ASN1OctetStringValue >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -15,51 +16,51 @@ ASN1OctetStringValue >> = anObject [ ^ contents = anObject stringValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1OctetStringValue >> accept: aVisitor [ ^ aVisitor visitOctetStringValue: self ] -{ #category : #converting } +{ #category : 'converting' } ASN1OctetStringValue >> asAsn1HexString [ ^ contents asAsn1HexString ] -{ #category : #converting } +{ #category : 'converting' } ASN1OctetStringValue >> asByteArray [ ^ contents asByteArray ] -{ #category : #converting } +{ #category : 'converting' } ASN1OctetStringValue >> asInteger [ ^ contents asInteger ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1OctetStringValue >> byteSize [ ^ contents size ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1OctetStringValue >> contents: aByteArray [ "(aByteArray class = ByteArray) ifFalse: [ Error signal: 'contents for octet string needs to be a byte array' ]." super contents: aByteArray ] -{ #category : #comparing } +{ #category : 'comparing' } ASN1OctetStringValue >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ contents hash ] -{ #category : #converting } +{ #category : 'converting' } ASN1OctetStringValue >> hex [ ^ contents hex ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1OctetStringValue >> stringValue [ ^ contents ] diff --git a/ASN1-Model/ASN1OpenType.class.st b/ASN1-Model/ASN1OpenType.class.st index 0fd8c9b..94cf423 100644 --- a/ASN1-Model/ASN1OpenType.class.st +++ b/ASN1-Model/ASN1OpenType.class.st @@ -1,45 +1,46 @@ Class { - #name : #ASN1OpenType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1OpenType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1OpenType class >> universalType [ ^ 'OPEN TYPE' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1OpenType >> accept: aVisitor [ ^ aVisitor visitOpenType: self ] -{ #category : #validating } +{ #category : 'validating' } ASN1OpenType >> acceptsType: aType [ ^ true ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1OpenType >> asn1ValueClass [ ^ ASN1OpenValue ] -{ #category : #testing } +{ #category : 'testing' } ASN1OpenType >> includesTag: aTag [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } ASN1OpenType >> matchesValue: aValue [ ^ true ] -{ #category : #printing } +{ #category : 'printing' } ASN1OpenType >> printOn: aStream [ aStream nextPutAll: 'open type' ] -{ #category : #validating } +{ #category : 'validating' } ASN1OpenType >> validate: aValue [ ] diff --git a/ASN1-Model/ASN1OpenValue.class.st b/ASN1-Model/ASN1OpenValue.class.st index 12f9a58..cca8a07 100644 --- a/ASN1-Model/ASN1OpenValue.class.st +++ b/ASN1-Model/ASN1OpenValue.class.st @@ -1,15 +1,16 @@ Class { - #name : #ASN1OpenValue, - #superclass : #ASN1PrimitiveValue, - #category : 'ASN1-Model' + #name : 'ASN1OpenValue', + #superclass : 'ASN1PrimitiveValue', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1OpenValue >> accept: aVisitor [ ^ aVisitor visitOpenValue: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1OpenValue >> contents: anObject [ "we support setting encoded values as open types. This way both modi should be possible either it structured data that needs to be encoded or it is already encoded data" diff --git a/ASN1-Model/ASN1Parameter.class.st b/ASN1-Model/ASN1Parameter.class.st index 149842f..3d21d18 100644 --- a/ASN1-Model/ASN1Parameter.class.st +++ b/ASN1-Model/ASN1Parameter.class.st @@ -1,29 +1,30 @@ Class { - #name : #ASN1Parameter, - #superclass : #ASN1BasicObject, + #name : 'ASN1Parameter', + #superclass : 'ASN1BasicObject', #instVars : [ 'name', 'type' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1Parameter >> name [ ^ name ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Parameter >> name: anObject [ name := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Parameter >> type [ ^ type ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1Parameter >> type: anObject [ type := anObject ] diff --git a/ASN1-Model/ASN1PrematureEndOfStream.class.st b/ASN1-Model/ASN1PrematureEndOfStream.class.st index e26e307..ff85b7e 100644 --- a/ASN1-Model/ASN1PrematureEndOfStream.class.st +++ b/ASN1-Model/ASN1PrematureEndOfStream.class.st @@ -1,5 +1,7 @@ Class { - #name : #ASN1PrematureEndOfStream, - #superclass : #Error, - #category : 'ASN1-Model-Exception' + #name : 'ASN1PrematureEndOfStream', + #superclass : 'Error', + #category : 'ASN1-Model-Exception', + #package : 'ASN1-Model', + #tag : 'Exception' } diff --git a/ASN1-Model/ASN1PrimitiveType.class.st b/ASN1-Model/ASN1PrimitiveType.class.st index 4483133..1d7aa2f 100644 --- a/ASN1-Model/ASN1PrimitiveType.class.st +++ b/ASN1-Model/ASN1PrimitiveType.class.st @@ -1,59 +1,60 @@ Class { - #name : #ASN1PrimitiveType, - #superclass : #ASN1EncodedType, + #name : 'ASN1PrimitiveType', + #superclass : 'ASN1EncodedType', #instVars : [ 'tag' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1PrimitiveType class >> decode: aByteArray [ self notYetImplemented ] -{ #category : #codec } +{ #category : 'codec' } ASN1PrimitiveType class >> encode: anObject [ self notYetImplemented ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrimitiveType class >> withUniversalType: aString [ ^ self allSubclasses detect: [ :cls | cls universalType = aString ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrimitiveType >> asn1ValueClass [ ^ ASN1PrimitiveValue ] -{ #category : #testing } +{ #category : 'testing' } ASN1PrimitiveType >> isAsn1Primitive [ ^ true ] -{ #category : #validating } +{ #category : 'validating' } ASN1PrimitiveType >> newBaseValue: aPrimitiveValue [ (aPrimitiveValue type class = self class) ifFalse: [ Error signal: 'mismatch in type for existing base value' ]. ^ aPrimitiveValue ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1PrimitiveType >> newValue: anObject [ ^ self newValue contents: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrimitiveType >> tag [ ^ tag ifNil: [ tag := self universalTag ] ] -{ #category : #validating } +{ #category : 'validating' } ASN1PrimitiveType >> validate: anObject [ super validate: anObject ] diff --git a/ASN1-Model/ASN1PrimitiveValue.class.st b/ASN1-Model/ASN1PrimitiveValue.class.st index b00848b..b86347e 100644 --- a/ASN1-Model/ASN1PrimitiveValue.class.st +++ b/ASN1-Model/ASN1PrimitiveValue.class.st @@ -1,66 +1,67 @@ Class { - #name : #ASN1PrimitiveValue, - #superclass : #ASN1ValueObject, + #name : 'ASN1PrimitiveValue', + #superclass : 'ASN1ValueObject', #instVars : [ 'contents' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } ASN1PrimitiveValue class >> contents: aString [ ^ self new contents: aString ] -{ #category : #comparing } +{ #category : 'comparing' } ASN1PrimitiveValue >> = anOctetString [ ^ ( type = anOctetString type ) and: [ contents = anOctetString contents ] ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1PrimitiveValue >> accept: aVisitor [ ^ aVisitor visitPrimitiveValue: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1PrimitiveValue >> baseValue [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrimitiveValue >> contents [ ^ contents ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrimitiveValue >> contents: anObject [ anObject isAsn1 ifTrue: [ Error signal: 'cannot use ASN.1 object as contents' ]. contents := anObject ] -{ #category : #converting } +{ #category : 'converting' } ASN1PrimitiveValue >> encodedValue [ ^ type encodedValue: self contents ] -{ #category : #comparing } +{ #category : 'comparing' } ASN1PrimitiveValue >> hasSameValue: aPrimitiveValue [ ^ contents = aPrimitiveValue contents ] -{ #category : #comparing } +{ #category : 'comparing' } ASN1PrimitiveValue >> hash [ ^ type hash bitXor: contents hash ] -{ #category : #testing } +{ #category : 'testing' } ASN1PrimitiveValue >> isAsn1PrimitiveValue [ ^ true ] -{ #category : #printing } +{ #category : 'printing' } ASN1PrimitiveValue >> printOn: aStream [ contents printOn: aStream. aStream nextPutAll: ' ['. diff --git a/ASN1-Model/ASN1PrintableStringType.class.st b/ASN1-Model/ASN1PrintableStringType.class.st index 5244905..5d72bac 100644 --- a/ASN1-Model/ASN1PrintableStringType.class.st +++ b/ASN1-Model/ASN1PrintableStringType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1PrintableStringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1PrintableStringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1PrintableStringType class >> decode: anObject [ | string | string := anObject asString. @@ -13,24 +14,24 @@ ASN1PrintableStringType class >> decode: anObject [ ^ string ] -{ #category : #codec } +{ #category : 'codec' } ASN1PrintableStringType class >> encode: aString [ (aString allSatisfy: [ :each | self validCharacters includes: each ]) ifFalse: [ Error signal: aString, ' is not a valid PrintableString' ]. ^aString asByteArray ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrintableStringType class >> universalType [ ^ 'PrintableString' ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1PrintableStringType class >> validCharacters [ ^ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ''()+,-./:=?' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1PrintableStringType >> accept: aVisitor [ ^ aVisitor visitPrintableString: self ] diff --git a/ASN1-Model/ASN1SequenceType.class.st b/ASN1-Model/ASN1SequenceType.class.st index 24395dc..f03cc11 100644 --- a/ASN1-Model/ASN1SequenceType.class.st +++ b/ASN1-Model/ASN1SequenceType.class.st @@ -1,30 +1,31 @@ Class { - #name : #ASN1SequenceType, - #superclass : #ASN1CollectionType, - #category : 'ASN1-Model' + #name : 'ASN1SequenceType', + #superclass : 'ASN1CollectionType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1SequenceType class >> universalType [ ^ 'SEQUENCE' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1SequenceType >> accept: aVisitor [ ^ aVisitor visitSequenceType: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1SequenceType >> keys [ ^ elements keys reject: [ :each | each = #extensionMarker ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1SequenceType >> tag [ ^ self universalTag ] -{ #category : #validating } +{ #category : 'validating' } ASN1SequenceType >> validate: anObject [ elements associations do: [ :binding | | fieldType | binding isExtension ifFalse: [ diff --git a/ASN1-Model/ASN1SequenceValue.class.st b/ASN1-Model/ASN1SequenceValue.class.st index ee505f6..3fafa99 100644 --- a/ASN1-Model/ASN1SequenceValue.class.st +++ b/ASN1-Model/ASN1SequenceValue.class.st @@ -1,18 +1,19 @@ Class { - #name : #ASN1SequenceValue, - #superclass : #ASN1ValueObject, + #name : 'ASN1SequenceValue', + #superclass : 'ASN1ValueObject', #instVars : [ 'elements' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1SequenceValue >> elements [ ^ elements ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1SequenceValue >> elements: anObject [ elements := anObject ] diff --git a/ASN1-Model/ASN1SetType.class.st b/ASN1-Model/ASN1SetType.class.st index 99fe906..b221b52 100644 --- a/ASN1-Model/ASN1SetType.class.st +++ b/ASN1-Model/ASN1SetType.class.st @@ -1,33 +1,34 @@ Class { - #name : #ASN1SetType, - #superclass : #ASN1ConstructedType, + #name : 'ASN1SetType', + #superclass : 'ASN1ConstructedType', #instVars : [ 'elements' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1SetType >> accept: aVisitor [ aVisitor visitSet: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1SetType >> elements [ ^ elements ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1SetType >> elements: anElementsSpec [ elements := anElementsSpec ] -{ #category : #finding } +{ #category : 'finding' } ASN1SetType >> findElement: aBlock [ ^ elements findElement: aBlock ] -{ #category : #testing } +{ #category : 'testing' } ASN1SetType >> includes: aType [ ^ elements notNil and: [ elements includes: aType ] ] diff --git a/ASN1-Model/ASN1TaggedType.class.st b/ASN1-Model/ASN1TaggedType.class.st index eb5432b..1297000 100644 --- a/ASN1-Model/ASN1TaggedType.class.st +++ b/ASN1-Model/ASN1TaggedType.class.st @@ -1,71 +1,72 @@ Class { - #name : #ASN1TaggedType, - #superclass : #ASN1EncodedType, + #name : 'ASN1TaggedType', + #superclass : 'ASN1EncodedType', #instVars : [ 'type', 'tag' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #visiting } +{ #category : 'visiting' } ASN1TaggedType >> accept: aVisitor [ ^aVisitor visitTaggedType: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> asn1ValueClass [ ^ ASN1TaggedValue ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> basicType [ ^ type basicType ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> elementAt: aString ifNone: aBlock [ ^ type elementAt: aString ifNone: aBlock ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1TaggedType >> newBaseValue: anObject [ ^ self newValue: anObject ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1TaggedType >> newValue [ ^ super newValue value: type newValue ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1TaggedType >> newValue: anObject [ ^ super newValue value: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> tag [ ^ tag ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> tag: anObject [ tag := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> type [ ^ type ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedType >> type: anObject [ type := anObject ] -{ #category : #validating } +{ #category : 'validating' } ASN1TaggedType >> validate: anObject [ type validate: anObject ] diff --git a/ASN1-Model/ASN1TaggedValue.class.st b/ASN1-Model/ASN1TaggedValue.class.st index 12574b2..a0d5e15 100644 --- a/ASN1-Model/ASN1TaggedValue.class.st +++ b/ASN1-Model/ASN1TaggedValue.class.st @@ -1,28 +1,29 @@ Class { - #name : #ASN1TaggedValue, - #superclass : #ASN1ValueObject, + #name : 'ASN1TaggedValue', + #superclass : 'ASN1ValueObject', #instVars : [ 'value' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> at: aKey [ ^ value at: aKey ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> at: aKey put: anObject [ value at: aKey put: anObject ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> baseValue [ ^ value baseValue ] -{ #category : #'error handling' } +{ #category : 'error handling' } ASN1TaggedValue >> doesNotUnderstand: aMessage [ "delegate method calls to value but prevent accidentially unwrapping types. When we get back the wrapped type we assume we can return self" @@ -33,32 +34,32 @@ ASN1TaggedValue >> doesNotUnderstand: aMessage [ ifFalse: [ returnValue ] ] -{ #category : #initializing } +{ #category : 'initializing' } ASN1TaggedValue >> initializeFrom: anObject [ value initializeFrom: anObject ] -{ #category : #testing } +{ #category : 'testing' } ASN1TaggedValue >> isAsn1Composite [ ^ value isAsn1Composite ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> size [ ^ value size ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> tagByteValue [ ^(Array streamContents: [:str | self tag writeOn: str constructed: self isConstructed] ) first ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TaggedValue >> value: anObject [ anObject ifNil: [ Error signal: 'cannot use nil as value' ]. value := anObject diff --git a/ASN1-Model/ASN1TeletexStringType.class.st b/ASN1-Model/ASN1TeletexStringType.class.st index 5f15ba2..1dec696 100644 --- a/ASN1-Model/ASN1TeletexStringType.class.st +++ b/ASN1-Model/ASN1TeletexStringType.class.st @@ -1,29 +1,30 @@ Class { - #name : #ASN1TeletexStringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1TeletexStringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1TeletexStringType class >> decode: aByteArray [ self flag: #needsRedsign. "decode as latin-1 although teletex is encoded with T.61" ^ aByteArray asString convertFromEncoding: 'latin-1' ] -{ #category : #codec } +{ #category : 'codec' } ASN1TeletexStringType class >> encode: aString [ self flag: #needsRedesign. "this is a quick hack to enable teletex strings. The string is not really latin-1 encoding" ^ aString convertToEncoding: 'latin-1' ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TeletexStringType class >> universalType [ ^ 'TeletexString' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1TeletexStringType >> accept: aVisitor [ ^ aVisitor visitTeletexString: self ] diff --git a/ASN1-Model/ASN1TypeObject.class.st b/ASN1-Model/ASN1TypeObject.class.st index f827854..4471c82 100644 --- a/ASN1-Model/ASN1TypeObject.class.st +++ b/ASN1-Model/ASN1TypeObject.class.st @@ -1,48 +1,49 @@ Class { - #name : #ASN1TypeObject, - #superclass : #ASN1DefinitionObject, + #name : 'ASN1TypeObject', + #superclass : 'ASN1DefinitionObject', #instVars : [ 'valueFactory' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1TypeObject class >> defaultValueFactory [ ^ [ :type | type asn1ValueClass new ] ] -{ #category : #creating } +{ #category : 'creating' } ASN1TypeObject class >> newValue [ ^ self new newValue ] -{ #category : #validating } +{ #category : 'validating' } ASN1TypeObject >> acceptsType: anObject [ ^ self class = anObject class ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypeObject >> asAsn1Type [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypeObject >> asAsn1TypeIn: aContext [ ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypeObject >> asn1ValueClass [ self shouldBeImplemented ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypeObject >> basicType [ ^ self ] -{ #category : #finding } +{ #category : 'finding' } ASN1TypeObject >> findTypeWithKey: aString [ ^ ASN1FindByKeyVisitor new key: aString; @@ -50,27 +51,27 @@ ASN1TypeObject >> findTypeWithKey: aString [ object ] -{ #category : #testing } +{ #category : 'testing' } ASN1TypeObject >> isAsn1ExternalType [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } ASN1TypeObject >> isAsn1Type [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } ASN1TypeObject >> isOptional [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } ASN1TypeObject >> matchesValue: aValue [ ^ aValue matchesType: self ] -{ #category : #'instance-creation' } +{ #category : 'instance-creation' } ASN1TypeObject >> newValue [ valueFactory ifNil: [ ^ (self class defaultValueFactory value: self) @@ -84,18 +85,18 @@ ASN1TypeObject >> newValue [ Error signal: 'only Class and BlockClosure are supported as valueFactory' ] -{ #category : #validating } +{ #category : 'validating' } ASN1TypeObject >> validate: anObject [ (self acceptsValue: anObject) ifFalse: [ Error signal: 'type classes do not match' ] ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypeObject >> valueFactory [ ^ valueFactory ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypeObject >> valueFactory: anObject [ valueFactory := anObject ] diff --git a/ASN1-Model/ASN1TypedCollectionType.class.st b/ASN1-Model/ASN1TypedCollectionType.class.st index d490b4e..05ad0cb 100644 --- a/ASN1-Model/ASN1TypedCollectionType.class.st +++ b/ASN1-Model/ASN1TypedCollectionType.class.st @@ -1,34 +1,35 @@ Class { - #name : #ASN1TypedCollectionType, - #superclass : #ASN1ConstructedType, + #name : 'ASN1TypedCollectionType', + #superclass : 'ASN1ConstructedType', #instVars : [ 'type' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'instance-creation' } +{ #category : 'instance-creation' } ASN1TypedCollectionType class >> type: aType [ ^ self new type: aType ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypedCollectionType >> asn1ValueClass [ ^ ASN1AdaptiveTypeCollection ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1TypedCollectionType >> dispatchInstanceCreationOn: anObjectFactory [ ^ type new ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypedCollectionType >> type [ ^ type ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1TypedCollectionType >> type: anObject [ type := anObject ] diff --git a/ASN1-Model/ASN1TypedSequenceType.class.st b/ASN1-Model/ASN1TypedSequenceType.class.st index 8a51870..a64102d 100644 --- a/ASN1-Model/ASN1TypedSequenceType.class.st +++ b/ASN1-Model/ASN1TypedSequenceType.class.st @@ -1,25 +1,26 @@ Class { - #name : #ASN1TypedSequenceType, - #superclass : #ASN1TypedCollectionType, - #category : 'ASN1-Model' + #name : 'ASN1TypedSequenceType', + #superclass : 'ASN1TypedCollectionType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1TypedSequenceType class >> universalType [ ^ 'SEQUENCE' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1TypedSequenceType >> accept: aVisitor [ ^ aVisitor visitTypedSequence: self ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1TypedSequenceType >> tag [ ^ self universalTag ] -{ #category : #validating } +{ #category : 'validating' } ASN1TypedSequenceType >> validate: aCollection [ ] diff --git a/ASN1-Model/ASN1TypedSetType.class.st b/ASN1-Model/ASN1TypedSetType.class.st index f03abd9..2ce0190 100644 --- a/ASN1-Model/ASN1TypedSetType.class.st +++ b/ASN1-Model/ASN1TypedSetType.class.st @@ -1,15 +1,16 @@ Class { - #name : #ASN1TypedSetType, - #superclass : #ASN1TypedCollectionType, - #category : 'ASN1-Model' + #name : 'ASN1TypedSetType', + #superclass : 'ASN1TypedCollectionType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1TypedSetType class >> universalType [ ^ 'SET' ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1TypedSetType >> accept: aVisitor [ ^ aVisitor visitTypedSet: self ] diff --git a/ASN1-Model/ASN1UTCTimeType.class.st b/ASN1-Model/ASN1UTCTimeType.class.st index c46a41c..752599d 100644 --- a/ASN1-Model/ASN1UTCTimeType.class.st +++ b/ASN1-Model/ASN1UTCTimeType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1UTCTimeType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1UTCTimeType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1UTCTimeType class >> decode: anObject [ | stream year | stream := anObject asString readStream. @@ -22,7 +23,7 @@ ASN1UTCTimeType class >> decode: anObject [ ] -{ #category : #codec } +{ #category : 'codec' } ASN1UTCTimeType class >> encode: aDateAndTime [ | date | date := aDateAndTime asUTC. @@ -37,7 +38,7 @@ ASN1UTCTimeType class >> encode: aDateAndTime [ stream nextPut: $Z ] ] -{ #category : #reading } +{ #category : 'reading' } ASN1UTCTimeType class >> readNumberDigits: aNumber from: aStream [ | value | value := 0. @@ -46,12 +47,12 @@ ASN1UTCTimeType class >> readNumberDigits: aNumber from: aStream [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1UTCTimeType class >> universalType [ ^ 'UTCTime' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1UTCTimeType >> accept: aVisitor [ ^ aVisitor visitUTCTimeType: self ] diff --git a/ASN1-Model/ASN1UTF8StringType.class.st b/ASN1-Model/ASN1UTF8StringType.class.st index b86e39b..5fb691f 100644 --- a/ASN1-Model/ASN1UTF8StringType.class.st +++ b/ASN1-Model/ASN1UTF8StringType.class.st @@ -1,25 +1,26 @@ Class { - #name : #ASN1UTF8StringType, - #superclass : #ASN1PrimitiveType, - #category : #'ASN1-Model' + #name : 'ASN1UTF8StringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1UTF8StringType class >> decode: aByteArray [ ^aByteArray utf8Decoded ] -{ #category : #codec } +{ #category : 'codec' } ASN1UTF8StringType class >> encode: aString [ ^ aString utf8Encoded ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1UTF8StringType class >> universalType [ ^ 'UTF8String' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1UTF8StringType >> accept: aVisitor [ ^ aVisitor visitPrintableString: self ] diff --git a/ASN1-Model/ASN1Union.class.st b/ASN1-Model/ASN1Union.class.st index a700596..46a3c28 100644 --- a/ASN1-Model/ASN1Union.class.st +++ b/ASN1-Model/ASN1Union.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1Union, - #superclass : #ASN1ElementCollection, - #category : 'ASN1-Model' + #name : 'ASN1Union', + #superclass : 'ASN1ElementCollection', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #testing } +{ #category : 'testing' } ASN1Union >> includes: aType [ ^ elements anySatisfy: [ :each| each includes: aType ] ] diff --git a/ASN1-Model/ASN1UniversalStringType.class.st b/ASN1-Model/ASN1UniversalStringType.class.st index cd1b808..1fb7b6a 100644 --- a/ASN1-Model/ASN1UniversalStringType.class.st +++ b/ASN1-Model/ASN1UniversalStringType.class.st @@ -1,10 +1,11 @@ Class { - #name : #ASN1UniversalStringType, - #superclass : #ASN1PrimitiveType, - #category : 'ASN1-Model' + #name : 'ASN1UniversalStringType', + #superclass : 'ASN1PrimitiveType', + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #codec } +{ #category : 'codec' } ASN1UniversalStringType class >> decode: aByteArray [ | byteStream | byteStream := aByteArray readStream. @@ -13,7 +14,7 @@ ASN1UniversalStringType class >> decode: aByteArray [ stream nextPut: (Character value: (byteStream next: 4) asInteger) ] ] ] -{ #category : #codec } +{ #category : 'codec' } ASN1UniversalStringType class >> encode: aString [ ^ ByteArray streamContents: [ :stream | aString do: [ :character | @@ -24,12 +25,12 @@ ASN1UniversalStringType class >> encode: aString [ ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1UniversalStringType class >> universalType [ ^ 'UniversalString' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1UniversalStringType >> accept: aVisitor [ ^ aVisitor visitPrintableString: self ] diff --git a/ASN1-Model/ASN1UnresolvedOid.class.st b/ASN1-Model/ASN1UnresolvedOid.class.st index 8c63966..64215d5 100644 --- a/ASN1-Model/ASN1UnresolvedOid.class.st +++ b/ASN1-Model/ASN1UnresolvedOid.class.st @@ -1,35 +1,37 @@ Class { - #name : #ASN1UnresolvedOid, - #superclass : #Exception, + #name : 'ASN1UnresolvedOid', + #superclass : 'Exception', #instVars : [ 'oid' ], - #category : 'ASN1-Model-Exception' + #category : 'ASN1-Model-Exception', + #package : 'ASN1-Model', + #tag : 'Exception' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1UnresolvedOid class >> oid: aString [ ^ self new oid: aString ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1UnresolvedOid >> defaultAction [ UnhandledError signalForException: self ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1UnresolvedOid >> oid [ ^ oid ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1UnresolvedOid >> oid: aString [ oid := aString ] -{ #category : #printing } +{ #category : 'printing' } ASN1UnresolvedOid >> printOn: aStream [ super printOn: aStream. aStream nextPut: Character space. diff --git a/ASN1-Model/ASN1ValidatingVisitor.class.st b/ASN1-Model/ASN1ValidatingVisitor.class.st index 896016f..687fe88 100644 --- a/ASN1-Model/ASN1ValidatingVisitor.class.st +++ b/ASN1-Model/ASN1ValidatingVisitor.class.st @@ -1,18 +1,20 @@ Class { - #name : #ASN1ValidatingVisitor, - #superclass : #ASN1ModelVisitor, + #name : 'ASN1ValidatingVisitor', + #superclass : 'ASN1ModelVisitor', #instVars : [ 'value' ], - #category : 'ASN1-Model-Visitor' + #category : 'ASN1-Model-Visitor', + #package : 'ASN1-Model', + #tag : 'Visitor' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ValidatingVisitor >> validate: anObject [ self validateType: anObject type value: anObject ] -{ #category : #validating } +{ #category : 'validating' } ASN1ValidatingVisitor >> validateType: aType value: aValue [ | oldValue | oldValue := value. @@ -21,7 +23,7 @@ ASN1ValidatingVisitor >> validateType: aType value: aValue [ ensure: [ value := oldValue ] ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ValidatingVisitor >> visitChoiceType: aChoice [ (value size = 1) ifFalse: [ @@ -34,12 +36,12 @@ ASN1ValidatingVisitor >> visitChoiceType: aChoice [ ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ValidatingVisitor >> visitPrimitiveType: aPrimitive [ aPrimitive validate: value ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ValidatingVisitor >> visitSequenceType: aSequence [ aSequence elements do: [ :binding | | fieldType | binding isExtension ifFalse: [ diff --git a/ASN1-Model/ASN1ValueObject.class.st b/ASN1-Model/ASN1ValueObject.class.st index 68c9cd5..c31a85f 100644 --- a/ASN1-Model/ASN1ValueObject.class.st +++ b/ASN1-Model/ASN1ValueObject.class.st @@ -1,84 +1,85 @@ Class { - #name : #ASN1ValueObject, - #superclass : #ASN1DefinitionObject, + #name : 'ASN1ValueObject', + #superclass : 'ASN1DefinitionObject', #instVars : [ 'type' ], - #category : 'ASN1-Model' + #category : 'ASN1-Model', + #package : 'ASN1-Model' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1ValueObject class >> asAsn1ValueIn: aType [ ^ self newIn: aType ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } ASN1ValueObject class >> newIn: aContext [ ^ (aContext typeNamed: self asn1TypeName) newValue ] -{ #category : #converting } +{ #category : 'converting' } ASN1ValueObject >> asExternalValue: anOid [ ^ ASN1AdaptiveTypeExternal new oid: anOid; value: self ] -{ #category : #converting } +{ #category : 'converting' } ASN1ValueObject >> basicEncodeToByteArray [ ^ ByteArray streamContents: [ :stream | self writeEncodedValuesOn: stream ] ] -{ #category : #converting } +{ #category : 'converting' } ASN1ValueObject >> encodeToByteArray [ ^ self modelRoot resolveOidsWhile: [ self basicEncodeToByteArray ] ] -{ #category : #initialize } +{ #category : 'initialize' } ASN1ValueObject >> initializeFrom: anObject [ ] -{ #category : #testing } +{ #category : 'testing' } ASN1ValueObject >> isAsn1Value [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } ASN1ValueObject >> matchesType: aType [ ^ self isKindOf: aType asn1ValueClass ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ValueObject >> modelRoot [ ^ type modelRoot ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ValueObject >> type [ ^ type ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ValueObject >> type: anObject [ type := anObject ] -{ #category : #validating } +{ #category : 'validating' } ASN1ValueObject >> validate [ ] -{ #category : #validating } +{ #category : 'validating' } ASN1ValueObject >> validateVisitor [ ^ ASN1ValidatingVisitor new validate: self ] -{ #category : #converting } +{ #category : 'converting' } ASN1ValueObject >> writeEncodedValuesOn: aStream [ ^ ASN1 write: self diff --git a/ASN1-Model/Boolean.extension.st b/ASN1-Model/Boolean.extension.st index fd47fd8..09f4482 100644 --- a/ASN1-Model/Boolean.extension.st +++ b/ASN1-Model/Boolean.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Boolean } +Extension { #name : 'Boolean' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Boolean >> asn1TypeClass [ ^ ASN1BooleanType ] diff --git a/ASN1-Model/ByteArray.extension.st b/ASN1-Model/ByteArray.extension.st index c229c5d..a9fed1b 100644 --- a/ASN1-Model/ByteArray.extension.st +++ b/ASN1-Model/ByteArray.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ByteArray } +Extension { #name : 'ByteArray' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } ByteArray >> asAsn1HexString [ ^ self asByteArray hex asUppercase ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } ByteArray >> asn1TypeClass [ ^ ASN1OctetStringType ] diff --git a/ASN1-Model/ByteString.extension.st b/ASN1-Model/ByteString.extension.st index 4183b32..54cd394 100644 --- a/ASN1-Model/ByteString.extension.st +++ b/ASN1-Model/ByteString.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ByteString } +Extension { #name : 'ByteString' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } ByteString >> byteArrayFromHex [ ^ ByteArray readHexFrom: (self size even ifTrue: [ self ] diff --git a/ASN1-Model/HashedCollection.extension.st b/ASN1-Model/HashedCollection.extension.st index 4066c38..d97c0ae 100644 --- a/ASN1-Model/HashedCollection.extension.st +++ b/ASN1-Model/HashedCollection.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #HashedCollection } +Extension { #name : 'HashedCollection' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } HashedCollection >> asn1TypeClass [ ^ ASN1AdaptiveTypeObject ] diff --git a/ASN1-Model/Magnitude.extension.st b/ASN1-Model/Magnitude.extension.st index 58b4bdf..3780895 100644 --- a/ASN1-Model/Magnitude.extension.st +++ b/ASN1-Model/Magnitude.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Magnitude } +Extension { #name : 'Magnitude' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Magnitude >> isAsn1Object [ ^ false ] diff --git a/ASN1-Model/Number.extension.st b/ASN1-Model/Number.extension.st index 0e56f2a..9575611 100644 --- a/ASN1-Model/Number.extension.st +++ b/ASN1-Model/Number.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Number } +Extension { #name : 'Number' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Number >> asn1TypeClass [ ^ ASN1IntegerType ] diff --git a/ASN1-Model/Object.extension.st b/ASN1-Model/Object.extension.st index 42fcce1..f196aaa 100644 --- a/ASN1-Model/Object.extension.st +++ b/ASN1-Model/Object.extension.st @@ -1,46 +1,46 @@ -Extension { #name : #Object } +Extension { #name : 'Object' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> asAsn1Value [ ^ self asn1TypeClass new newValue: self ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> definesOid: aString [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1 [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1Composite [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1Object [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1Primitive [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1PrimitiveValue [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1Type [ ^ false ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } Object >> isAsn1Value [ ^ false ] diff --git a/ASN1-Model/String.extension.st b/ASN1-Model/String.extension.st index 732759f..fc903b1 100644 --- a/ASN1-Model/String.extension.st +++ b/ASN1-Model/String.extension.st @@ -1,37 +1,37 @@ -Extension { #name : #String } +Extension { #name : 'String' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asAsn1Oid [ ^ ASN1ObjectIdentifier contents: self ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asAsn1Type [ ^ self asAsn1TypeIn: ASN1CurrentContext value ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asAsn1TypeIn: aContext [ ^ (aContext typeNamed: self) ifNil: [ NotFound signal: 'cannot find type ', self ] ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asAsn1ValueTypedIn: aContext [ ^ (self asAsn1TypeIn: aContext) newValue ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asn1Denormalized [ ^ self replaceAll: $_ with: $- ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asn1Normalized [ ^ self replaceAll: $- with: $_ ] -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } String >> asn1TypeClass [ ^ ASN1OctetStringType ] diff --git a/ASN1-Model/UndefinedObject.extension.st b/ASN1-Model/UndefinedObject.extension.st index 2dd7e01..fc9b7a7 100644 --- a/ASN1-Model/UndefinedObject.extension.st +++ b/ASN1-Model/UndefinedObject.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #UndefinedObject } +Extension { #name : 'UndefinedObject' } -{ #category : #'*asn1-model' } +{ #category : '*asn1-model' } UndefinedObject >> asn1TypeClass [ ^ ASN1NullType ] diff --git a/ASN1-Model/package.st b/ASN1-Model/package.st index ece35b7..a54c5fc 100644 --- a/ASN1-Model/package.st +++ b/ASN1-Model/package.st @@ -1 +1 @@ -Package { #name : #'ASN1-Model' } +Package { #name : 'ASN1-Model' } diff --git a/ASN1-Tool/ASN1.extension.st b/ASN1-Tool/ASN1.extension.st index 99aa3dc..efcd142 100644 --- a/ASN1-Tool/ASN1.extension.st +++ b/ASN1-Tool/ASN1.extension.st @@ -1,17 +1,17 @@ -Extension { #name : #ASN1 } +Extension { #name : 'ASN1' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> defaultModule [ self subclassResponsibility ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> encodeToByteArray: anObject usingModule: aModule [ ^ aModule encodeToByteArray: anObject ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> encodeToByteArray: aValue usingType: aType [ ^ ByteArray streamContents: [:stream| self @@ -20,24 +20,24 @@ ASN1 class >> encodeToByteArray: aValue usingType: aType [ usingType: aType] ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> octetStringFrom: anEncodedValue withTagNumber: aNumber [ ^ (anEncodedValue valueWithTag: ( ASN1Tag clazz: 'APPLICATION' number: aNumber)) ifNotNil: [ :value | ASN1OctetStringType decode: value contents ] ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingModule: aModule [ ^ aModule read: anEncodedValue ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingModule: aModule inContext: aContext [ ^ aModule read: anEncodedValue inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType [ ^ self read: anEncodedValue @@ -45,7 +45,7 @@ ASN1 class >> read: anEncodedValue usingType: aType [ inContext: nil ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType as: aClass [ ^ self read: anEncodedValue @@ -54,7 +54,7 @@ ASN1 class >> read: anEncodedValue usingType: aType as: aClass [ as: aClass ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext [ ^ self read: anEncodedValue @@ -63,7 +63,7 @@ ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext [ as: nil ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext as: aClass [ ^self read: anEncodedValue @@ -73,7 +73,7 @@ ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext as: aCla as: aClass ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext skipErrors: aBoolean [ ^ self read: anEncodedValue @@ -83,7 +83,7 @@ ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext skipErro as: nil ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext skipErrors: aBoolean as: aClass [ ^ self read: anEncodedValue @@ -95,7 +95,7 @@ ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext skipErro ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext skipErrors: aBoolean as: aClass reader: aVisitor [ ^ [ aVisitor skipErrors: (aBoolean ifNil: [ false ]); @@ -106,14 +106,14 @@ ASN1 class >> read: anEncodedValue usingType: aType inContext: aContext skipErro ifNotNil: [ aContext moduleDefiningOid: err oid ] ) ] ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readFrom: aStream [ ^ self readFrom: aStream readStream usingModule: self defaultModule ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readFrom: aStream inContext: aContext [ ^ self readFrom: aStream readStream @@ -121,17 +121,17 @@ ASN1 class >> readFrom: aStream inContext: aContext [ inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readFrom: aStream usingModule: aModule [ ^ aModule readFrom: aStream ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readFrom: aStream usingModule: aModule inContext: aContext [ ^ aModule readFrom: aStream inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readFrom: aStream usingType: aType [ ^ self readFrom: aStream @@ -140,7 +140,7 @@ ASN1 class >> readFrom: aStream usingType: aType [ ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readFrom: aStream usingType: aType inContext: aContext [ ^ self read: (self readEncodedValuesFrom: aStream) @@ -148,35 +148,35 @@ ASN1 class >> readFrom: aStream usingType: aType inContext: aContext [ inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> readVisitorClass [ ^ ASN1ReadVisitor ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> write: anObject on: aStream usingType: aType [ self writeEncodedValues: ( self write: anObject usingType: aType ) on: aStream ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> write: anObject usingModule: aModule [ ^ aModule write: anObject ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> write: anObject usingType: aType [ ^ self writeVisitorClass new write: anObject using: aType. ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> writeEncodedValues: aTaggedValue on: aStream [ (self codecStreamClass on: aStream) nextPut: aTaggedValue ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1 class >> writeVisitorClass [ ^ ASN1WriteVisitor ] diff --git a/ASN1-Tool/ASN1ChoiceType.extension.st b/ASN1-Tool/ASN1ChoiceType.extension.st index 3274b67..934203e 100644 --- a/ASN1-Tool/ASN1ChoiceType.extension.st +++ b/ASN1-Tool/ASN1ChoiceType.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #ASN1ChoiceType } +Extension { #name : 'ASN1ChoiceType' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ChoiceType >> decodeTaggedValue: aTaggedValue tagEnvironment: aTagEnvironment [ "choices are always explicit" ^ ASN1ExplicitTags readEncodedValue: aTaggedValue ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ChoiceType >> encodeTaggedValue: aTaggedValue tagEnvironment: aTagEnvironment outerTag: aTag [ "choices are always explicit" diff --git a/ASN1-Tool/ASN1DefinitionObject.extension.st b/ASN1-Tool/ASN1DefinitionObject.extension.st index 1ef8f21..4f1b54b 100644 --- a/ASN1-Tool/ASN1DefinitionObject.extension.st +++ b/ASN1-Tool/ASN1DefinitionObject.extension.st @@ -1,20 +1,20 @@ -Extension { #name : #ASN1DefinitionObject } +Extension { #name : 'ASN1DefinitionObject' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1DefinitionObject >> encodeToByteArray: anEncodedObject [ ^ ASN1 encodeToByteArray: anEncodedObject usingType: self ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1DefinitionObject >> read: anEncodedValue [ ^ ASN1 read: anEncodedValue usingType: self ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1DefinitionObject >> read: anEncodedValue as: aClass [ ^ ASN1 read: anEncodedValue @@ -23,14 +23,14 @@ ASN1DefinitionObject >> read: anEncodedValue as: aClass [ as: aClass ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1DefinitionObject >> readFrom: aStream [ ^ ASN1 readFrom: aStream usingType: self ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1DefinitionObject >> write: anEncodedObject [ ^ ASN1 write: anEncodedObject diff --git a/ASN1-Tool/ASN1ElementNotFound.class.st b/ASN1-Tool/ASN1ElementNotFound.class.st index 1ffbecd..8ada240 100644 --- a/ASN1-Tool/ASN1ElementNotFound.class.st +++ b/ASN1-Tool/ASN1ElementNotFound.class.st @@ -1,10 +1,12 @@ Class { - #name : #ASN1ElementNotFound, - #superclass : #ASN1StructureError, - #category : 'ASN1-Tool-Exception' + #name : 'ASN1ElementNotFound', + #superclass : 'ASN1StructureError', + #category : 'ASN1-Tool-Exception', + #package : 'ASN1-Tool', + #tag : 'Exception' } -{ #category : #testing } +{ #category : 'testing' } ASN1ElementNotFound >> isResumable [ ^ true ] diff --git a/ASN1-Tool/ASN1EncodedType.extension.st b/ASN1-Tool/ASN1EncodedType.extension.st index 32037eb..2b794d4 100644 --- a/ASN1-Tool/ASN1EncodedType.extension.st +++ b/ASN1-Tool/ASN1EncodedType.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ASN1EncodedType } +Extension { #name : 'ASN1EncodedType' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1EncodedType >> decodeTaggedValue: aTaggedValue tagEnvironment: aTagEnvironment [ ^ aTagEnvironment readEncodedValue: aTaggedValue ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1EncodedType >> encodeTaggedValue: aTaggedValue tagEnvironment: aTagEnvironment outerTag: aTag [ ^ aTagEnvironment writeEncodedValue: aTaggedValue withTag: aTag ] diff --git a/ASN1-Tool/ASN1ExplicitTags.extension.st b/ASN1-Tool/ASN1ExplicitTags.extension.st index fc3ee8f..a04924d 100644 --- a/ASN1-Tool/ASN1ExplicitTags.extension.st +++ b/ASN1-Tool/ASN1ExplicitTags.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ASN1ExplicitTags } +Extension { #name : 'ASN1ExplicitTags' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ExplicitTags class >> readEncodedValue: anEncodedValue [ ^ anEncodedValue firstElement ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ExplicitTags class >> writeEncodedValue: anEncodedValue withTag: aTag [ "in explicit mode we add another tag around the current tagged value" ^ ASN1EncodedConstructedValue new diff --git a/ASN1-Tool/ASN1ImplicitTags.extension.st b/ASN1-Tool/ASN1ImplicitTags.extension.st index 01de270..077acee 100644 --- a/ASN1-Tool/ASN1ImplicitTags.extension.st +++ b/ASN1-Tool/ASN1ImplicitTags.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ASN1ImplicitTags } +Extension { #name : 'ASN1ImplicitTags' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ImplicitTags class >> readEncodedValue: anEncodedValue [ ^ anEncodedValue ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ImplicitTags class >> writeEncodedValue: aEncodedValue withTag: aTag [ "in an implicit tag environment the outer tag overwrites the inner tag " diff --git a/ASN1-Tool/ASN1MandatoryElementNotFound.class.st b/ASN1-Tool/ASN1MandatoryElementNotFound.class.st index be5a463..39beadf 100644 --- a/ASN1-Tool/ASN1MandatoryElementNotFound.class.st +++ b/ASN1-Tool/ASN1MandatoryElementNotFound.class.st @@ -1,10 +1,12 @@ Class { - #name : #ASN1MandatoryElementNotFound, - #superclass : #ASN1StructureError, - #category : 'ASN1-Tool-Exception' + #name : 'ASN1MandatoryElementNotFound', + #superclass : 'ASN1StructureError', + #category : 'ASN1-Tool-Exception', + #package : 'ASN1-Tool', + #tag : 'Exception' } -{ #category : #testing } +{ #category : 'testing' } ASN1MandatoryElementNotFound >> isResumable [ ^ true ] diff --git a/ASN1-Tool/ASN1ModelRoot.extension.st b/ASN1-Tool/ASN1ModelRoot.extension.st index 6bd6490..b1697fd 100644 --- a/ASN1-Tool/ASN1ModelRoot.extension.st +++ b/ASN1-Tool/ASN1ModelRoot.extension.st @@ -1,34 +1,34 @@ -Extension { #name : #ASN1ModelRoot } +Extension { #name : 'ASN1ModelRoot' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ModelRoot >> read: aTaggedValue [ ^ self modules first read: aTaggedValue inContext: self ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ModelRoot >> readFrom: anObject usingModule: aModule [ ^ aModule readFrom: anObject readStream inContext: self ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ModelRoot >> readFrom: anObject usingModule: aModule inContext: aContext [ ^ aModule readFrom: anObject readStream inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ModelRoot >> readFrom: anObject usingModuleNamed: aString [ ^ (self moduleNamed: aString) readFrom: anObject readStream inContext: self ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1ModelRoot >> resolveOidsWhile: aBlock [ ^ aBlock on: ASN1UnresolvedOid diff --git a/ASN1-Tool/ASN1Module.extension.st b/ASN1-Tool/ASN1Module.extension.st index e316672..e20f2a1 100644 --- a/ASN1-Tool/ASN1Module.extension.st +++ b/ASN1-Tool/ASN1Module.extension.st @@ -1,18 +1,18 @@ -Extension { #name : #ASN1Module } +Extension { #name : 'ASN1Module' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> encodeToByteArray: anObject [ ^ ASN1 encodeToByteArray: anObject usingType: self pdu ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> read: aTaggedValue [ ^ self read: aTaggedValue inContext: nil ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> read: aTaggedValue inContext: aContext [ ^ ASN1 read: aTaggedValue @@ -20,12 +20,12 @@ ASN1Module >> read: aTaggedValue inContext: aContext [ inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> readFrom: aStream [ ^ self readFrom: aStream inContext: nil ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> readFrom: aStream inContext: aContext [ ^ ASN1 readFrom: aStream @@ -33,14 +33,14 @@ ASN1Module >> readFrom: aStream inContext: aContext [ inContext: aContext ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> write: anObject [ ^ ASN1 write: anObject usingType: self pdu ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1Module >> write: anObject on: aStream [ ^ASN1 write: anObject diff --git a/ASN1-Tool/ASN1ObjectFactory.class.st b/ASN1-Tool/ASN1ObjectFactory.class.st index fc70697..93e3d70 100644 --- a/ASN1-Tool/ASN1ObjectFactory.class.st +++ b/ASN1-Tool/ASN1ObjectFactory.class.st @@ -1,38 +1,40 @@ Class { - #name : #ASN1ObjectFactory, - #superclass : #Object, + #name : 'ASN1ObjectFactory', + #superclass : 'Object', #instVars : [ 'asn1Model' ], - #category : 'ASN1-Tool-Visitor' + #category : 'ASN1-Tool-Visitor', + #package : 'ASN1-Tool', + #tag : 'Visitor' } -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectFactory >> asn1Model [ ^ asn1Model ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectFactory >> asn1Model: aModel [ asn1Model := aModel ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectFactory >> moduleDefiningOid: anOid [ ^ self asn1Model moduleDefiningOid: anOid ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ObjectFactory >> newTypedCollection [ ^ ASN1AdaptiveTypeCollection new ] -{ #category : #creating } +{ #category : 'creating' } ASN1ObjectFactory >> newValueForTypeNamed: aString [ ^ (self asn1Model typeNamed: aString) newValue ] -{ #category : #lookup } +{ #category : 'lookup' } ASN1ObjectFactory >> typeNamed: aString [ ^ self asn1Model typeNamed: aString ] diff --git a/ASN1-Tool/ASN1PrimitiveType.extension.st b/ASN1-Tool/ASN1PrimitiveType.extension.st index 0e3963c..b86d3c2 100644 --- a/ASN1-Tool/ASN1PrimitiveType.extension.st +++ b/ASN1-Tool/ASN1PrimitiveType.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #ASN1PrimitiveType } +Extension { #name : 'ASN1PrimitiveType' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1PrimitiveType >> decodedValue: aByteArray [ ^ self newValue: ( self class decode: aByteArray ) ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1PrimitiveType >> encodedValue: anObject [ ^ ASN1EncodedPrimitiveValue new contents: (self class encode: anObject); diff --git a/ASN1-Tool/ASN1ReadVisitor.class.st b/ASN1-Tool/ASN1ReadVisitor.class.st index 5468952..3851778 100644 --- a/ASN1-Tool/ASN1ReadVisitor.class.st +++ b/ASN1-Tool/ASN1ReadVisitor.class.st @@ -1,15 +1,17 @@ Class { - #name : #ASN1ReadVisitor, - #superclass : #ASN1ModelVisitor, + #name : 'ASN1ReadVisitor', + #superclass : 'ASN1ModelVisitor', #instVars : [ 'skipErrors', 'currentTaggedValue', 'objectFactory' ], - #category : 'ASN1-Tool-Visitor' + #category : 'ASN1-Tool-Visitor', + #package : 'ASN1-Tool', + #tag : 'Visitor' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> checkOptionalAndDefault: anElement with: aCollection [ "check if the element is optional and add default value if available" anElement value isOptional ifFalse: [ @@ -24,50 +26,50 @@ ASN1ReadVisitor >> checkOptionalAndDefault: anElement with: aCollection [ aCollection privAt: anElement key put: anElement value defaultValue value ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> collectionClass [ ^ ASN1AdaptiveTypeCollection ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ReadVisitor >> defaultObjectFactory [ ^ ASN1ObjectFactory new ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ReadVisitor >> defaultValueClass [ ^ ASN1AdaptiveTypeObject ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> error: anError on: anObject [ skipErrors ifTrue: [ ^ anObject ] ifFalse: [ anError signal ] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> externalClass [ ^ ASN1AdaptiveTypeExternal ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } ASN1ReadVisitor >> initialize [ super initialize. skipErrors := false ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ReadVisitor >> objectFactory [ ^ objectFactory ] -{ #category : #acessing } +{ #category : 'acessing' } ASN1ReadVisitor >> objectFactory: anObjectFactory [ objectFactory := anObjectFactory ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> push: taggedValue during: aBlock [ | formerTaggedValue result | taggedValue ifNil: [ Error signal: 'cannot use nil as taggedValue' ]. @@ -78,12 +80,12 @@ ASN1ReadVisitor >> push: taggedValue during: aBlock [ ^ result ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> read: anEncodedType using: aType [ ^ self read: anEncodedType using: aType as: nil ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> read: anEncodedValue using: aType as: aClass [ ^ self @@ -91,27 +93,27 @@ ASN1ReadVisitor >> read: anEncodedValue using: aType as: aClass [ during: [ self visit: aType ] ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> read: anEncodedType usingModule: aModule [ ^ self read: anEncodedType using: aModule pdu as: nil ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1ReadVisitor >> read: anEncodedType usingModule: aModule as: aClass [ ^ self read: anEncodedType using: aModule pdu as: aClass ] -{ #category : #accessing } +{ #category : 'accessing' } ASN1ReadVisitor >> skipErrors: aBoolean [ skipErrors := aBoolean ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitAnyType: anAnyType [ ^ currentTaggedValue contents ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitChoiceType: aChoice [ | slot result value | value := aChoice newValue. @@ -129,7 +131,7 @@ ASN1ReadVisitor >> visitChoiceType: aChoice [ yourself ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitCollection: aCollection [ | value contentStream elementStream isExtended | isExtended := false. @@ -192,7 +194,7 @@ ASN1ReadVisitor >> visitCollection: aCollection [ ^ value ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitEnumeratedType: anEnumerated [ | number namedNumber | self flag: #hack. @@ -208,7 +210,7 @@ ASN1ReadVisitor >> visitEnumeratedType: anEnumerated [ ^ anEnumerated newValue contents: namedNumber name ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitExternalType: anExternalType [ | oid value | value := anExternalType newValue. @@ -235,24 +237,24 @@ ASN1ReadVisitor >> visitExternalType: anExternalType [ ^ value ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitObjectIdentifierType: anObjectIdentifier [ ^ self visitPrimitiveType: anObjectIdentifier ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitOpenType: anOpenType [ "an open type does not specify its kind. So we return the anonymous data. The data needs to be parsed in a second pass" ^ currentTaggedValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitPrimitiveType: aPrimitive [ ^ aPrimitive decodedValue: currentTaggedValue contents ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitTaggedType: aTaggedType [ "resolve the tagging environment over the tagged type because it is defined in the module defining the tagging environment (the type of the tagged type might be imported from another @@ -268,7 +270,7 @@ ASN1ReadVisitor >> visitTaggedType: aTaggedType [ value: basicValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1ReadVisitor >> visitTypedCollection: aCollection [ | seq | seq := self collectionClass new diff --git a/ASN1-Tool/ASN1StructureError.class.st b/ASN1-Tool/ASN1StructureError.class.st index 9a95699..e0aad3f 100644 --- a/ASN1-Tool/ASN1StructureError.class.st +++ b/ASN1-Tool/ASN1StructureError.class.st @@ -1,5 +1,7 @@ Class { - #name : #ASN1StructureError, - #superclass : #Error, - #category : 'ASN1-Tool-Exception' + #name : 'ASN1StructureError', + #superclass : 'Error', + #category : 'ASN1-Tool-Exception', + #package : 'ASN1-Tool', + #tag : 'Exception' } diff --git a/ASN1-Tool/ASN1TagEnvironment.extension.st b/ASN1-Tool/ASN1TagEnvironment.extension.st index f3cf698..a5b441e 100644 --- a/ASN1-Tool/ASN1TagEnvironment.extension.st +++ b/ASN1-Tool/ASN1TagEnvironment.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ASN1TagEnvironment } +Extension { #name : 'ASN1TagEnvironment' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1TagEnvironment class >> encode: anObject using: aType [ self subclassResponsibility ] diff --git a/ASN1-Tool/ASN1TaggedType.extension.st b/ASN1-Tool/ASN1TaggedType.extension.st index b477eff..4b7f9d4 100644 --- a/ASN1-Tool/ASN1TaggedType.extension.st +++ b/ASN1-Tool/ASN1TaggedType.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ASN1TaggedType } +Extension { #name : 'ASN1TaggedType' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1TaggedType >> encodeTaggedValue: aTaggedValue [ "a tagged type consists of an inner tag and an outer tag. While encoding the tag environment indicates if both tags are encoded (explicit) or if @@ -11,7 +11,7 @@ ASN1TaggedType >> encodeTaggedValue: aTaggedValue [ outerTag: tag ] -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } ASN1TaggedType >> readEncodedValue: aTaggedValue [ ^ self type decodeTaggedValue: aTaggedValue diff --git a/ASN1-Tool/ASN1UnexpectedType.class.st b/ASN1-Tool/ASN1UnexpectedType.class.st index 50f1fa4..ce65a78 100644 --- a/ASN1-Tool/ASN1UnexpectedType.class.st +++ b/ASN1-Tool/ASN1UnexpectedType.class.st @@ -1,5 +1,7 @@ Class { - #name : #ASN1UnexpectedType, - #superclass : #ASN1StructureError, - #category : 'ASN1-Tool-Exception' + #name : 'ASN1UnexpectedType', + #superclass : 'ASN1StructureError', + #category : 'ASN1-Tool-Exception', + #package : 'ASN1-Tool', + #tag : 'Exception' } diff --git a/ASN1-Tool/ASN1WriteVisitor.class.st b/ASN1-Tool/ASN1WriteVisitor.class.st index 9f4f27f..90bf356 100644 --- a/ASN1-Tool/ASN1WriteVisitor.class.st +++ b/ASN1-Tool/ASN1WriteVisitor.class.st @@ -1,18 +1,27 @@ Class { - #name : #ASN1WriteVisitor, - #superclass : #ASN1ModelVisitor, + #name : 'ASN1WriteVisitor', + #superclass : 'ASN1ModelVisitor', #instVars : [ - 'currentValue' + 'currentValue', + 'skipAddedDefaults' ], - #category : 'ASN1-Tool-Visitor' + #category : 'ASN1-Tool-Visitor', + #package : 'ASN1-Tool', + #tag : 'Visitor' } -{ #category : #exceptions } +{ #category : 'initialization' } +ASN1WriteVisitor >> initialize [ + super initialize. + skipAddedDefaults := true +] + +{ #category : 'exceptions' } ASN1WriteVisitor >> mandatoryElementNotFound [ ASN1MandatoryElementNotFound signal ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } ASN1WriteVisitor >> push: anObject during: aBlock [ | formerValue | anObject ifNil: [ Error signal: 'cannot push nil onto stack' ]. @@ -21,7 +30,12 @@ ASN1WriteVisitor >> push: anObject during: aBlock [ ^aBlock ensure: [ currentValue := formerValue ] ] -{ #category : #visiting } +{ #category : 'accessing' } +ASN1WriteVisitor >> skipAddedDefaults [ + skipAddedDefaults := true +] + +{ #category : 'visiting' } ASN1WriteVisitor >> visit: aType [ (aType isNil ifTrue: [ Error signal: 'type cannot be nil' ]). "we need either a ASN.1 value object or an already encoded value" @@ -32,7 +46,7 @@ ASN1WriteVisitor >> visit: aType [ ^ super visit: aType ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitChoiceType: aChoice [ | key type | key := currentValue keys first. @@ -42,13 +56,13 @@ ASN1WriteVisitor >> visitChoiceType: aChoice [ during: [ self visit: type ]. ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitEnumeratedType: anEnumerated [ ^ currentValue encodedValue ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitExternalType: anExternalType [ | encoded module | encoded := ASN1EncodedConstructedValue new @@ -67,13 +81,13 @@ ASN1WriteVisitor >> visitExternalType: anExternalType [ ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitObjectIdentifierType: anObjectIdentifier [ ^ anObjectIdentifier encodedValue: currentValue contents. ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitOpenType: anOpenType [ self flag: #hack. "oid := ASN1OpenTypeDefinition signal." @@ -84,13 +98,13 @@ ASN1WriteVisitor >> visitOpenType: anOpenType [ during: [self visit: currentValue type ] ] ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitPrimitiveType: aPrimitiveType [ (currentValue type class = aPrimitiveType class) ifFalse: [ Error signal: 'primitive types do not match' ]. ^ currentValue encodedValue "aPrimitive encodedValue: currentValue value" ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitSequenceType: aSequence [ | encoded object | encoded := ASN1EncodedConstructedValue new @@ -99,22 +113,23 @@ ASN1WriteVisitor >> visitSequenceType: aSequence [ object := currentValue "basicValue". aSequence elements associations do: [ :each | (each value class = ASN1Extension) ifFalse: [ - (object includesKey: each key) - ifTrue: [ - self - push: (object privAt: each key) - during: [ encoded elements add: (self visit: (aSequence elementAt: each key)) ]] - ifFalse: [ - each value isOptional - ifTrue: [ each value hasDefaultValue ifTrue: [ - self - push: each value defaultValue - during: [ encoded elements add: (self visit: (aSequence elementAt: each key) value) ] ] ] - ifFalse: [ self mandatoryElementNotFound ] ] ] ]. + (skipAddedDefaults and: [ object wasAddedByDefault: each key ]) ifFalse: [ + (object includesKey: each key) + ifTrue: [ + self + push: (object privAt: each key) + during: [ encoded elements add: (self visit: (aSequence elementAt: each key)) ]] + ifFalse: [ + each value isOptional + ifTrue: [ each value hasDefaultValue ifTrue: [ + self + push: each value defaultValue + during: [ encoded elements add: (self visit: (aSequence elementAt: each key) defaultValue type ) ] ] ] + ifFalse: [ self mandatoryElementNotFound ] ] ] ] ]. ^ encoded ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitTaggedType: aTaggedType [ "tag the type based on the existance of an explicit tag and itsaTaggedType tag environment" @@ -124,7 +139,7 @@ ASN1WriteVisitor >> visitTaggedType: aTaggedType [ during: [ self visit: aTaggedType type ]) ] -{ #category : #visiting } +{ #category : 'visiting' } ASN1WriteVisitor >> visitTypedCollection: aTypedSequence [ "All elements that are on the top of the stack are encoded with the type of the typed sequence" @@ -138,14 +153,14 @@ ASN1WriteVisitor >> visitTypedCollection: aTypedSequence [ ^ encoded ] -{ #category : #writing } +{ #category : 'writing' } ASN1WriteVisitor >> write: anObject using: anAsn1Type [ currentValue := anObject. ^ self visit: anAsn1Type ] -{ #category : #writing } +{ #category : 'writing' } ASN1WriteVisitor >> write: anObject usingModule: aModule [ currentValue := anObject. ^ self visit: aModule pdu diff --git a/ASN1-Tool/Object.extension.st b/ASN1-Tool/Object.extension.st index 20d081c..7774404 100644 --- a/ASN1-Tool/Object.extension.st +++ b/ASN1-Tool/Object.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Object } +Extension { #name : 'Object' } -{ #category : #'*asn1-tool' } +{ #category : '*asn1-tool' } Object >> basicValue [ ^ self ] diff --git a/ASN1-Tool/package.st b/ASN1-Tool/package.st index bc9851b..1f1ed1e 100644 --- a/ASN1-Tool/package.st +++ b/ASN1-Tool/package.st @@ -1 +1 @@ -Package { #name : #'ASN1-Tool' } +Package { #name : 'ASN1-Tool' }