|
|
 |
 |
|
Asn1Type Class ReferenceInheritance diagram for Asn1Type:
List of all members.
Detailed Description
This is the base class for all ASN.1 built-in types.
|
Public Member Functions |
| virtual void | Decode (System.Object reader, System.IO.Stream byteStream) |
| virtual void | Decode (System.Object reader, System.String xmlURI) |
| virtual void | Decode (Asn1PerDecodeBuffer buffer) |
| virtual void | Decode (Asn1BerDecodeBuffer buffer) |
| virtual void | Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength) |
| virtual void | Encode (Asn1PerOutputStream outs) |
| virtual void | Encode (Asn1CerOutputStream outs, bool explicitTagging) |
| virtual void | Encode (Asn1BerOutputStream outs, bool explicitTagging) |
| virtual void | Encode (Asn1XerEncoder buffer, System.String elemName, System.String attribute) |
| virtual void | Encode (Asn1XmlEncodeBuffer buffer) |
| virtual void | Encode (Asn1XerEncoder buffer, System.String elemName) |
| virtual void | Encode (Asn1XerEncoder buffer) |
| virtual void | Encode (Asn1PerEncodeBuffer buffer) |
| virtual int | Encode (Asn1BerEncodeBuffer buffer) |
| virtual int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging) |
| virtual void | Indent (System.IO.TextWriter outs, int level) |
| virtual bool | IsOpenType () |
| virtual bool | MatchTypeName (System.String typeName) |
| virtual void | Pdiag (System.String s) |
| virtual void | Print (System.String varName) |
| virtual void | Print (System.IO.TextWriter outs, System.String varName, int level) |
| void | SetKey (byte[] rtkey) |
| virtual void | SetOpenType () |
Static Public Member Functions |
| static System.String | GetTypeName (short typeCode) |
Public Attributes |
| const short | BIT_STRING = 3 |
| const short | BMPString = 30 |
| const short | BOOLEAN = 1 |
| const short | ENUMERATED = 10 |
| const short | EOC = 0 |
| const short | EXTERNAL = 8 |
| const short | GeneralString = 27 |
| const short | GeneralTime = 24 |
| const short | GraphicString = 25 |
| const short | IA5String = 22 |
| const short | INTEGER = 2 |
| const short | NULL = 5 |
| const short | NumericString = 18 |
| const short | OBJECT_IDENTIFIER = 6 |
| const short | ObjectDescriptor = 7 |
| const short | OCTET_STRING = 4 |
| const short | OpenType = 99 |
| const short | PrintableString = 19 |
| const short | REAL = 9 |
| const short | RelativeOID = 13 |
| const short | SEQUENCE = 16 |
| const short | SET = 17 |
| const short | T61String = TeletexString |
| const short | TeletexString = 20 |
| const short | UniversalString = 28 |
| const short | UTCTime = 23 |
| const short | UTF8String = 12 |
| const short | VideotexString = 21 |
| const short | VisibleString = 26 |
Static Public Attributes |
| static readonly Asn1Tag | _TAG = new Asn1Tag(Asn1Tag.UNIV, Asn1Tag.PRIM, Asn1Type.EOC) |
Protected Member Functions |
| virtual internal int | MatchTag (Asn1BerDecodeBuffer buffer, Asn1Tag tag) |
| virtual internal int | MatchTag (Asn1BerDecodeBuffer buffer, short tagClass, short tagForm, int tagIDCode) |
Properties |
| virtual int | Length |
Member Function Documentation
| virtual void Decode |
( |
System.Object |
reader, |
|
|
System.IO.Stream |
byteStream |
|
) |
[virtual] |
|
|
|
This method declaration is the signature of the standard XML Encoding Rules (XER) Decode method.
Also throws any IO exception from the parser, possibly from a byte stream or character stream supplied by the application. - Parameters:
-
| reader | XML reader object |
| byteStream | Input byte stream object |
- Exceptions:
-
Implements Asn1TypeIF. |
| virtual void Decode |
( |
System.Object |
reader, |
|
|
System.String |
xmlURI |
|
) |
[virtual] |
|
|
|
This method declaration is the signature of the standard XML Encoding Rules (XER) Decode method.
Also throws any IO exception from the parser, possibly from a byte stream or character stream supplied by the application. - Parameters:
-
| reader | XML reader object |
| xmlURI | URI of a source |
- Exceptions:
-
Implements Asn1TypeIF. |
|
|
This method is the base implementation of the standard Packed Encoding Rules (PER) Decode method. It throws an exception because it should never be invoked. Inherited class implementes this method in Compiler generated code.
- Parameters:
-
| buffer | PER Encode message buffer object |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn18BitCharString, Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1ChoiceExt, Asn1Integer, Asn1Null, Asn1NumericString, Asn1ObjectIdentifier, Asn1OctetString, Asn1OpenExt, Asn1Real, Asn1RelativeOID, Asn1Time, Asn1UniversalString, Asn1UTF8String, Asn1VarWidthCharString, and Asn1XerOpenType. |
|
|
This method is used to Decode a message that is encoded in BER or DER format. This version of the method sets tagging to explicit (Asn1Tag.EXPL) and implicit length to zero.
- Parameters:
-
| buffer | Decode message buffer object |
|
| virtual void Decode |
( |
Asn1BerDecodeBuffer |
buffer, |
|
|
bool |
explicitTagging, |
|
|
int |
implicitLength |
|
) |
[virtual] |
|
|
|
This method is used to Decode a message that is encoded in BER or DER format.
- Parameters:
-
| buffer | Decode message buffer object |
| explicitTagging | Flag indicating explicit tag should be parsed from the encoded type. |
| implicitLength | Length of the contents field (only required if explicit is false). |
Implements Asn1TypeIF.
Reimplemented in Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1ChoiceExt, Asn1Enumerated, Asn1GeneralizedTime, Asn1GeneralString, Asn1GraphicString, Asn1IA5String, Asn1Integer, Asn1Null, Asn1NumericString, Asn1ObjectDescriptor, Asn1ObjectIdentifier, Asn1OctetString, Asn1OpenExt, Asn1OpenType, Asn1PrintableString, Asn1Real, Asn1RelativeOID, Asn1T61String, Asn1UniversalString, Asn1UTCTime, Asn1UTF8String, Asn1VideotexString, Asn1VisibleString, and Asn1XerOpenType. |
|
|
This method is the base implementation of the standard Packed Encoding Rules (PER) encode method using output stream. It throws an exception because it should never be invoked by compiler generated code.
Also throws any exception thrown by the Asn1PerOutputStream. - Parameters:
-
| outs | PER Output Stream object |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn18BitCharString, Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1ChoiceExt, Asn1Integer, Asn1Null, Asn1ObjectIdentifier, Asn1OctetString, Asn1OpenExt, Asn1OpenType, Asn1Real, Asn1RelativeOID, Asn1Time, Asn1UniversalString, Asn1UTF8String, and Asn1VarWidthCharString. |
|
|
This method writes to the stream an encoded ASN.1 type value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Cer Encoding Rules (CER).
Throws, Exception thrown by C# System.IO.Stream for I/O error - Parameters:
-
| outs | CER Output Stream object |
| explicitTagging | Flag indicating explicit tagging should be done |
- Exceptions:
-
|
|
|
This method writes to the stream an encoded ASN.1 type value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).
Throws, Exception thrown by C# System.IO.Stream for I/O error - Parameters:
-
| outs | BER Output Stream object |
| explicitTagging | Flag indicating explicit tagging should be done |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1ChoiceExt, Asn1Enumerated, Asn1GeneralizedTime, Asn1GeneralString, Asn1GraphicString, Asn1IA5String, Asn1Integer, Asn1Null, Asn1NumericString, Asn1ObjectDescriptor, Asn1ObjectIdentifier, Asn1OctetString, Asn1OpenExt, Asn1OpenType, Asn1PrintableString, Asn1Real, Asn1RelativeOID, Asn1T61String, Asn1UniversalString, Asn1UTCTime, Asn1UTF8String, Asn1VideotexString, and Asn1VisibleString. |
| virtual void Encode |
( |
Asn1XerEncoder |
buffer, |
|
|
System.String |
elemName, |
|
|
System.String |
attribute |
|
) |
[virtual] |
|
|
|
This method is the base implementation of the standard XML Encoding as specified in the XML schema standard(asn2xsd). It throws an exception because it should never be invoked. Inherited class implementes this method in Compiler generated code.
Also throws any exception thrown by the underlying stream. - Parameters:
-
| buffer | XML Encode message buffer object |
| elemName | XML element name of item |
| attribute | Element attribute value |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn1BigInteger, Asn1BitString, Asn1Boolean, Asn1CharString, Asn1Enumerated, Asn1GeneralizedTime, Asn1Integer, Asn1Null, Asn1ObjectIdentifier, Asn1OctetString, Asn1Real, Asn1RelativeOID, Asn1UniversalString, Asn1UTCTime, Asn1XerBase64OctetString, and Asn1XerOpenType. |
|
|
This method is the base implementation of the standard XML Encoding as specified in the XML schema standard(asn2xsd). This method invokes the generated method with element name and attribute name set to null. This will cause the ASN.1 type name to be used as the top-level element name.
Also throws any exception thrown by the underlying stream. - Parameters:
-
| buffer | XML Encode message buffer object |
- Exceptions:
-
Implements Asn1TypeIF. |
| virtual void Encode |
( |
Asn1XerEncoder |
buffer, |
|
|
System.String |
elemName |
|
) |
[virtual] |
|
|
|
This method is the base implementation of the standard XML Encoding Rules (XER) encode method. It throws an exception because it should never be invoked by compiler generated code.
Also throws any exception thrown by the underlying stream. - Parameters:
-
| buffer | XER Encode message buffer object |
| elemName | XML element name of item |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn1BigInteger, Asn1BitString, Asn1Boolean, Asn1CharString, Asn1Enumerated, Asn1Integer, Asn1Null, Asn1ObjectIdentifier, Asn1OctetString, Asn1Real, Asn1RelativeOID, Asn1UniversalString, Asn1XerBase64OctetString, and Asn1XerOpenType. |
|
|
This method is the base implementation of the standard XML Encoding Rules (XER) encode method. This method invokes the generated method with element name set to null. This will cause the ASN.1 type name to be used as the top-level element name.
Also throws any exception thrown by the underlying stream. - Parameters:
-
| buffer | XER Encode message buffer object |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn1OpenExt, and Asn1XerOpenType. |
|
|
This method is the base implementation of the standard Packed Encoding Rules (PER) encode method. It throws an exception because it should never be invoked. Inherited class implementes this method in Compiler generated code.
- Parameters:
-
| buffer | PER Encode message buffer object |
- Exceptions:
-
Implements Asn1TypeIF.
Reimplemented in Asn18BitCharString, Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1ChoiceExt, Asn1Integer, Asn1Null, Asn1NumericString, Asn1ObjectIdentifier, Asn1OctetString, Asn1OpenExt, Asn1OpenType, Asn1Real, Asn1RelativeOID, Asn1Time, Asn1UniversalString, Asn1UTF8String, Asn1VarWidthCharString, and Asn1XerOpenType. |
|
|
This method is used to encode a message in BER or DER format. This version of the method sets tagging to explicit (Asn1Tag.EXPL).
- Parameters:
-
| buffer | Decode message buffer object |
- Returns:
- Length of component or negative status value
|
|
|
This method is used to encode this data type in BER or DER format.
- Parameters:
-
| buffer | Encode message buffer object |
| explicitTagging | Flag indicating explicit tag should be added to the encoded type. |
- Returns:
- Length of component or negative status value
Implements Asn1TypeIF.
Reimplemented in Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1ChoiceExt, Asn1Enumerated, Asn1GeneralizedTime, Asn1GeneralString, Asn1GraphicString, Asn1IA5String, Asn1Integer, Asn1Null, Asn1NumericString, Asn1ObjectDescriptor, Asn1ObjectIdentifier, Asn1OctetString, Asn1OpenExt, Asn1OpenType, Asn1PrintableString, Asn1Real, Asn1RelativeOID, Asn1T61String, Asn1UniversalString, Asn1UTCTime, Asn1UTF8String, Asn1VideotexString, Asn1VisibleString, and Asn1XerOpenType. |
| static System.String GetTypeName |
( |
short |
typeCode |
) |
[static] |
|
|
|
This method will convert a type code into a type name as defined in the X.680 standard..
- Parameters:
-
| typeCode | Type code to be converted |
- Returns:
- ASN.1 type name
|
| virtual void Indent |
( |
System.IO.TextWriter |
outs, |
|
|
int |
level |
|
) |
[virtual] |
|
|
|
This method will indent three spaces in the given print stream. It is used by the print methods to provide a formatted output of an encoded element value.
- Parameters:
-
| outs | Print stream |
| level | Indentation level (no of spaces is 3 x this number) |
|
| virtual bool IsOpenType |
( |
|
) |
[virtual] |
|
|
|
Returns open type mode for XML encoding/decoding. - Returns:
true if open type mode is on.
Implements Asn1TypeIF. |
|
|
This method will compare the next parsed tag with the given tag value. If they do not match, an exception will be thrown.
- Parameters:
-
| buffer | Decode message buffer object |
| tag | Tag value to compare |
- Returns:
- Decoded length value
- Exceptions:
-
|
| virtual internal int MatchTag |
( |
Asn1BerDecodeBuffer |
buffer, |
|
|
short |
tagClass, |
|
|
short |
tagForm, |
|
|
int |
tagIDCode |
|
) |
[protected, virtual] |
|
|
|
This method will compare the next parsed tag with the given tag value. If they do not match, an exception will be thrown.
- Parameters:
-
| buffer | Decode message buffer object |
| tagClass | Tag class value (UNIV, APPL, CTXT, or PRIV) |
| tagForm | Tag form value (PRIM or CONS) |
| tagIDCode | Tag identifier code |
- Returns:
- Decoded length value
- Exceptions:
-
|
| virtual bool MatchTypeName |
( |
System.String |
typeName |
) |
[virtual] |
|
|
|
This method is used to check the outer level tag in an XER message to verify it matches the expected value. This method is overridden by generated code. The default implementation always returns true.
- Parameters:
-
| typeName | Type name to compare. |
- Returns:
- True if name matches internal name.
|
| virtual void Pdiag |
( |
System.String |
s |
) |
[virtual] |
|
|
|
This is a diagnostics print method. It is a shorthand way to invoke the Diag object's println method.
- Parameters:
-
| s | diagnostics message to be printed. |
|
| virtual void Print |
( |
System.String |
varName |
) |
[virtual] |
|
|
|
This method will format and output a primitive value to the standard console output.
- Parameters:
-
|
| virtual void Print |
( |
System.IO.TextWriter |
outs, |
|
|
System.String |
varName, |
|
|
int |
level |
|
) |
[virtual] |
|
|
|
This method will format and output a primitive value to the given print stream.
- Parameters:
-
| outs | Print output stream |
| varName | Name of variable |
| level | Indentation level |
Implements Asn1TypeIF. |
| void SetKey |
( |
byte[] |
rtkey |
) |
|
|
|
|
This method is used with the limited run-time to set a run-time key value generated by the compiler to allow the run-time to operate on the licensed hosts. This is not used in the unlimited redistribution versions. - Parameters:
-
| rtkey | Run-time key generated by ASN1C |
|
| virtual void SetOpenType |
( |
|
) |
[virtual] |
|
|
|
Sets open type mode for XML encoding/decoding.
Implements Asn1TypeIF. |
Member Data Documentation
|
|
Will hold tag for possible definitions
Reimplemented in Asn1BigInteger, Asn1BitString, Asn1BMPString, Asn1Boolean, Asn1Enumerated, Asn1GeneralizedTime, Asn1GeneralString, Asn1GraphicString, Asn1IA5String, Asn1Integer, Asn1Null, Asn1NumericString, Asn1ObjectDescriptor, Asn1ObjectIdentifier, Asn1OctetString, Asn1PrintableString, Asn1Real, Asn1RelativeOID, Asn1T61String, Asn1UniversalString, Asn1UTCTime, Asn1UTF8String, Asn1VideotexString, and Asn1VisibleString. |
|
|
ENUMERATED type code = 10 |
|
|
GeneralString type code = 27 |
|
|
GeneralTime type code = 24 |
|
|
GraphicString type code = 25 |
|
|
NumericString type code = 18 |
|
|
OBJECT_IDENTIFIER type code = 6 |
|
|
ObjectDescriptor type code = 7 |
|
|
OCTET_STRING type code = 4 |
|
|
PrintableString type code = 19 |
|
|
RELATIVE_OID type code = 13 |
|
|
T61String type code = TeletexString |
|
|
TeletexString type code = 20 |
|
|
UniversalString type code = 28 |
|
|
UTF8String type code = 12 |
|
|
VideotexString type code = 21 |
|
|
VisibleString type code = 26 |
Property Documentation
|
|
Gets the length of types that can be bound by a size constraint (BIT STRING, OCTET STRING, character string, and SEQUENCE OF/SET OF). An attempt to invoke it on any other type will cause an exception to be thrown.
Value: Length of item in units (for example, bits for BIT STRING, octets for OCTET STRING, etc.) - Exceptions:
-
| Asn1InvalidLengthException | if called by type rather than size constrainted (BIT STRING, OCTET STRING, character string, or SEQUENCE OF/SET OF) |
Reimplemented in Asn1BitString, Asn1CharString, Asn1OctetString, and Asn1UniversalString. |
|
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.
|
This file was last modified on
18 Nov 2005. ASN1C C# Runtime Library, 5.8 |
|