From VisualWorks®, 7.5 of April 3, 2007 on April 3, 2007 at 1:28:37 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>Type</name> <environment>ASN1</environment> <super>ASN1.Entity</super> <private>false</private> none constraint retainEncoding tag tagging defaultConstraint <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.Type
Asn1Type is an abstract class. Instances of Asn1Type are used to represent the information needed to encode and decode an ASN.1 type and to support the double-dipatch protocol used during 'type-in-hand' encoding or decoding. Subclasses must implement the following messages: encoding tagBER Instance Variables: constraint <Asn1Constraint> the constraint structure delimiting the Asn1Type retainEncoding <Boolean> controls retention of encodings tag <Integer> a specific tag for this type tagging <Symbol> the tagging mode for this type '#implicit', or '#explicit' Class Instance Variables: defaultConstraint <Asn1Constraint> the default constraint for the respective class of types
</comment> <class> <name>ConstructedType</name> <environment>ASN1</environment> <super>ASN1.Type</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ConstructedType
Asn1TypeConstructed is the abstract superclass of the ASN.1 'constructed' types: SEQUENCE, SEQUENCE_OF, SET, SET_OF, and CHOICE. It stands in contrast with Asn1TypeBasic.
</comment> <class> <name>UnstructuredType</name> <environment>ASN1</environment> <super>ASN1.ConstructedType</super> <private>false</private> none elementType <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.UnstructuredType
Asn1TypeUnstructured is an abstract class. It is the superclass of those constructed types that contain unnamed elements of the same type. It is defined in contrast with Asn1TypeStructured. Instance Variables: elementType <Asn1Type> the common type of the contained elements
</comment> <class> <name>SEQUENCE_OF</name> <environment>ASN1</environment> <super>ASN1.UnstructuredType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.SEQUENCE_OF
Asn1TypeSEQUENCE_OF represents the ASN.1 SEQUENCE OF type.
</comment> <class> <name>StructuredType</name> <environment>ASN1</environment> <super>ASN1.ConstructedType</super> <private>false</private> none elements defaultOrOptionalCount extensionMarkerCount minLength <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.StructuredType
Asn1TypeStructured is the abstract superclass of those constructed types that contained named, typed elements. It is defined in contrast to Asn1TypeUnstructured. Instance Variables: defaultOrOptionalCount <Integer> number of elements either with defaults or optional elements <(OrderedCollection of: Asn1Element)> the elements of the structured type extensionMarkerCount <Integer> the number of extension markers among the elements minLength <Integer> the minimum element count
</comment> <class> <name>CHOICE</name> <environment>ASN1</environment> <super>ASN1.StructuredType</super> <private>false</private> none tags useChoice defaultUseChoice <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.CHOICE
Asn1TypeCHOICE represents the ASN.1 CHOICE type. Instance Variables: tags <Set> the tags associated with the elements, used in decoding useChoice <Boolean> should wrap unmarshaled values in Choice instances ? Class Instance Variables: defaultUseChoice <Boolean> should choices unmarshal as Choice instances by default ?
</comment> <class> <name>SubType</name> <environment>ASN1</environment> <super>ASN1.Type</super> <private>false</private> none parent <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.SubType
Asn1SubType denotes types derived from other Asn1Types. Subclasses must implement the following messages: encoding tagBER Instance Variables: parent <Asn1Type> the parent of the Asn1Type
</comment> <class> <name>InvalidTypeReference</name> <environment>ASN1</environment> <super>ASN1.Asn1Error</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.InvalidTypeReference
This exception is raised for type references that cannot be resolved.
</comment> <class> <name>InvalidTypeSpecification</name> <environment>ASN1</environment> <super>ASN1.Asn1Error</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.InvalidTypeSpecification
An Asn1ExcTypeSpecification is raised when an error is detected in the specification of an Asn1Type.
</comment> <class> <name>BasicType</name> <environment>ASN1</environment> <super>ASN1.Type</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.BasicType
Asn1TypeBasic is the abstract superclass of the ASN.1 'basic' types, including the ASN.1 string types. It stands in constrast with Asn1ConstructedType.
</comment> <class> <name>RELATIVE_OID</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.RELATIVE_OID
Asn1TypeRELATIVE_OID represents the ASN.1 RELATIVE OID type.
</comment> <class> <name>NULL</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.NULL
Asn1TypeNULL represents the ASN.1 NULL type.
</comment> <class> <name>ObjectDescriptor</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ObjectDescriptor
Asn1TypeObjectDescriptor represents the ASN.1 ObjectDescriptor type.
</comment> <class> <name>ANY</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none definedBy typeMap <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ANY
Asn1TypeANY represents the ASN.1 ANY type. Instance Variables: definedBy <String | StructureElement> the element used by the DEFINED BY clause typeMap <Dictionary key: Object value: Type> the mapping for the DEFINED BY clause
</comment> <class> <name>ENUMERATED</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none elements extensibleAt useEnumeration complete defaultUseEnumeration <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ENUMERATED
Asn1TypeENUMERATED represents the ASN.1 ENUMERATED type. Instance Variables: elements <(OrderedCollection of: (Association))> the symbol-to-integer mappings that define the enumeration extensibleAt <Integer> the index of element after which there's an extension marker useEnumeration <Boolean> should wrap unmarshaled values in Enumeration instances ? complete <Boolean> private indicator that the type definition is complete and all elements have values Class Instance Variables: defaultUseEnumeration <Boolean> should enumerations unmarshal as Enumeration instances by default ?
</comment> <class> <name>BIT_STRING</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.BIT_STRING
Asn1TypeBIT_STRING represents the ASN.1 BIT STRING type.
</comment> <class> <name>OCTET_STRING</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.OCTET_STRING
Asn1TypeOCTET_STRING represents the ASN.1 OCTET STRING type.
</comment> <class> <name>BOOLEAN</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.BOOLEAN
Asn1TypeBOOLEAN represents the ASN.1 BOOLEAN type.
</comment> <class> <name>REAL</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.REAL
Asn1TypeREAL represents the ASN.1 REAL type.
</comment> <class> <name>StringType</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.StringType
Abstract superclass of all string types.
</comment> <class> <name>UniversalString</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.UniversalString
Asn1TypeUniversalString represents the ASN.1 UniversalString type.
</comment> <class> <name>GeneralString</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.GeneralString
Asn1TypeGeneralString represents the ASN.1 GeneralString type.
</comment> <class> <name>TeletexString</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.TeletexString
Asn1TypeTeletexString represents the ASN.1 TeletexString type.
</comment> <class> <name>BMPString</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.BMPString
Asn1TypeBMPString represents the ASN.1 BMPString type.
</comment> <class> <name>VideotexString</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.VideotexString
Asn1TypeVideotexString represents the ASN.1 VideotexString type.
</comment> <class> <name>UTF8String</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.UTF8String
Asn1TypeUTF8String represents the ASN.1 UTF8String type.
</comment> <class> <name>MappableType</name> <environment>ASN1</environment> <super>ASN1.StructuredType</super> <private>false</private> none mapping <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.MappableType
Asn1TypeMappable is the abstract superclass of those structured, constructed types that can usefully be mapped to user-defined, Smalltalk classes.
</comment> <class> <name>SEQUENCE</name> <environment>ASN1</environment> <super>ASN1.MappableType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.SEQUENCE
Asn1TypeSEQUENCE represents the ASN.1 SEQUENCE type.
</comment> <class> <name>SET</name> <environment>ASN1</environment> <super>ASN1.MappableType</super> <private>false</private> none decodingDictionary encodingDictionary <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.SET
Asn1TypeSET represents the ASN.1 SET type. Note that an ASN.1 SET is not a set in the mathematical sense. It is a SEQUENCE with an unconstrained transmission order. Instance Variables: decodingDictionary <Dictionary> maps element tags to Asn1Elements encodingDictionary <Dictionary> maps element symbols to Asn1Elements
</comment> <class> <name>AbstractElement</name> <environment>ASN1</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.AbstractElement
Asn1AbstractElement is the abstract superclass of the elements found in ASN.1 constructed types and enumerations. This class and its subclasses implement selectors that facilitate the analysis of collections of such elements.
</comment> <class> <name>EnumerationElement</name> <environment>ASN1</environment> <super>ASN1.AbstractElement</super> <private>false</private> none integer symbol explicit <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.EnumerationElement
An Asn1Enumeration represents one of the elements -- like the two in '{ female(0), male(1) }' -- that are found in the definition of ENUMERATEDs. Note that #asAsn1EnumerationElement is implemented (1) in Asn1Enumeration, (2) in Asn1MarkerExtension, because ENUMERATEDs may include extension marker, and (3) in Association, so that Associations may be easily converted. This is not an 'imported' type because it is only used to represent an Asn1Type element, though it is like Asn1ImportedEnumeration, which latter may figure in application-level VisualWorks code. Instance Variables: integer <Integer> the integer part of the element symbol <Symbol> the symbolic part of the element explicit <Boolean> was the integral value assigned automatically or explicitly ?
</comment> <class> <name>MarkerElement</name> <environment>ASN1</environment> <super>ASN1.AbstractElement</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.MarkerElement
Asn1Marker is the abstract superclass of those classes used to represent the special markers defined in ASN.1.
</comment> <class> <name>ExtensionMarker</name> <environment>ASN1</environment> <super>ASN1.MarkerElement</super> <private>false</private> none default <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ExtensionMarker
An Asn1MarkerExtension represents an ASN.1 extension marker. There is only one privileged, default instance. Asn1MarkerExtension implements the selectors 'integer' and 'symbol' both of which return 'nil', so that ENUMERATED element collections -- which can contain extension markers -- may be processed without type checking. Class Instance Variables: default <Asn1MarkerExtension> the sole instance
</comment> <class> <name>ExceptionMarker</name> <environment>ASN1</environment> <super>ASN1.MarkerElement</super> <private>false</private> none integer symbol <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ExceptionMarker
Asn1MarkerException is intended to be used to represent ASN.1 exception markers. It is not currently used. Instance Variables: integer <Integer> the integer error code associated with the exception symbol <Symbol> the name of the exception
</comment> <class> <name>TypeWrapper</name> <environment>ASN1</environment> <super>Protocols.MessageForwarder</super> <private>false</private> none encoding type <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.TypeWrapper
An Asn1TypeWrapper is an optional result of decoding that retains the source encoding, the Asn1Type that regulated the decoding, and the decoded value. Instance Variables: encoding <ByteArray | Asn1Encoding> the encoding of the value type <Asn1Type> the type of the value value <Object> the decoded value
</comment> <class> <name>Choice</name> <environment>ASN1</environment> <super>ASN1.TypeWrapper</super> <private>false</private> none choice <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.Choice
Asn1Choice is an imported type, optionally used to represent ASN.1 CHOICE's in the decoded form of an object. Instance Variables: choice <ChoiceElement> the element representing the chosen alternative
</comment> <class> <name>Enumeration</name> <environment>ASN1</environment> <super>ASN1.TypeWrapper</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.Enumeration
An ImportedEnumeration is an imported type used to represent an ASN.1 ENUMERATED.
</comment> <class> <name>ChoiceElement</name> <environment>ASN1</environment> <super>ASN1.AbstractElement</super> <private>false</private> none owner symbol type <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.ChoiceElement
This is the element found in the definitions of CHOICEs. Instance Variables: owner <StructuredType> the owning type symbol <ByteSymbol> the symbol identifying the element type <Asn1Type> the type of the element
</comment> <class> <name>StructureElement</name> <environment>ASN1</environment> <super>ASN1.ChoiceElement</super> <private>false</private> none default optional <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.StructureElement
StructureElement implements the elements found in the definitions of constructed types SET and SEQUENCE. It adds the notion of OPTIONAL and DEFAULT. Note that an element cannot be both OPTIONAL and have DEFAULT. Instance Variables: default <Object | UndefinedObject> the default value, that could be nil optional <Boolean> indicates whether the element is optional
</comment> <class> <name>OBJECT_IDENTIFIER</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.OBJECT_IDENTIFIER
Asn1TypeOBJECT_IDENTIFIER represents the ASN.1 OBJECT IDENTIFIER type.
</comment> <class> <name>TypeReference</name> <environment>ASN1</environment> <super>ASN1.Entity</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.TypeReference
Asn1TypeReference is used to implement forward referencing during type declaration and registration. If a compound type is registered before one of its subtypes, the subtype is stored -- in the type registry and in the compound type being defined -- as an Asn1TypeReference. Later, whenever the Asn1TypeReference is sent a message implemented in Asn1Type or any of its subtypes, then, by way of a reimplemented 'doesNotUnderstand:', the Asn1TypeReference is replaced with the concrete type using 'oneWayBecome:'. If that type cannot be found, a runtime exception is raised.
</comment> <class> <name>INTEGER</name> <environment>ASN1</environment> <super>ASN1.BasicType</super> <private>false</private> none identifiers <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.INTEGER
Asn1TypeINTEGER represents the ASN.1 INTEGER type. Instance Variables: identifiers <Dictionary> maps specified identifiers to values
</comment> <class> <name>IA5String</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.IA5String
Asn1TypeIA5String represents the ASN.1 IA5String type.
</comment> <class> <name>VisibleString</name> <environment>ASN1</environment> <super>ASN1.IA5String</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.VisibleString
Asn1TypeVisibleString represents the ASN.1 VisibleString type.
</comment> <class> <name>UTCTime</name> <environment>ASN1</environment> <super>ASN1.VisibleString</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.UTCTime
Asn1TypeUTCTime represents the ASN.1 UTCTime type.
</comment> <class> <name>NumericString</name> <environment>ASN1</environment> <super>ASN1.IA5String</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.NumericString
Asn1TypeNumericString represents the ASN.1 NumericString type.
</comment> <class> <name>GeneralizedTime</name> <environment>ASN1</environment> <super>ASN1.VisibleString</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.GeneralizedTime
Asn1TypeGeneralizedTime represents the ASN.1 GeneralizedTime type.
</comment> <class> <name>PrintableString</name> <environment>ASN1</environment> <super>ASN1.IA5String</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.PrintableString
Asn1TypePrintableString represents the ASN.1 PrintableString type.
</comment> <class> <name>SET_OF</name> <environment>ASN1</environment> <super>ASN1.UnstructuredType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.SET_OF
Asn1TypeSET_OF represents the ASN.1 SET OF type. Note that an ASN.1 SET OF is not a set in the mathematical sense. It is a SEQUENCE OF with an unconstrained transmission order, that may contain multiple occurrences of the same value..
</comment> <class> <name>GraphicString</name> <environment>ASN1</environment> <super>ASN1.StringType</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Types</package> </attributes> </class> <comment> ASN1.GraphicString
Asn1TypeGraphicString represents the ASN.1 GraphicString type.
</comment> <name>UniversalSET_OF</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>17</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalT61String</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>20</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalNULL</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>5</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalREAL</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>9</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>TagMaskNumber</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag masks</category> <initializer>2r00011111</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalTeletexString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>20</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>PrimitiveForm</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag forms</category> <initializer>2r00000000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalSEQUENCE</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>16</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalGeneralString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>27</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalBMPString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>30</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalSET</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>17</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalOBJECT_IDENTIFIER</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>6</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalClass</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag classes</category> <initializer>2r00000000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalRELATIVE_OID</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>13</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalISO646String</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>26</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalVisibleString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>26</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ConstructedForm</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag forms</category> <initializer>2r00100000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalEMBEDDED_PDV</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>11</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalVideotexString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>21</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalGeneralizedTime</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>24</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalIA5String</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>22</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ContextSpecificClass</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag classes</category> <initializer>2r10000000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalEXTERNAL</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>8</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ConstructedSEQUENCE</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>2r00110000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalINTEGER</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>2</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ApplicationClass</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag classes</category> <initializer>2r01000000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalObjectDescriptor</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>7</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalBOOLEAN</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>1</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalGraphicString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>25</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalSEQUENCE_OF</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>16</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>TagMaskClass</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag masks</category> <initializer>2r11000000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalUTCTime</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>23</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalINSTANCE_OF</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>8</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalCHARACTER_STRING</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>29</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>TagMaskForm</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag masks</category> <initializer>2r00100000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ConstructedSET_OF</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>2r00110001</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalBIT_STRING</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>3</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalOCTET_STRING</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>4</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ConstructedSET</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>2r00110001</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>ConstructedSEQUENCE_OF</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>2r00110000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalENUMERATED</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>10</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalUTF8String</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>12</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>PrivateClass</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tag classes</category> <initializer>2r11000000</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalUniversalString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>28</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalNumericString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>18</initializer> <attributes> <package>ASN1-Types</package> </attributes> <name>UniversalPrintableString</name> <environment>ASN1</environment> <private>false</private> <constant>false</constant> <category>tags</category> <initializer>19</initializer> <attributes> <package>ASN1-Types</package> </attributes> <methods> ASN1.Type <category>testing</category>
isBasic ^false
isConstructed ^false
isExtensible "Indicates whether the type may be extended in revisions of an originating ASN.1 type specifciation and include an ASN.1 extension marker." ^false
isImplicitlyTagged ^tagging = #implicit
isMappable ^false
isScoping "Indicates whether the type may override default tags by creating context-specific tags. In principle, 'universal' and 'context-specific' tag classes are sufficient to disambiguate all tags. Any ASN.1 compiler that produces instances or structures of Asn1Type is expected to do its job without relying on contexts that represent 'application' or 'private' tag classes." ^false
isStructured ^false
</methods> <methods> ASN1.Type <category>printing</category>
fullPrintOn: aStream self name ifNotNil: [ :n | aStream nextPutAll: n; nextPutAll: ' ::= ' ]. self tag ifNotNil: [ aStream nextPut: $[; print: self tag; nextPut: $]. self tagging ifNotNil: [ aStream space; nextPutAll: self tagging asString asUppercase ]. aStream space ]. aStream nextPutAll: self class defaultSymbol. self constraint isNull ifFalse: [ aStream nextPutAll: ' ('. self constraint shortPrintOn: aStream. aStream nextPut: $) ]
fullPrintString | stream | stream := (String new: 100) writeStream. self fullPrintOn: stream. ^stream contents
printOn: aStream self shortPrintOn: aStream "aStream nextPutAll: ( self class name ); nextPutAll: '( '; nextPutAll: self symbol; nextPutAll: ' / '; print: self constraint; nextPutAll: ' )'"
shortPrintOn: aStream self tag ifNotNil: [ aStream nextPut: $[; print: self tag; nextPut: $]. self tagging ifNotNil: [ aStream space; nextPutAll: self tagging asString asUppercase ]. aStream space ]. self name ifNil: [ aStream nextPutAll: self class defaultSymbol ] ifNotNil: [ :n | aStream nextPutAll: n ]. self constraint isNull ifFalse: [ aStream nextPutAll: ' ('. self constraint shortPrintOn: aStream. aStream nextPut: $) ]
</methods> <methods> ASN1.Type <category>accessing</category>
constraint ^constraint ifNil: [ constraint := NullConstraint default ]
constraint: anAsn1Constraint constraint := anAsn1Constraint
retainEncoding ^retainEncoding
retainEncoding: aBoolean retainEncoding := aBoolean
tag ^tag
tag: aTag " aTag <Integer> a specific tag for this type " tag := aTag
tagging ^tagging
tagging: aMode " aMode <Symbol> tagging mode for this type '#implicit', or '#explicit' " tagging := aMode
</methods> <methods> ASN1.Type <category>utilities</category>
inspectorExtraAttributes ^#{Tools.Trippy.TextAttribute} ifDefinedDo: [ :class | Array with: (class label: 'ASN.1' text: self fullPrintString) ] elseDo: [ Array new ]
</methods> <methods> ASN1.Type <category>type construction</category>
named: aSymbol ^(SubType name: aSymbol) parent: self
named: aSymbol in: aModule ^(SubType name: aSymbol in: aModule) parent: self
</methods> <methods> ASN1.Type <category>initialize-release</category>
initialize "By default, do not retain encodings." retainEncoding := false.
</methods> <methods> ASN1.Type <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ ( anObject constraint equals: self constraint ) and: [ ( anObject tag = self tag ) and: [ anObject tagging = self tagging ] ] ] ]
</methods> <methods> ASN1.Type <category>error</category>
obsoleteType self error: (#TypeIsObsolete << #asn1 >> 'This ASN.1 type is obsolete and no longer used.')
</methods> <methods> ASN1.Type <category>validation</category>
permits: anObject ^ (self class defaultConstraint permits: anObject) and: [self constraint permits: anObject ]
</methods> <methods> ASN1.Type <category>private</category>
usedInElement: element "Callback from the element that uses the type, allows for any additional activity for proper hook-up to the containting type, necessary for example for ANY DEFINED BY type of construct."
</methods> <methods> ASN1.Type class <category>defaults</category>
defaultConstraint " ^<Asn1Constraint> constraint that applies to all instances of this type class " ^defaultConstraint ifNil: [ defaultConstraint := self defaultConstraintValue ]
defaultConstraint: aConstraint " aConstraint <Asn1Constraint> the default constraint for the respective class of types ^<Asn1Constraint> constraint that applies to all instances of this type class " defaultConstraint := aConstraint
defaultConstraintValue " ^<Asn1Constraint> constraint that applies to all instances of this type class ... should, in all but a few cases, be overridden. " ^ASN1.NullConstraint default
defaultSymbol ^self subclassResponsibility
flushDefaultConstraint defaultConstraint := nil
</methods> <methods> ASN1.Type class <category>instance creation</category>
new ^super new initialize
</methods> <methods> ASN1.Type class <category>testing</category>
isConcrete ^( self class includesSelector: #defaultSymbol ) "and: [ self class includesSelector: #defaultConstraintValue ]"
</methods> <methods> ASN1.ConstructedType <category>testing</category>
isConstructed ^true
</methods> <methods> ASN1.UnstructuredType <category>accessing</category>
elementType ^elementType
elementType: aTypeSpec elementType := self typeFrom: aTypeSpec
</methods> <methods> ASN1.UnstructuredType <category>printing</category>
fullPrintOn: aStream self name ifNotNil: [ :n | aStream nextPutAll: n; nextPutAll: ' ::= ' ]. self tag ifNotNil: [ aStream nextPut: $[; print: self tag; nextPut: $]. self tagging ifNotNil: [ aStream space; nextPutAll: self tagging asString asUppercase ]. aStream space ]. aStream nextPutAll: (self class defaultSymbol copyUpTo: $ ). self constraint isNull ifFalse: [ aStream nextPutAll: ' ('. self constraint shortPrintOn: aStream. aStream nextPut: $) ]. aStream nextPutAll: ' OF '; nextPutAll: elementType name
shortPrintOn: aStream self tag ifNotNil: [ aStream nextPut: $[; print: self tag; nextPut: $]. self tagging ifNotNil: [ aStream space; nextPutAll: self tagging asString asUppercase ]. aStream space ]. self name ifNil: [ aStream nextPutAll: (self class defaultSymbol copyUpTo: $ ). self constraint isNull ifFalse: [ aStream nextPutAll: ' ('. self constraint shortPrintOn: aStream. aStream nextPut: $) ]. aStream nextPutAll: ' OF '; nextPutAll: elementType name ] ifNotNil: [ :n | aStream nextPutAll: n ].
</methods> <methods> ASN1.UnstructuredType <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ self elementType equals: anObject elementType ] ]
</methods> <methods> ASN1.UnstructuredType <category>validation</category>
permits: anObject ^(super permits: anObject) and: [ anObject allSatisfy: [ :e | elementType permits: e ] ]
</methods> <methods> ASN1.SEQUENCE_OF class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x class == OrderedCollection ]
defaultSymbol ^#'SEQUENCE OF'
</methods> <methods> ASN1.StructuredType <category>accessing</category>
defaultOrOptionalCount ^( defaultOrOptionalCount isNil ) ifTrue: [ self setDefaultOrOptionalCount ] ifFalse: [ defaultOrOptionalCount ]
extensionMarkerCount ^( extensionMarkerCount isNil ) ifTrue: [ self setExtensionMarkerCount ] ifFalse: [ extensionMarkerCount ]
minLength ^( minLength isNil ) ifTrue: [ self setMinLength ] ifFalse: [ minLength ]
optionalOrDefaultSymbols ^( ( ( self elements select: [ :ele | ele isExtensionMarker not ] ) select: [ :ele | ( ele hasDefault ) or: [ ele isOptional ] ] ) collect: [ :ele | ele symbol ] ) asSet
requiredSymbols ^( ( ( self elements select: [ :ele | ele isExtensionMarker not ] ) select: [ :ele | ( ele hasDefault not ) and: [ ele isOptional not ] ] ) collect: [ :ele | ele symbol ] ) asSet
symbols ^( ( self elements select: [ :ele | ele isExtensionMarker not ] ) collect: [ :ele | ele symbol ] ) asSet
</methods> <methods> ASN1.StructuredType <category>private</category>
clearPredicates defaultOrOptionalCount := extensionMarkerCount := minLength := nil
doesNotUnderstand: aMessage "Allow using an element name as a message to a structured type to make type building easier" aMessage arguments isEmpty ifTrue: [ ( self elements detect: [ :e | e symbol = aMessage selector ] ifNone: [ nil ] ) ifNotNil: [ :e | ^e ] ]. ^super doesNotUnderstand: aMessage
indexOfFirstExtensionMarkerOrEnd | es | es := elements size. 1 to: elements size do: [ :n | ( ( elements at: n ) isExtensionMarker ) ifTrue: [ ^n ] ]. ^es
newElement ^StructureElement new
setDefaultOrOptionalCount | n | n := 0. elements do: [ :e | ( e hasDefaultOrIsOptional ) ifTrue: [ n := n + 1 ] ]. ^defaultOrOptionalCount := n
setExtensionMarkerCount | n | n := 0. elements do: [ :e | ( e isExtensionMarker ) ifTrue: [ n := n + 1 ] ]. ^extensionMarkerCount := n
setMinLength "... sets the minimum length for aCollection marshaled under this type. ... allows the marshaling of 'old' type definitions without subsequent extensions." | num ind | num := ind := self indexOfFirstExtensionMarkerOrEnd. 1 to: ind do: [ :ndx | | ele | ele := elements at: ndx. ( ( ele hasDefaultOrIsOptional ) or: [ ele isExtensionMarker ] ) ifTrue: [ num := num - 1 ] ]. ^minLength := num
</methods> <methods> ASN1.StructuredType <category>accessing - element constructors</category>
addElement: aSymbol type: aTypeSpec " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type " ^self addElement: ( self newElement symbol: aSymbol; type: (self typeFrom: aTypeSpec))
addElement: aSymbol type: aTypeSpec tag: anInteger " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anInteger <SmallInteger> assign context-specific tag to the element " ^(self addElement: aSymbol type: aTypeSpec) tag: anInteger; yourself
addElement: aSymbol type: aTypeSpec tag: anInteger tagging: aMode " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anInteger <SmallInteger> assign context-specific tag to the element aMode <Symbol> set specific tagging mode for this element (#implict | #explicit) " ^(self addElement: aSymbol type: aTypeSpec tag: anInteger) taggingMode: aMode; yourself
</methods> <methods> ASN1.StructuredType <category>accessing - elements</category>
addElement: anAbstractElement self clearPredicates. elements addLast: anAbstractElement. anAbstractElement addedTo: self. ^anAbstractElement
elementAtIndex: anInteger ^self elements at: anInteger
elements ^elements
elements: aSequenceableCollection elements := aSequenceableCollection. self clearPredicates
elementWithSymbol: aSymbol ^self elements detect: [ :x | x symbol == aSymbol ]
elementWithTag: anInteger "... use constant to avoid namespace lookup." ^self elements detect: [ :x | ( x tagBER bitAnd: 02r00011111 "ASN1.TagMaskNumber" ) == ( anInteger bitAnd: 02r00011111 "ASN1.TagMaskNumber" ) ]
elementWithTag: anInteger ifNone: aBlock ^self elements detect: [ :x | x matchesTag: anInteger ] ifNone: aBlock
removeElement: anAbstractElement elements remove: anAbstractElement. anAbstractElement removedFrom: self. self clearPredicates. ^anAbstractElement
</methods> <methods> ASN1.StructuredType <category>testing - elements</category>
hasDefaultsOrOptionals ^( self defaultOrOptionalCount > 0 )
hasExtensionMarkers ^( self extensionMarkerCount > 0 )
permitsLength: anInteger "... used only when marshaling OrderedCollections as SEQUENCEs." ^( ( anInteger <= self sizeSansExtensionMarkers ) and: [ anInteger >= self minLength ] )
sizeSansExtensionMarkers ^( elements size - self extensionMarkerCount )
</methods> <methods> ASN1.StructuredType <category>testing</category>
isExtensible "Indicates whether the type may be extended in revisions of an originating ASN.1 type specifciation and include an ASN.1 extension marker." ^true
isScoping "Indicates whether the type may override default tags by creating context-specific tags. In principle, 'universal' and 'context-specific' tag classes are sufficient to disambiguate all tags. Any ASN.1 compiler that produces instances or structures of Asn1Type is expected to do its job without relying on contexts that represent 'application' or 'private' tag classes." ^true
isStructured ^true
</methods> <methods> ASN1.StructuredType <category>initialize-release</category>
initialize super initialize. elements := OrderedCollection new: 7.
</methods> <methods> ASN1.StructuredType <category>printing</category>
fullPrintOn: aStream self shortPrintOn: aStream. aStream space; nextPut: ${; cr. self elements do: [ :e | aStream tab. e shortPrintOn: aStream ] separatedBy: [ aStream nextPut: $,; cr ]. aStream space; nextPut: $}
</methods> <methods> ASN1.StructuredType <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ self hasEqualElementsWith: anObject ] ]
hasEqualElementsWith: anObject ^ ( anObject elements size = self elements size ) and: [ anObject elements allSatisfy: [ :e1 | self elements anySatisfy: [ :e2 | e1 equals: e2 ] ] ]
</methods> <methods> ASN1.CHOICE <category>accessing</category>
tags ^( tags isNil ) ifTrue: [ self setTags ] ifFalse: [ tags ]
useChoice ^useChoice ifNil: [ self class defaultUseChoice ]
useChoice: aBoolean " aBoolean <Boolean> should wrap unmarshaled values in Choice instances ? " useChoice := aBoolean
</methods> <methods> ASN1.CHOICE <category>private</category>
clearPredicates super clearPredicates. tags := nil
newElement ^ChoiceElement new
setTags "... sweat to avoid a 'grow'." | s | s := Set new: ( elements size * 3 // 2 ). elements do: [ :e | ( e isExtensionMarker ) ifFalse: [ s add: e tagBER ] ]. ^tags := s
</methods> <methods> ASN1.CHOICE <category>testing</category>
isImplicitlyTagged ^false
matchesTag: anInteger ^tag ifNil: [ elements anySatisfy: [ :e | e matchesTag: anInteger ] ] ifNotNil: [ ((tag bitXor: anInteger) bitAnd: TagMaskNumber) isZero ]
</methods> <methods> ASN1.CHOICE <category>validation</category>
permits: anObject ^(super permits: anObject) and: [ elements anySatisfy: [ :e | e permits: anObject ] ]
</methods> <methods> ASN1.CHOICE <category>accessing - elements</category>
elementPermitting: anObject ^elements detect: [ :e | e permits: anObject ] ifNone: [ nil ]
</methods> <methods> ASN1.CHOICE class <category>defaults</category>
defaultSymbol ^#'CHOICE'
defaultUseChoice ^defaultUseChoice ifNil: [ self defaultUseChoiceValue ]
defaultUseChoice: aBoolean " aBoolean <Boolean> should choices unmarshal as Choice instances by default ? " defaultUseChoice := aBoolean
defaultUseChoiceValue ^true
</methods> <methods> ASN1.SubType <category>printing</category>
fullPrintOn: aStream self name ifNotNil: [ :n | aStream nextPutAll: n; nextPutAll: ' ::= ' ]. self tag ifNotNil: [ aStream nextPut: $[; print: self tag; nextPut: $]. self tagging ifNotNil: [ aStream space; nextPutAll: self tagging asString asUppercase ]. aStream space ]. aStream nextPutAll: parent name. self constraint isNull ifFalse: [ aStream nextPutAll: ' ('. self constraint shortPrintOn: aStream. aStream nextPut: $) ]
shortPrintOn: aStream self tag ifNotNil: [ aStream nextPut: $[; print: self tag; nextPut: $]. self tagging ifNotNil: [ aStream space; nextPutAll: self tagging asString asUppercase ]. aStream space ]. self name ifNil: [ aStream nextPutAll: parent name ] ifNotNil: [ :n | aStream nextPutAll: n ]. self constraint isNull ifFalse: [ aStream nextPutAll: ' ('. self constraint shortPrintOn: aStream. aStream nextPut: $) ]
</methods> <methods> ASN1.SubType <category>accessing</category>
parent ^parent
parent: anAsn1Type parent := anAsn1Type
</methods> <methods> ASN1.SubType <category>testing</category>
matchesTag: anInteger ^tag ifNil: [ parent matchesTag: anInteger ] ifNotNil: [ ((tag bitXor: anInteger) bitAnd: TagMaskNumber) isZero ]
</methods> <methods> ASN1.SubType <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ self == anObject "Do not waste time comparing structure if we're identical." or: [ ( super equals: anObject ) and: [ self parent equals: anObject parent ] ]
</methods> <methods> ASN1.SubType <category>validation</category>
permits: anObject ^ (self parent permits: anObject) and: [self constraint permits: anObject ]
</methods> <methods> ASN1.BasicType <category>testing</category>
isBasic ^true
</methods> <methods> ASN1.RELATIVE_OID class <category>defaults</category>
defaultSymbol ^#'RELATIVE-OID'
</methods> <methods> ASN1.NULL class <category>defaults</category>
defaultConstraintValue ^SingleValueConstraint with: nil
defaultSymbol ^#'NULL'
</methods> <methods> ASN1.ObjectDescriptor class <category>defaults</category>
defaultSymbol ^#'ObjectDescriptor'
</methods> <methods> ASN1.ANY <category>testing</category>
isImplicitlyTagged ^false
matchesTag: anInteger ^tag ifNil: [ (TagMaskClass bitAnd: anInteger) = UniversalClass ] ifNotNil: [ ((tag bitXor: anInteger) bitAnd: TagMaskNumber) isZero ]
</methods> <methods> ASN1.ANY <category>accessing</category>
at: key ^self typeMap at: key
at: key ifAbsent: aBlock ^self typeMap at: key ifAbsent: aBlock
at: key put: aType ^self typeMap at: key put: aType
definedBy ^definedBy
definedBy: anElement definedBy := anElement
removeKey: key ^self typeMap removeKey: key
typeMap ^typeMap ifNil: [ typeMap := Dictionary new ]
</methods> <methods> ASN1.ANY <category>private</category>
usedInElement: element "Callback from the element that uses the type, allows for any additional activity for proper hook-up to the containting type, necessary for example for ANY DEFINED BY type of construct." definedBy ifNotNil: [ definedBy := element owner elementWithSymbol: definedBy asSymbol ]
</methods> <methods> ASN1.ANY <category>printing</category>
shortPrintOn: aStream super shortPrintOn: aStream. definedBy ifNotNil: [ aStream nextPutAll: ' DEFINED BY '; nextPutAll: definedBy symbol ]
</methods> <methods> ASN1.ANY class <category>defaults</category>
defaultSymbol ^#ANY
</methods> <methods> ASN1.ANY class <category>instance creation</category>
definedBy: aSymbol ^self new definedBy: aSymbol; yourself
</methods> <methods> ASN1.ENUMERATED <category>accessing - elements</category>
elementAtIndex: anInteger ^self elements at: anInteger
elementWithInteger: anInteger ^self elements detect: [ :x | x integer = anInteger ] ifNone: []
elementWithSymbol: aSymbol ^self elements detect: [ :x | x symbol = aSymbol ] ifNone: []
</methods> <methods> ASN1.ENUMERATED <category>accessing</category>
add: anElement | element | element := anElement asAsn1EnumerationElement. element isExtensionMarker ifTrue: [ ^self addExtensionMarker ]. complete := false. ^elements addLast: element.
addExtensionMarker ^extensibleAt ifNil: [ extensibleAt := elements size ] ifNotNil: [ InvalidTypeSpecification new messageText: ( #EnumSingleExtMarker1s << #asn1 >> 'Only one extension marker is allowed in ENUMERATED <1s>!' expandMacrosWith: self name); parameter: self; raise ]
elements self ensureComplete. ^elements
elements: aSequenceableCollection aSequenceableCollection do: [ :x | self add: x ]
extensibleAt ^extensibleAt
useEnumeration ^useEnumeration ifNil: [ self class defaultUseEnumeration ]
useEnumeration: aBoolean " aBoolean <Boolean> should wrap unmarshaled values in Enumeration instances ? " useEnumeration := aBoolean
</methods> <methods> ASN1.ENUMERATED <category>printing</category>
fullPrintOn: aStream super fullPrintOn: aStream. self printElementsOn: aStream
printElementsOn: aStream aStream nextPutAll: ' { '. (1 to: (self extensibleAt ifNil: [ elements size ])) do: [ :i | (elements at: i) shortPrintOn: aStream ] separatedBy: [ aStream nextPutAll: ', ' ]. self extensibleAt ifNotNil: [ :m | aStream nextPutAll: ', ..., '. (m + 1 to: elements size) do: [ :i | (elements at: i) shortPrintOn: aStream ] separatedBy: [ aStream nextPutAll: ', ' ] ]. aStream nextPutAll: ' }'.
shortPrintOn: aStream super shortPrintOn: aStream. self printElementsOn: aStream
</methods> <methods> ASN1.ENUMERATED <category>initialize-release</category>
initialize super initialize. complete := true. elements := OrderedCollection new: 7.
</methods> <methods> ASN1.ENUMERATED <category>private</category>
ensureComplete "Make sure that elements that don't have explicitly specified value are auto-numbered. The root elements (before an extension marker) have different numbering rules than additional elements (after an extension marker). " | counter root taken | complete ifTrue: [^self]. "The root elements (before an extension marker) have simple numbering rules" root := self extensibleAt ifNil: [ elements ] ifNotNil: [ :i | elements copyFrom: 1 to: i ]. taken := root inject: Set new into: [ :set :e | e isExplicit ifTrue: [ (set includes: e value) ifTrue: [ ^self errorValueNotUnique: e ] ifFalse: [ set add: e value ] ]. set ]. counter := 0. [ taken includes: counter ] whileTrue: [ counter := counter + 1]. root do: [ :e | e isExplicit ifFalse: [ e setValue: counter. [ counter := counter + 1. taken includes: counter ] whileTrue ] ]. "Now process any additional elements (after an extension marker" self extensibleAt ifNotNil: [ :i || additional | additional := elements copyFrom: i + 1 to: elements size. additional do: [ :e | e explicit ifTrue: [ (taken includes: e value) ifTrue: [ ^self errorValueNotUnique: e ]. taken add: e value. e value < counter ifTrue: [ ^self errorInvalidValue: e ] ifFalse: [ counter := e value ] ] ifFalse: [ e setValue: counter ]. [ counter := counter + 1. taken includes: counter ] whileTrue ] ]. complete := true
errorInvalidValue: anElement ^InvalidTypeSpecification new messageText: ( #EnumInvalidValue1p2s3s << #asn1 >> 'Value <1p> assigned to <2s> in ENUMERATED <3s> is not valid!' expandMacrosWith: anElement value with: anElement identifier with: self name); parameter: anElement; raise
errorValueNotUnique: anElement ^InvalidTypeSpecification new messageText: ( #EnumNotUniqueValues1p2s3s << #asn1 >> 'Value <1p> assigned to <2s> in ENUMERATED <3s> is not unique!' expandMacrosWith: anElement value with: anElement identifier with: self name); parameter: anElement; raise
errorValuesNotUnique ^InvalidTypeSpecification new messageText: ( #EnumValuesNotUnique << #asn1 >> 'Assigned values in ENUMERATED <1s> are not unique !' expandMacrosWith: self name); raise
</methods> <methods> ASN1.ENUMERATED <category>testing</category>
includes: aValue "Is the value specified as either a symbol or an integer included in the receiver ? aValue <Symbol | Integer> ^<Boolean> " ^self elements anySatisfy: [ :e | e permits: aValue ]
isExtensible "Indicates whether the type may be extended in revisions of an originating ASN.1 type specifciation and include an ASN.1 extension marker." ^self extensibleAt notNil
</methods> <methods> ASN1.ENUMERATED <category>validation</category>
permits: anObject ^ (super permits: anObject) and: [ self includes: anObject ]
</methods> <methods> ASN1.ENUMERATED class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x isSymbol or: [ x isKindOf: Integer ] ]
defaultSymbol ^#'ENUMERATED'
defaultUseEnumeration ^defaultUseEnumeration ifNil: [ self defaultUseEnumerationValue ]
defaultUseEnumeration: aBoolean " aBoolean <Boolean> should enumerations unmarshal as Enumeration instances by default ? " defaultUseEnumeration := aBoolean
defaultUseEnumerationValue ^true
</methods> <methods> ASN1.BIT_STRING class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x class == BIT_STRING ]
defaultSymbol ^#'BIT STRING'
</methods> <methods> ASN1.OCTET_STRING class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x isKindOf: ByteArray ]
defaultSymbol ^#'OCTET STRING'
</methods> <methods> ASN1.BOOLEAN class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x == true or: [ x == false ] ]
defaultSymbol ^#'BOOLEAN'
</methods> <methods> ASN1.REAL class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x isKindOf: LimitedPrecisionReal ]
defaultSymbol ^#'REAL'
</methods> <methods> ASN1.UniversalString class <category>defaults</category>
defaultSymbol ^#'UniversalString'
</methods> <methods> ASN1.GeneralString class <category>defaults</category>
defaultSymbol ^#'GeneralString'
</methods> <methods> ASN1.TeletexString class <category>defaults</category>
defaultSymbol ^#'TeletexString'
</methods> <methods> ASN1.BMPString class <category>defaults</category>
defaultSymbol ^#'BMPString'
</methods> <methods> ASN1.VideotexString class <category>defaults</category>
defaultSymbol ^#'VideotexString'
</methods> <methods> ASN1.UTF8String class <category>defaults</category>
defaultSymbol ^#'UTF8String'
</methods> <methods> ASN1.MappableType <category>accessing</category>
mapping ^mapping
mapping: aClassOrUndefinedObject mapping := aClassOrUndefinedObject
</methods> <methods> ASN1.MappableType <category>accessing - element constructors</category>
addElement: aSymbol type: aTypeSpec default: anObject " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anObject <Object> default value for the element " ^(self addElement: aSymbol type: aTypeSpec) default: anObject; yourself
addElement: aSymbol type: aTypeSpec tag: anInteger default: anObject " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anInteger <SmallInteger> assign context-specific tag to the element anObject <Object> default value for the element " ^(self addElement: aSymbol type: aTypeSpec tag: anInteger) default: anObject; yourself
addElement: aSymbol type: aTypeSpec tag: anInteger tagging: aMode default: anObject " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anInteger <SmallInteger> assign context-specific tag to the element aMode <Symbol> set specific tagging mode for this element (#implict | #explicit) anObject <Object> default value for the element " ^(self addElement: aSymbol type: aTypeSpec tag: anInteger tagging: aMode) default: anObject; yourself
addOptionalElement: aSymbol type: aTypeSpec " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type " ^(self addElement: aSymbol type: aTypeSpec) optional: true; yourself
addOptionalElement: aSymbol type: aTypeSpec tag: anInteger " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anInteger <SmallInteger> assign context-specific tag to the element " ^(self addElement: aSymbol type: aTypeSpec tag: anInteger) optional: true; yourself
addOptionalElement: aSymbol type: aTypeSpec tag: anInteger tagging: aMode " aSymbol <Symbol> element name aTypeSpec <Symbol | Asn1Type> the element type anInteger <SmallInteger> assign context-specific tag to the element aMode <Symbol> set specific tagging mode for this element (#implict | #explicit) " ^(self addElement: aSymbol type: aTypeSpec tag: anInteger tagging: aMode) optional: true; yourself
</methods> <methods> ASN1.MappableType <category>testing</category>
isMappable ^true
</methods> <methods> ASN1.MappableType <category>initialize-release</category>
initialize super initialize. mapping := nil
</methods> <methods> ASN1.MappableType <category>validation</category>
permits: anObjectOrAsn1Struct "... used when marshaling Asn1Structs or mapped user classes as SEQUENCEs. Ensures that the argument contains all of the minimally required element type symbols. The phrasing implicitly requires that the argument have selectors for all OPTIONALs and DEFAULTs." (mapping notNil and: [ anObjectOrAsn1Struct class == mapping ]) ifTrue: [ ^true ]. ^ (super permits: anObjectOrAsn1Struct) and: [ ( anObjectOrAsn1Struct class == Struct ) ifTrue: [ (self requiredSymbols - anObjectOrAsn1Struct accessKeys) isEmpty ] ifFalse: [ self requiredSymbols allSatisfy: [ :sym | anObjectOrAsn1Struct class canUnderstand: sym ] ] ]
</methods> <methods> ASN1.SEQUENCE <category>comparing</category>
hasEqualElementsWith: anObject ^ ( anObject elements size = self elements size ) and: [ anObject elements with: self elements do: [ :e1 :e2 | (e1 equals: e2) ifFalse: [ ^false ] ]. true ]
</methods> <methods> ASN1.SEQUENCE class <category>defaults</category>
defaultSymbol ^#'SEQUENCE'
</methods> <methods> ASN1.SET <category>private</category>
clearPredicates super clearPredicates. decodingDictionary := encodingDictionary := nil
setDecodingDictionary | dict | dict := Dictionary new: elements size. elements do: [ :ele | dict add: ( ( ele tagBER bitAnd: 02r00011111 ) -> ele ) ]. ^decodingDictionary := dict
setEncodingDictionary | dict | dict := Dictionary new: elements size. elements do: [ :ele | dict add: ele symbol -> ele ]. ^encodingDictionary := dict
</methods> <methods> ASN1.SET <category>accessing</category>
decodingDictionary ^( decodingDictionary isNil ) ifTrue: [ self setDecodingDictionary ] ifFalse: [ decodingDictionary ]
encodingDictionary ^( encodingDictionary isNil ) ifTrue: [ self setEncodingDictionary ] ifFalse: [ encodingDictionary ]
</methods> <methods> ASN1.SET <category>configuration api</category>
addElement: anAsn1AbstractElement | result | result := super addElement: anAsn1AbstractElement. self class validate: self. ^result
</methods> <methods> ASN1.SET class <category>defaults</category>
defaultSymbol ^#'SET'
</methods> <methods> ASN1.SET class <category>validation</category>
validate: anAsn1TypeSET "SET elements must have unique tags." | s | s := ( anAsn1TypeSET elements collect: [ :x | x tagBER ] ) asSet. ( s size = anAsn1TypeSET elements size ) ifFalse: [ ^InvalidTypeSpecification raiseSignal: (#SetElementsMustHaveUniqueTags << #asn1 >> 'Asn1TypeSET elements must have unique tags!') ]
</methods> <methods> ASN1.AbstractElement <category>testing</category>
hasDefault "Answers whether the receiver contains a default value." ^false
hasDefaultOrIsOptional "Answers whether the receiver contains a default value or is optional." ^false
isElement "Answers whether the receiver is an element." ^false
isExceptionMarker "Answers whether the receiver is an exception marker." ^false
isExplicit "Answers whether the receiver is explicitly tagged." ^false
isExtensionMarker "Answers whether the receiver is an extension marker." ^false
isImplicit "Answers whether the receiver is implicitly tagged." ^false
isMarker "Answers whether the receiver is a marker." ^false
isOptional "Answers whether the receiver is optional." ^false
isUniversal "Answers whether the receiver is 'universally' tagged, that is, neither implicitly nor explicitly tagged." ^true
</methods> <methods> ASN1.AbstractElement <category>initialize-release</category>
initialize
</methods> <methods> ASN1.AbstractElement <category>printing</category>
printOn: aStream aStream nextPutAll: ( self class name )
</methods> <methods> ASN1.AbstractElement <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^ anObject class == self class
</methods> <methods> ASN1.AbstractElement <category>private-adding</category>
addedTo: aStructuredType
removedFrom: aStructuredType
</methods> <methods> ASN1.EnumerationElement <category>comparing</category>
= anObject ^( anObject class == self class ) and: [ ( anObject integer = integer ) and: [ anObject symbol = symbol ] ]
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ ( anObject integer = integer ) and: [ anObject symbol = symbol ] ]
hash ^integer hash bitXor: symbol hash
</methods> <methods> ASN1.EnumerationElement <category>accessing</category>
explicit ^explicit ifNil: [ explicit := false ]
identifier ^self symbol
integer ^integer
integer: anInteger self setValue: anInteger. explicit := true
symbol ^symbol
symbol: aSymbolOrString symbol := aSymbolOrString asSymbol
value ^self integer
</methods> <methods> ASN1.EnumerationElement <category>testing</category>
isExplicit ^self explicit
</methods> <methods> ASN1.EnumerationElement <category>converting</category>
asAsn1EnumerationElement ^self
</methods> <methods> ASN1.EnumerationElement <category>printing</category>
printOn: aStream self shortPrintOn: aStream
shortPrintOn: aStream aStream nextPutAll: self identifier. self isExplicit ifTrue: [ aStream nextPut: $(; print: self value; nextPut: $) ].
</methods> <methods> ASN1.EnumerationElement <category>private</category>
setValue: anInteger integer := anInteger
</methods> <methods> ASN1.EnumerationElement <category>validation</category>
permits: anObject ^symbol = anObject or: [ integer = anObject ]
</methods> <methods> ASN1.EnumerationElement class <category>instance creation</category>
integer: anInteger symbol: aSymbol ^( super new ) integer: anInteger; symbol: aSymbol; yourself
symbol: aSymbol ^( super new ) symbol: aSymbol; yourself
symbol: aSymbol integer: anInteger ^( super new ) integer: anInteger; symbol: aSymbol; yourself
</methods> <methods> ASN1.MarkerElement <category>testing</category>
isMarker ^true
</methods> <methods> ASN1.ExtensionMarker <category>protocol compatibility</category>
integer ^nil
symbol ^nil
</methods> <methods> ASN1.ExtensionMarker <category>testing</category>
isExtensionMarker ^true
</methods> <methods> ASN1.ExtensionMarker <category>converting</category>
asAsn1EnumerationElement ^self
</methods> <methods> ASN1.ExtensionMarker <category>As yet unclassified</category>
shortPrintOn: aStream aStream nextPutAll: '...'
</methods> <methods> ASN1.ExtensionMarker class <category>instance creation</category>
default ^self new
new ^( default isNil ) ifTrue: [ default := super new ] ifFalse: [ default ]
</methods> <methods> ASN1.ExceptionMarker <category>accessing</category>
integer ^integer
integer: anInteger integer := anInteger
symbol ^symbol
symbol: aSymbol symbol := aSymbol
</methods> <methods> ASN1.ExceptionMarker <category>testing</category>
isExceptionMarker ^true
</methods> <methods> ASN1.ExceptionMarker <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ ( anObject integer = integer ) and: [ anObject symbol = symbol ] ]
</methods> <methods> ASN1.ExceptionMarker class <category>instance creation</category>
integer: anInteger symbol: aSymbol ^( self new ) integer: anInteger; symbol: aSymbol; yourself
symbol: aSymbol integer: anInteger ^( self new ) integer: anInteger; symbol: aSymbol; yourself
</methods> <methods> ASN1.TypeWrapper <category>accessing</category>
yourself "We don't want to unwrap unintentionally." ^self
_encoding ^encoding
_encoding: aByteArrayOrAsn1Encoding encoding := aByteArrayOrAsn1Encoding
_type ^type
_type: anAsn1Type type := anAsn1Type
_value ^object
_value: anObject object := anObject
</methods> <methods> ASN1.TypeWrapper <category>comparing</category>
= anObject ^anObject _isTypeWrapper ifTrue: [ object = anObject _object and: [ self _isEqualType: anObject ] ] "We don't want the wrapper to get in the way of comparisons, so if the other thing doesn't have a type we fall back to simple value comparison." ifFalse: [ object = anObject ]
hash "Note that we can't include type in the hash because of the relaxed definition of #=" ^object hash
</methods> <methods> ASN1.TypeWrapper <category>converting</category>
asAsn1Choice: aCHOICE "Simpler version of Choice constructor for unambiguous CHOICEs. If in doubt use #asAsnChoice:symbol: instead." ^Choice type: aCHOICE value: self
asAsn1Choice: aCHOICE symbol: choice ^Choice type: aCHOICE choiceSymbol: choice value: self
withAsn1Type: anAsn1Type ^ASN1.TypeWrapper type: anAsn1Type value: self
</methods> <methods> ASN1.TypeWrapper <category>printing</category>
printOn: aStream aStream print: type; nextPut: $<; print: object; nextPut: $>
printString "Answer a String whose characters are a description of the receiver." | aStream | aStream := WriteStream on: (String new: 16). self printOn: aStream. ^aStream contents
</methods> <methods> ASN1.TypeWrapper <category>validation</category>
isPermissible ^type permits: object
</methods> <methods> ASN1.TypeWrapper <category>private</category>
_isEqualType: aTypeWrapper ^type equals: aTypeWrapper _type
</methods> <methods> ASN1.TypeWrapper <category>testing</category>
_isChoice ^false
_isTypeWrapper ^true
</methods> <methods> ASN1.TypeWrapper class <category>instance creation</category>
type: aType value: anObject ^(aType permits: anObject) ifTrue: [ self new _type: aType; _value: anObject; yourself ] ifFalse: [ TypeRealizationError new messageText: ( #InvalidTypeCast1p2p << #asn1 >> 'Invalid type cast of <1p> to <2p>!' expandMacrosWith: anObject with: aType); parameter: aType; raise ]
</methods> <methods> ASN1.Choice <category>private</category>
_isEqualType: aTypeWrapper ^(super _isEqualType: aTypeWrapper) and: [ aTypeWrapper _isChoice not or: [ choice equals: aTypeWrapper _choice ] ]
</methods> <methods> ASN1.Choice <category>accessing</category>
_choice ^choice
_choice: aChoiceElement choice := aChoiceElement
_symbol ^choice symbol
_tag ^choice tag ifNil: [ choice type tagBER ]
</methods> <methods> ASN1.Choice <category>testing</category>
_isChoice ^true
</methods> <methods> ASN1.Choice <category>printing</category>
printOn: aStream aStream print: type; nextPut: $<. self shortPrintOn: aStream. aStream nextPut: $>
shortPrintOn: aStream aStream nextPutAll: self _symbol; nextPut: $:; print: object
</methods> <methods> ASN1.Choice class <category>instance creation</category>
type: anAsn1Type choice: anElement value: anObject ^self new _type: anAsn1Type; _choice: anElement; _value: anObject; yourself
type: aCHOICE choiceSymbol: aSymbol value: anObject ^(aCHOICE elementWithSymbol: aSymbol) ifNil: [ TypeRealizationError new messageText: ( #IncompatibleChoiceAlternative1p2p << #asn1 >> 'Object <1p> is not compatible with CHOICE alternative <2p>!' expandMacrosWith: anObject with: aSymbol); parameter: aCHOICE; raise ] ifNotNil: [ :e | self type: aCHOICE choice: e value: anObject ]
type: aCHOICE choiceTag: anInteger value: anObject ^(aCHOICE elementWithTag: anInteger) ifNil: [ TypeRealizationError new messageText: ( #IncompatibleChoiceTag1p2p << #asn1 >> 'Object <1p> is not compatible with CHOICE tag <2p>!' expandMacrosWith: anObject with: anInteger); parameter: aCHOICE; raise ] ifNotNil: [ :e | self type: aCHOICE choice: e value: anObject ]
type: aCHOICE value: anObject ^(aCHOICE elementPermitting: anObject) ifNil: [ TypeRealizationError new messageText: ( #IncompatibleChoice1p2p << #asn1 >> 'Object <1p> is not compatible with CHOICE <2p>!' expandMacrosWith: anObject with: aCHOICE); parameter: aCHOICE; raise ] ifNotNil: [ :e | self type: aCHOICE choice: e value: anObject ]
</methods> <methods> ASN1.Enumeration <category>accessing - translational</category>
_integer ^object
_symbol ^( type elementWithInteger: object ) symbol
</methods> <methods> ASN1.Enumeration <category>conversion</category>
asAsn1Enumeration: anENUMERATED ^anENUMERATED == type ifTrue: [ self ] ifFalse: [ Enumeration type: anENUMERATED value: object ]
</methods> <methods> ASN1.Enumeration class <category>instance creation</category>
type: anENUMERATED symbol: aSymbol ^(anENUMERATED elementWithSymbol: aSymbol) ifNil: [ TypeRealizationError new messageText: ( #InvalidEnumeration1p2p << #asn1 >> 'Symbol <1p> is not valid element of ENUMERATED <2p>!' expandMacrosWith: aSymbol with: anENUMERATED); parameter: anENUMERATED; raise ] ifNotNil: [ :e | self new _type: anENUMERATED; _value: e integer; yourself ]
</methods> <methods> ASN1.ChoiceElement <category>printing</category>
printOn: aStream self shortPrintOn: aStream
shortPrintOn: aStream self symbol ifNotNil: [ aStream nextPutAll: self symbol; tab ]. self type shortPrintOn: aStream
</methods> <methods> ASN1.ChoiceElement <category>testing</category>
isElement ^true
isExplicit ^self taggingMode == #explicit
isImplicit ^self taggingMode == #implicit
matchesTag: anInteger ^type matchesTag: anInteger
</methods> <methods> ASN1.ChoiceElement <category>accessing</category>
owner ^owner
symbol ^symbol ifNil: [ symbol := self type symbol ]
symbol: aSymbol symbol := aSymbol
tag ^type tag
tag: anInteger self ensurePrivateType. type tag: anInteger
taggingMode ^type tagging
taggingMode: aSymbolOrNil self ensurePrivateType. type tagging: aSymbolOrNil
type ^type
type: aAsn1Type type := aAsn1Type
</methods> <methods> ASN1.ChoiceElement <category>private</category>
ensurePrivateType type name ifNotNil: [ type := type named: nil ]
</methods> <methods> ASN1.ChoiceElement <category>validation</category>
permits: anObject ^anObject asn1ChoiceType ifNil: [ type permits: anObject ] ifNotNil: [ :ctype | ctype = type ]
</methods> <methods> ASN1.ChoiceElement <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ anObject type equals: type ]
</methods> <methods> ASN1.ChoiceElement <category>private-adding</category>
addedTo: aStructuredType owner := aStructuredType. type usedInElement: self.
removedFrom: aStructuredType (owner == aStructuredType) ifTrue: [ owner := nil ]
</methods> <methods> ASN1.ChoiceElement class <category>instance creation</category>
new ^super new initialize
</methods> <methods> ASN1.StructureElement <category>accessing</category>
default ^default
default: anObject default := anObject
optional ^optional
optional: aBoolean optional := aBoolean
</methods> <methods> ASN1.StructureElement <category>decoding</category>
mutator ^(self accessor copyWith: $:) asSymbol
</methods> <methods> ASN1.StructureElement <category>printing</category>
shortPrintOn: aStream super shortPrintOn: aStream. self optional ifTrue: [ aStream nextPutAll: ' OPTIONAL' ]. self hasDefault ifTrue: [ aStream nextPutAll: ' DEFAULT '; print: self default ]
</methods> <methods> ASN1.StructureElement <category>testing</category>
hasDefault ^default notNil
hasDefaultOrIsOptional ^default notNil or: [ optional ]
isOptional ^optional
</methods> <methods> ASN1.StructureElement <category>encoding</category>
accessor "ASN.1 allows dashes in element names. All element names should begin with a lower-case letter, so we do not do more than the following" ^( ( symbol includes: $- ) ifTrue: [ symbol copyReplaceAll: '-' with: '_' ] ifFalse: [ symbol ] ) asSymbol
</methods> <methods> ASN1.StructureElement <category>initialize-release</category>
initialize super initialize. optional := false
</methods> <methods> ASN1.StructureElement <category>comparing</category>
equals: anObject "Implements 'structural equivalence' in the spirit of 'type compatibility' described in the ASN.1 semantic model (Dubuisson p.121)." ^( super equals: anObject ) and: [ anObject optional = optional and: [ anObject default = default ] ]
</methods> <methods> ASN1.StructureElement class <category>validation</category>
validate: anAsn1Element ( anAsn1Element optional and: [ anAsn1Element default notNil ] ) ifTrue: [ ^InvalidTypeSpecification raiseSignal: (#InvalidElementSpecification << #asn1 >> 'ASN.1 type elements may not be both OPTIONAL and have a DEFAULT value!') ]
</methods> <methods> ASN1.OBJECT_IDENTIFIER <category>accessing</category>
retainEncoding ^false
retainEncoding: aBoolean "... intentionally null. ASN.1 OBJECT_IDENTIFIERS should never retain encodings using the mechanism employed in Asn1Structs or mapped classes and should always retain them using their native mechanism because they very frequently recur in any sustained interoperation, and they account for a significant part of the marshaling budget. Optimizing the marshaling of ASN.1 OIDs rarely, if ever, fails to have a significant pay off. And, the closer their Smalltalk representation is to their encoding, the better the pay off will be."
</methods> <methods> ASN1.OBJECT_IDENTIFIER class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x class == ObjectIdentifier ]
defaultSymbol ^#'OBJECT IDENTIFIER'
</methods> <methods> ASN1.TypeReference <category>type construction</category>
named: aSymbol ^(SubType name: aSymbol) parent: self
named: aSymbol in: aModule ^(SubType name: aSymbol in: aModule) parent: self
</methods> <methods> ASN1.TypeReference <category>testing</category>
isTypeReference ^true
</methods> <methods> ASN1.TypeReference <category>printing</category>
printOn: aStream aStream nextPutAll: (module name ifNil: ['']); nextPut: $.; nextPutAll: self name
</methods> <methods> ASN1.TypeReference <category>redirection / tree patching</category>
doesNotUnderstand: aMessage | type | type := module find: symbol ifAbsent: [nil]. (type isNil or: [ type == self ]) ifTrue: [ ^InvalidTypeReference new messageText: (#UnknownType1s2s << #asn1 >> 'Unknown ASN.1 type <1s>.<2s>!' expandMacrosWith: (module name ifNil: [ 'nil' ]) with: symbol); parameter: self; raise ]. self oneWayBecome: type. ^type perform: aMessage selector withArguments: aMessage arguments
</methods> <methods> ASN1.TypeReference <category>private</category>
usedInElement: element "Callback from the element that uses the type, allows for any additional activity for proper hook-up to the containting type, necessary for example for ANY DEFINED BY type of construct."
</methods> <methods> ASN1.TypeReference class <category>instance creation</category>
name: aSymbol ^self new name: aSymbol; yourself
name: aSymbol in: aModule ^(self name: aSymbol) module: aModule; yourself
symbol: aSymbol ^( super new ) symbol: aSymbol; yourself
symbol: aSymbol in: aModule ^(self symbol: aSymbol) module: aModule; yourself
</methods> <methods> ASN1.INTEGER <category>printing</category>
fullPrintOn: aStream super fullPrintOn: aStream. self printIdentifiersOn: aStream
printIdentifiersOn: aStream self identifiers isEmpty ifTrue: [^self]. aStream nextPutAll: ' { '. self identifiers keys do: [ :id | aStream nextPutAll: id; nextPut: $(; print: (self identifiers at: id); nextPut: $) ] separatedBy: [ aStream nextPutAll: ', ' ]. aStream nextPutAll: ' }'.
shortPrintOn: aStream super shortPrintOn: aStream. self printIdentifiersOn: aStream
</methods> <methods> ASN1.INTEGER <category>accessing</category>
identifiers ^identifiers ifNil: [ identifiers := Dictionary new ]
identifiers: aMap " aMap < (Dictionary key: Symbol value: Integer) | (Collection of: (Association key: Symbol value: Integer)) > " (aMap isKindOf: Dictionary) ifTrue: [ aMap keysAndValuesDo: [ :id :val | self identify: val as: id ] ] ifFalse: [ aMap do: [ :asc | self identify: asc value as: asc key ] ]
identify: anInteger as: aSymbol (self permits: anInteger) ifTrue: [ self identifiers at: aSymbol put: anInteger ] ifFalse: [ InvalidTypeSpecification new messageText: ( #ValueNotPermissible1p << #asn1 >> 'Value <1p> is not permissible for this type!' expandMacrosWith: anInteger); parameter: anInteger; raise ]
</methods> <methods> ASN1.INTEGER class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x isKindOf: Integer ]
defaultSymbol ^#'INTEGER'
</methods> <methods> ASN1.IA5String class <category>defaults</category>
defaultConstraintValue "... the set CO of 32 control characters, plus ISOReg entry #6 (94 graphical characters), plus 'space' and 'delete'." | charset | charset := Set new: 32 + 94 + 2. 0 to: 31 do: [ :x | charset add: x asCharacter ]. charset addAll: '!"#$%&''()*+,-./'. charset addAll: '0123456789:;<=>?'. charset addAll: '@ABCDEFGHIJKLMNO'. charset addAll: 'PQRSTUVWXYZ[\]^_'. charset addAll: '`abcdefghijkl;mno'. charset addAll: 'pqrstuvwxyz{|}~'. charset add: Character space. charset add: Character del. ^AlphabetConstraint with: ( ValueUnionConstraint withAll: charset )
defaultSymbol ^#'IA5String'
</methods> <methods> ASN1.VisibleString class <category>defaults</category>
defaultConstraintValue "... ISOReg entry #6 (94 characters), plus the space character." | charset | charset := Set new: 95. charset addAll: '!"#$%&''()*+,-./'. charset addAll: '0123456789:;<=>?'. charset addAll: '@ABCDEFGHIJKLMNO'. charset addAll: 'PQRSTUVWXYZ[\]^_'. charset addAll: '`abcdefghijkl;mno'. charset addAll: 'pqrstuvwxyz{|}~'. charset add: Character space. ^AlphabetConstraint with: ( ValueUnionConstraint withAll: charset )
defaultSymbol ^#'VisibleString'
</methods> <methods> ASN1.UTCTime class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x class == Timestamp ]
defaultSymbol ^#'UTCTime'
</methods> <methods> ASN1.NumericString class <category>defaults</category>
defaultConstraintValue | charset | charset := Set new: 11. charset addAll: '0123456789'. charset add: Character space. ^AlphabetConstraint with: ( ValueUnionConstraint withAll: charset )
defaultSymbol ^#'NumericString'
</methods> <methods> ASN1.GeneralizedTime class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x class == Timestamp ]
defaultSymbol ^#'GeneralizedTime'
</methods> <methods> ASN1.PrintableString class <category>defaults</category>
defaultConstraintValue | charset | charset := Set new: 74. charset addAll: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. charset addAll: 'abcdefghijklmnopqrstuvwxyz'. charset addAll: '0123456789'. charset add: Character space. charset addAll: '''()+,-./:=?'. ^AlphabetConstraint with: ( ValueUnionConstraint withAll: charset )
defaultSymbol ^#'PrintableString'
</methods> <methods> ASN1.SET_OF class <category>defaults</category>
defaultConstraintValue ^BlockConstraint with: [ :x | x class == OrderedCollection ]
defaultSymbol ^#'SET OF'
</methods> <methods> ASN1.GraphicString class <category>defaults</category>
defaultSymbol ^#'GraphicString'
</methods> <methods> Core.Integer <category>ASN.1</category>
asAsn1Enumeration: anENUMERATED ^ASN1.Enumeration type: anENUMERATED value: self
</methods> <methods> Core.Association <category>converting</category>
asAsn1EnumerationElement "... assumes the key is aSymbol and the value is anInteger." ^ASN1.EnumerationElement symbol: key integer: value
</methods> <methods> ASN1.Struct <category>converting</category>
asAsn1Choice: aCHOICE "Simpler version of Choice constructor for unambiguous CHOICEs. If in doubt use #asAsnChoice:symbol: instead." ^ASN1.Choice type: aCHOICE value: self
asAsn1Choice: aCHOICE symbol: choice ^Choice type: aCHOICE choiceSymbol: choice value: self
withAsn1Type: anAsn1Type ^ASN1.TypeWrapper type: anAsn1Type value: self
</methods> <methods> ASN1.Struct <category>testing</category>
_isTypeWrapper ^false
</methods> <methods> ASN1.Module <category>definitions</category>
ANY: aSymbol ^ANY name: aSymbol in: self
BIT_STRING: aSymbol ^BIT_STRING name: aSymbol in: self
BMPString: aSymbol ^BMPString name: aSymbol in: self
BOOLEAN: aSymbol ^BOOLEAN name: aSymbol in: self
CHOICE: aSymbol ^CHOICE name: aSymbol in: self
</methods> <methods> ASN1.Module <category>private</category>
doesNotUnderstand: aMessage "Allow finding a type by using its name as a message to the module instance. Allow using a name of an already existing type as a single keyword message, to mimic behavior of messages for standard types #SEQUENCE:, #BOOLEAN:, etc" | type | aMessage selector first isUppercase ifFalse: [ ^super doesNotUnderstand: aMessage ]. aMessage arguments isEmpty ifTrue: [ ^self find: aMessage selector ]. aMessage arguments size > 1 ifTrue: [ ^super doesNotUnderstand: aMessage ]. type := (aMessage selector asString copyWithout: $:) asSymbol. type := self find: type ifAbsent: [ ^super doesNotUnderstand: aMessage ]. ^type named: aMessage arguments first in: self
</methods> <methods> ASN1.Module <category>definitions</category>
ENUMERATED: aSymbol ^ENUMERATED name: aSymbol in: self
</methods> <methods> ASN1.Module <category>services</category>
find: aSymbol " aSymbol <Symbol> the name of the type ^<Asn1Entity> " ^self find: aSymbol ifAbsent: [ | defaultSymbol | "Allow specifying basic types using the #defaultSymbol with spaces or underscores" defaultSymbol := (aSymbol includes: $_) ifTrue: [ (aSymbol asString replaceAll: $_ with: $ ) asSymbol ] ifFalse: [ aSymbol ]. ( Type allSubclasses detect: [ :class | class isConcrete and: [ class defaultSymbol = defaultSymbol ] ] ifNone: [ nil ] ) ifNil: [ TypeReference name: aSymbol in: self ] ifNotNil: [ :class | (class inheritsFrom: BasicType) "only basic types can be referenced this way" ifTrue: [ class new ] ifFalse: [ InvalidTypeReference new messageText: (#InvalidType1s << #asn1 >> '<1s> is not a valid type!' expandMacrosWith: aSymbol); parameter: aSymbol; raise ] ] ]
</methods> <methods> ASN1.Module <category>definitions</category>
GeneralizedTime: aSymbol ^GeneralizedTime name: aSymbol in: self
GeneralString: aSymbol ^GeneralString name: aSymbol in: self
GraphicString: aSymbol ^GraphicString name: aSymbol in: self
IA5String: aSymbol ^IA5String name: aSymbol in: self
INTEGER: aSymbol ^INTEGER name: aSymbol in: self
</methods> <methods> ASN1.Module <category>services</category>
new: aTypeSpec named: aSymbol ^(self typeFrom: aTypeSpec) named: aSymbol in: self
</methods> <methods> ASN1.Module <category>definitions</category>
NULL: aSymbol ^NULL name: aSymbol in: self
NumericString: aSymbol ^NumericString name: aSymbol in: self
OBJECT_IDENTIFIER: aSymbol ^OBJECT_IDENTIFIER name: aSymbol in: self
OCTET_STRING: aSymbol ^OCTET_STRING name: aSymbol in: self
PrintableString: aSymbol ^PrintableString name: aSymbol in: self
SEQUENCE: aSymbol ^SEQUENCE name: aSymbol in: self
SEQUENCE: aSymbol OF: aTypeSpec " aSymbol <Symbol> aTypeSpect <Symbol | Asn1Type> ^<Asn1TypeSEQUENCE_OF> " ^(SEQUENCE_OF name: aSymbol in: self) elementType: aTypeSpec; yourself
SET: aSymbol ^SET name: aSymbol in: self
SET: aSymbol OF: aTypeSpec " aSymbol <Symbol> aTypeSpect <Symbol | Asn1Type> ^<Asn1TypeSET_OF> " ^(SET_OF name: aSymbol in: self) elementType: aTypeSpec; yourself
</methods> <methods> ASN1.Module <category>services</category>
typeFrom: aTypeSpec "Turn an acceptable form of type specification into the real type instance. aTypeSpect <Symbol | Asn1Type | Class> a type name, or basic type #defaultSymbol or class, or the type instance itself ^<Asn1Type> " "Allow specifying type with a type instance itself" (aTypeSpec isKindOf: Type) ifTrue: [ ^aTypeSpec ]. "Allow specifying basic types using type class" aTypeSpec isBehavior ifTrue: [ ^aTypeSpec new ]. "Otherwise expect a type name and look it up" ^self find: aTypeSpec
</methods> <methods> ASN1.Module <category>definitions</category>
UniversalString: aSymbol ^UniversalString name: aSymbol in: self
UTCTime: aSymbol ^UTCTime name: aSymbol in: self
UTF8String: aSymbol ^UTF8String name: aSymbol in: self
VisibleString: aSymbol ^VisibleString name: aSymbol in: self
</methods> <methods> Core.Object <category>ASN.1</category>
asAsn1Choice: aCHOICE "Simpler version of Choice constructor for unambiguous CHOICEs. If in doubt use #asAsnChoice:symbol: instead." ^ASN1.Choice type: aCHOICE value: self
asAsn1Choice: aCHOICE symbol: choice ^ASN1.Choice type: aCHOICE choiceSymbol: choice value: self
withAsn1Type: anAsn1Type ^ASN1.TypeWrapper type: anAsn1Type value: self
_isTypeWrapper ^false
</methods> <methods> Core.Symbol <category>ASN.1</category>
asAsn1Enumeration: anENUMERATED ^ASN1.Enumeration type: anENUMERATED symbol: self
</methods> <methods> Core.Symbol <category>converting</category>
asAsn1EnumerationElement ^ASN1.EnumerationElement symbol: self
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>Association</name> <environment>Core</environment> <super>Core.LookupKey</super> <private>false</private> none value <imports></imports> <category>Collections-Support</category> <attributes> <package>Collections-Support</package> </attributes> </class> <class> <name>Entity</name> <environment>ASN1</environment> <super>Core.Object</super> <private>false</private> none symbol module <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Support</package> </attributes> </class> <class> <name>Integer</name> <environment>Core</environment> <super>Core.Number</super> <private>false</private> none <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>Asn1Error</name> <environment>ASN1</environment> <super>Core.Error</super> <private>false</private> none <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Support</package> </attributes> </class> <class> <name>Module</name> <environment>ASN1</environment> <super>Core.Object</super> <private>false</private> none name oid definitions exports imports tagging extensibility <imports></imports> <category>ASN1</category> <attributes> <package>ASN1-Support</package> </attributes> </class> <class> <name>Symbol</name> <environment>Core</environment> <super>Core.String</super> <private>false</private> none <imports></imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>Struct</name> <environment>ASN1</environment> <super>Protocols.Struct</super> <private>false</private> objects encoding <imports></imports> <category>ASN1-Support</category> <attributes> <package>ASN1-Support</package> </attributes> </class> <class> <name>MessageForwarder</name> <environment>Protocols</environment> <super></super> <private>false</private> none object <imports></imports> <category>Protocols-Common</category> <attributes> <package>Protocols-Common</package> </attributes> </class>