ASN1C C# Runtime Library
7.8
|
Classes | |
class | SaxHandler |
Public Member Functions | |
Asn1OpenType () | |
Asn1OpenType (byte[] data) | |
Asn1OpenType (byte[] data, int encoding) | |
Asn1OpenType (byte[] data, int offset, int nbytes) | |
Asn1OpenType (byte[] data, int offset, int nbytes, int encoding) | |
Asn1OpenType (Asn1EncodeBuffer buffer) | |
Asn1OpenType (string data, int encoding) | |
Asn1OpenType (char[] data, int encoding) | |
override void | Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength) |
override void | Decode (Asn1PerDecodeBuffer buffer) |
override void | Decode (Asn1OerDecodeBuffer buffer) |
override int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging) |
override void | Encode (Asn1PerEncodeBuffer buffer) |
override void | Encode (Asn1OerEncodeBuffer buffer) |
override void | Encode (Asn1XmlEncoder buffer, String elemName, String nsPrefix) |
override void | Encode (Asn1XmlEncoder buffer) |
override void | Encode (Asn1XerEncoder buffer, String elemName) |
override void | Encode (Asn1XerEncoder buffer) |
override void | Encode (Asn1BerOutputStream outs, bool explicitTagging) |
override void | Encode (Asn1PerOutputStream outs) |
void | EncodeAsExtension (Asn1XmlEncoder buffer) |
void | EncodeAsExtension (Asn1XerEncoder buffer) |
char [] | GetCharData () |
int | GetDataEncoding () |
virtual Asn1XerSaxHandler | GetSaxHandler () |
virtual Asn1XerSaxHandler | GetSaxHandler (bool captureOuterElem) |
void | SetBinaryData (byte[] data, int encoding) |
void | SetCharData (String data, int encoding) |
void | SetCharData (char[] data, int encoding) |
override System.String | ToString () |
Public Member Functions inherited from Asn1OctetString | |
Asn1OctetString () | |
Asn1OctetString (byte[] data) | |
Asn1OctetString (byte[] data, int offset, int nbytes) | |
Asn1OctetString (System.String value) | |
virtual int | CompareTo (System.Object octstr) |
virtual void | Decode (Asn1PerDecodeBuffer buffer, long lower, long upper) |
override void | Decode (Asn1MderDecodeBuffer buffer) |
void | Decode (Asn1MderDecodeBuffer buffer, int constrainedLength) |
void | DecodeContent (Asn1OerDecodeBuffer buffer, int numOctets) |
virtual void | DecodeXER (System.String buffer, System.String attrs, bool base64) |
override void | DecodeXML (System.String buffer, System.String attrs) |
virtual void | Encode (Asn1PerEncodeBuffer buffer, long lower, long upper) |
override void | Encode (Asn1MderOutputStream outs) |
void | Encode (Asn1MderOutputStream outs, int constrainedLength) |
override void | Encode (Asn1XerEncoder buffer, System.String elemName) |
override void | Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix) |
virtual void | Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix, bool base64) |
virtual void | Encode (Asn1PerOutputStream outs, long lower, long upper) |
override void | EncodeAttribute (Asn1XmlEncoder buffer, System.String attrName) |
void | EncodeContent (Asn1OerEncodeBuffer buffer) |
bool | Equals (byte[] value) |
bool | Equals (String s) |
override bool | Equals (System.Object value) |
override int | GetHashCode () |
int | GetMderLength () |
virtual System.IO.Stream | toInputStream () |
override System.String | ToString () |
Public Member Functions inherited from Asn1Type | |
void | _SetKey (byte[] rtkey) |
virtual void | Decode (Asn1BerDecodeBuffer buffer) |
virtual void | Decode (System.Object reader, System.String xmlURI) |
virtual void | Decode (System.Object reader, System.IO.Stream byteStream) |
virtual void | DecodeXML (String buffer, String attrs) |
virtual int | Encode (Asn1BerEncodeBuffer buffer) |
virtual void | Encode (Asn1XmlEncodeBuffer buffer) |
virtual void | Encode (Asn1MderOutputStream buffer, bool useCachedLength) |
virtual void | Encode (Asn1CerOutputStream outs, bool explicitTagging) |
void | EncodeAsOpenType (Asn1OerEncodeBuffer buffer) |
virtual bool | Equals (Asn1Type obj) |
String | GetNonParameterizedTypeName () |
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.IO.TextWriter outs, System.String varName, int level) |
virtual void | Print (System.String varName) |
void | SetNonParameterizedTypeName (String value) |
virtual void | SetOpenType () |
Protected Attributes | |
int | dataEncoding |
Additional Inherited Members | |
Static Public Member Functions inherited from Asn1OctetString | |
static System.String | EncodeBase64Binary (byte[] data) |
static void | Skip (Asn1PerDecodeBuffer buffer) |
static void | Skip (Asn1PerDecodeBuffer buffer, long lower, long upper) |
Static Public Member Functions inherited from Asn1Type | |
static void | _SetKey2 (byte[] rtkey) |
static void | _SetLicLocation (String path) |
static Asn1Type | Decode (Asn1BerDecodeBuffer buffer, Asn1OpenTypeField openTypeField, bool explicitTag, int implicitLength) |
static Asn1Type | Decode (Asn1OerDecodeBuffer buffer, Asn1OpenTypeField openTypeField) |
static Asn1Type | Decode (Asn1PerDecodeBuffer buffer, Asn1OpenTypeField openTypeField) |
static System.String | GetTypeName (short typeCode) |
Public Attributes inherited from Asn1OctetString | |
byte [] | mValue |
Public Attributes inherited from Asn1Type | |
const short | BIT_STRING = 3 |
const short | BMPString = 30 |
const short | BOOLEAN = 1 |
const short | DATE = 31 |
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 | RELATIVE_OID_IRI = 36 |
const short | RelativeOID = 13 |
const short | SEQUENCE = 16 |
const short | SET = 17 |
const short | T61String = TeletexString |
const short | TeletexString = 20 |
const short | TIME = 14 |
const short | UniversalString = 28 |
const short | UTCTime = 23 |
const short | UTF8String = 12 |
const short | VideotexString = 21 |
const short | VisibleString = 26 |
Static Public Attributes inherited from Asn1OctetString | |
static new readonly Asn1Tag | _TAG |
Static Public Attributes inherited from Asn1Type | |
static readonly Asn1Tag | _TAG |
Properties inherited from Asn1OctetString | |
override int | Length [get] |
Properties inherited from Asn1Type | |
virtual String | AsnTypeName [get] |
virtual int | Length [get] |
This is a container class for holding an ASN.1 open type value.
Where the data is internally stored and how it is interpreted is controlled by a "dataEncoding" field. You can specify the data encoding when creating the object. It will also be set when decoding. The following explains the possible data encodings:
Note especially that the data encoding indicates the encoding rules used to encode the actual value. That result is typically encoded as part of some larger encoding. The data encoding does NOT indicate the rules used for that larger encoding. For example, using an xmlhstring representation, XER and JSON will encode an open type that was previously encoded using any arbitrary encoding rules. When decoding such data, the data encoding will be UNKNOWN, not XER nor JSON.
Asn1OpenType | ( | ) |
This constructor creates an empty type that can be used in a Decode method call to receive an encoded value. The data encoding is UNKNOWN.
Asn1OpenType | ( | byte [] | data | ) |
This constructor initializes an open type from the given byte array. The array is assumed to contain a previously encoded message component. The data encoding is UNKNOWN.
data | Byte array containing a previously encoded message component. |
Asn1OpenType | ( | byte [] | data, |
int | encoding | ||
) |
This constructor initializes an open type from the given byte array. The array is assumed to contain a previously encoded message component.
data | Byte array containing a previously encoded value. |
encoding | The encoding that describes the meaning of data. Any of the encodings other than JSON. |
Asn1OpenType | ( | byte [] | data, |
int | offset, | ||
int | nbytes | ||
) |
This constructor initializes the open type from a portion of the given byte array. A new byte array is created starting at the given offset and consisting of the given number of bytes. The encoding is UNKNOWN.
data | Byte array containing a previously encoded value. |
offset | The offset in array at which to begin copy. |
nbytes | Number of bytes to copy from target array |
Asn1OpenType | ( | byte [] | data, |
int | offset, | ||
int | nbytes, | ||
int | encoding | ||
) |
This constructor initializes the open type from a portion of the given byte array. A new byte array is created starting at the given offset and consisting of the given number of bytes. /p>
data | Byte array containing a previously encoded value. |
encoding | Starting offset in data from which to copy bytes |
nbytes | Number of bytes to copy from target array |
offset | The encoding that describes the meaning of data. Any of the encodings other than JSON. |
Asn1OpenType | ( | Asn1EncodeBuffer | buffer | ) |
This constructor initializes an open type using an encoded component. This can be used if a header (for example, a ROSE header) is being prepended to a pre-encoded component. The data encoding is derived from the type of Asn1EncodeBuffer given, and is possibly UNKNOWN.
buffer | Reference to encode buffer into which component type was encoded. |
References Asn1EncodeBuffer.MsgCopy, and Asn1EncodeBuffer.MsgLength.
Asn1OpenType | ( | string | data, |
int | encoding | ||
) |
Convenience constructor. Same as Asn1OpenType(data.ToCharArray(), encoding)
Asn1OpenType | ( | char [] | data, |
int | encoding | ||
) |
Create Asn1OpenType on the given character data. /p>
data | The character data array. |
encoding | The encoding. Either XER or JSON. If JSON, data is taken to be the JSON encoding of the actual value. The array is not copied, so beware using it after passing it here. The "mValue" field will be assigned null. If XER, data is taken to be the XER encoding of the actual value. The "mValue" field will be assigned the UTF-8 character encoding of the given characters. |
|
virtual |
This method decodes an ASN.1 open type value. The data encoding will be set to BER.
buffer | Decode message buffer object |
explicitTagging | Flag indicating element is explicitly tagged |
implicitLength | Length of contents if implicit |
Reimplemented from Asn1OctetString.
Referenced by Asn1OpenExt.DecodeComponent(), Asn1OpenExt.DecodeOpenType(), Asn1OpenExt.SetOpenType(), and Asn1OpenExt.ShrinkArray().
|
virtual |
This method decodes an ASN.1 open type value using the packed encoding rules (PER). The data encoding will be set to PER.
buffer | Decode message buffer object |
Reimplemented from Asn1OctetString.
|
virtual |
This method decodes an ASN.1 open type value using the Octet Encoding Rules (OER). This object will subsequently contain the encoding of the open type (which should be OER).
Reimplemented from Asn1OctetString.
|
virtual |
This method encodes an ASN.1 open type value. The value is assumed to be an already-encoded BER message component and will be copied to the encoded buffer. An optimization is available in which no copy will performed if the encoded component is already present in the encode buffer. This is done if the form of constructor specifiying only a component length is used.
buffer | Encode message buffer object |
explicitTagging | Flag indicating element is explicitly tagged |
Reimplemented from Asn1OctetString.
Referenced by Asn1OpenExt.Encode(), and Asn1OpenExt.ToString().
|
virtual |
This method encodes an ASN.1 open type value using the Packed Encoding Rules (PER). The data should be the value pre-encoded encoded in PER.
buffer | Encode message buffer object |
Reimplemented from Asn1OctetString.
References Asn1PerEncodeBuffer.EncodeOpenType().
|
virtual |
This method encodes an ASN.1 open type value using the Octet Encoding Rules (OER). The data should be the value pre-encoded in OER.
buffer | Encode message buffer object |
Reimplemented from Asn1OctetString.
References Asn1XmlXerEncoder.Copy(), Asn1EncodeBuffer.Copy(), Asn1OerEncodeBuffer.EncodeLength(), Asn1XmlXerEncoder.Indent(), and Asn1Util.ToHexString().
override void Encode | ( | Asn1XmlEncoder | buffer, |
String | elemName, | ||
String | nsPrefix | ||
) |
This method encodes an ASN.1 open type value using the XML Encoding as specified in the XML schema standard(asn2xsd). If the data encoding is XER, the data is written as-is. Otherwise, the data's hexadecimal representation is encoded (i.e. xmlhstring).
buffer | Encode message buffer object |
elemName | Ignored |
nsPrefix | Ignored |
References Asn1XmlEncoder.EncodeEndElement(), and Asn1XmlEncoder.EncodeStartElement().
|
virtual |
This method encodes an ASN.1 open type value using the XML Encoding as specified in the XML schema standard(asn2xsd).
If the data encoding is XER, the data is written as-is. Otherwise, the data's hexadecimal representation is encoded (i.e. xmlhstring).
buffer | Encode message buffer object |
Reimplemented from Asn1Type.
References Asn1XmlXerEncoder.Copy(), and Asn1XmlXerEncoder.EncodeHexStrValue().
override void Encode | ( | Asn1XerEncoder | buffer, |
String | elemName | ||
) |
This method encodes an ASN.1 open type value using the XML Encoding as specified in the XML schema standard(asn2xsd).
If the data encoding is XER, the data is written as-is. Otherwise, the data's hexadecimal representation is encoded (i.e. xmlhstring).
buffer | Encode message buffer object |
elemName | Ignored |
References Asn1XerEncoder.EncodeEndElement(), and Asn1XerEncoder.EncodeStartElement().
|
virtual |
This method encodes an ASN.1 open type value using the XML Encoding Rules (XER).
If the data encoding is XER, the data is written as-is. Otherwise, the data's hexadecimal representation is encoded (i.e. xmlhstring).
buffer | Encode message buffer object |
Reimplemented from Asn1Type.
References Asn1XmlXerEncoder.Copy(), Asn1XmlXerEncoder.EncodeHexStrValue(), Asn1XmlXerEncoder.Indent(), Asn1XerEncoder.State, and Asn1XerEncoder_Fields.XEREND.
|
virtual |
This method encodes and writes to the stream an ASN.1 open type value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER). The data should be the value pre-encoded in BER.
Throws, Exception thrown by C# System.IO.Stream for I/O error
outs | BER Output Stream object |
explicitTagging | Flag indicating explicit tagging should be done |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented from Asn1OctetString.
|
virtual |
This method encodes an ASN.1 open type value using the Packed Encoding Rules (PER). The data should be the value pre-encoded in PER.
Also throws any exception thrown by the underlying Asn1PerOutputStream.
outs | PER Output Stream object |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented from Asn1OctetString.
void EncodeAsExtension | ( | Asn1XmlEncoder | buffer | ) |
This method encodes an extension element to XML. If the data encoding is other than XER, the hexadecimal representation of the data is encoded inside an XML comment.
buffer | Encode message buffer object |
References Asn1XmlXerEncoder.Indent().
Referenced by Asn1OpenExt.ShrinkArray().
void EncodeAsExtension | ( | Asn1XerEncoder | buffer | ) |
This method encodes an extension element to XML. If the data encoding is other than XER, its hexadecimal representation is encoded inside an XML comment.
buffer |
References Asn1XmlXerEncoder.Indent(), Asn1XerEncoder.State, and Asn1XerEncoder_Fields.XEREND.
char [] GetCharData | ( | ) |
Returns the character data for the open type. Currently, this is only supported when getDataEncoding() returns JSON.
RuntimeException | if data encoding indicates there is no char data |
int GetDataEncoding | ( | ) |
Return the data encoding of the data.
References Asn1BerDecodeBuffer.DecodeOpenType(), Asn1Type.OpenType, and Asn1MessageBufferBase.TypeCode.
|
virtual |
This method returns the Asn1XerOpenType.SaxHandler class instance used for ASN.1 XER encoding. If this is the first invocation of any of the GetSaxHandler methods on this object, the returned handler will capture the outer element start/end tags. Otherwise, this will simply return the same SAX handler as previously returned.
|
virtual |
This method returns the Asn1XerOpenType.SaxHandler class instance used for ASN.1 XER encoding.
captureOuterElem | Pass true if the outer element start and end tags (if present) should be captured. The outer element is the element for which startElement is called when the level is the start level. Note that this parameter is ignored if you have previously invoked one of the getSaxHandler methods on this object. |
void SetBinaryData | ( | byte [] | data, |
int | encoding | ||
) |
Sets the binary data for the open type and assigns the data encoding to the given encoding.
data | The binary data that make up an encoding of the actual value. |
encoding | Identifies the encoding rules for which data is an encoding. This can be any of the encodings except JSON. |
void SetCharData | ( | String | data, |
int | encoding | ||
) |
Convenience method; same as SetCharData(mValue.toCharArray(), encoding)
void SetCharData | ( | char [] | data, |
int | encoding | ||
) |
Sets the character data for the open type and assigns the data encoding to the given encoding.
data | The character data that make up an encoding of the actual value. |
encoding | Permissible values are JSON and XER. If XER, the given data will be converted to bytes using UTF-8 and held in the "mValue" field. If JSON, the given data will be held as-is. The array will not be copied. The "mValue" field will be assigned null. |
override System.String ToString | ( | ) |
This method will return a string representation of the open type value. If the data encoding is XER or JSON, the string will consist of the corresponding characters (in the case of XER, the byte data is converted to characters using UTF-8). In all other cases, the hexadecimal representation of the byte data is returned.
References Asn1PerOutputStream.EncodeOpenType(), and Asn1OutputStream.Write().
Referenced by Asn1OpenExt.SetOpenType(), and Asn1OpenExt.ToString().
|
protected |
Specifies the nature of the data held by this object. /p>
Referenced by Asn1OpenType.SaxHandler.EndElement().