ASN1C C# Runtime Library
7.8
|
Public Member Functions | |
Asn1OctetString () | |
Asn1OctetString (byte[] data) | |
Asn1OctetString (byte[] data, int offset, int nbytes) | |
Asn1OctetString (System.String value) | |
virtual int | CompareTo (System.Object octstr) |
override void | Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength) |
override void | Decode (Asn1PerDecodeBuffer buffer) |
virtual void | Decode (Asn1PerDecodeBuffer buffer, long lower, long upper) |
override void | Decode (Asn1OerDecodeBuffer buffer) |
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) |
override int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging) |
override void | Encode (Asn1PerEncodeBuffer buffer) |
virtual void | Encode (Asn1PerEncodeBuffer buffer, long lower, long upper) |
override void | Encode (Asn1OerEncodeBuffer buffer) |
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) |
override void | Encode (Asn1BerOutputStream outs, bool explicitTagging) |
override void | Encode (Asn1PerOutputStream outs) |
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 (Asn1XerEncoder buffer) |
virtual void | Encode (Asn1XmlEncoder 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 () |
Static Public Member Functions | |
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 | |
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 | |
static new readonly Asn1Tag | _TAG |
Static Public Attributes inherited from Asn1Type | |
static readonly Asn1Tag | _TAG |
Properties | |
override int | Length [get] |
Properties inherited from Asn1Type | |
virtual String | AsnTypeName [get] |
virtual int | Length [get] |
This is a container class for holding the components of an ASN.1 octet string value.
Asn1OctetString | ( | ) |
This constructor creates an empty octet string that can be used in a Decode method call to receive an octet string value.
Asn1OctetString | ( | byte [] | data | ) |
This constructor initializes an octet string from the given byte array.
data | Byte array containing an octet string in binary form. |
Asn1OctetString | ( | byte [] | data, |
int | offset, | ||
int | nbytes | ||
) |
This constructor initializes an octet string 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.
data | Byte array containing an octet string in binary form. |
offset | The offset in array at which to begin copy. |
nbytes | Number of bytes to copy from target array |
Asn1OctetString | ( | System.String | value | ) |
This constructor parses the given ASN.1 value text (either a binary or hex data string) and assigns the values to the internal bit string.
Examples of valid value formats are as follows:
Binary string: '11010010111001'B
Hex string: '0fa56920014abc'H
Char string: 'abcdefg'
value | The ASN.1 value specification text |
References Asn1Value.ParseString().
|
virtual |
This method compares two Asn1OctetString objects for equality. The OCTET STRING's are equal if a) all octets are equal, and b) the lengths are the same.
This method is required to implement the Comparable interface used for sorting.
octstr | Asn1OctetString to compare |
References Asn1PerDecodeBuffer.ByteAlign(), Asn1Tag.Constructed, Asn1EncodeBuffer.Copy(), Asn1PerDecodeBuffer.DecodeBitsToOctetArray(), Asn1PerDecodeBuffer.DecodeLength(), Asn1BerEncodeBuffer.EncodeTagAndLength(), Asn1Tag.EOC, Asn1BerDecodeContext.Expired(), Asn1Status.INDEFLEN, Asn1BerDecodeBuffer.LastTag, Asn1Type.OCTET_STRING, Diag.Prtln(), Asn1DecodeBuffer.Read(), and Asn1MessageBufferBase.TypeCode.
|
virtual |
This method decodes an ASN.1 octet string value including the UNIVERSAL tag value and length if explicit tagging is specified.
buffer | Decode message buffer object |
explicitTagging | Flag indicating element is explicitly tagged |
implicitLength | Length of contents if implicit |
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
Referenced by Asn1UTF8String.Asn1UTF8String(), and Asn1OctetString.Decode().
|
virtual |
This method decodes an ASN.1 octet string value using the packed encoding rules (PER). The string is assumed to not contain a size constraint.
buffer | Decode message buffer object |
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
|
virtual |
This method decodes a sized ASN.1 octet string value using the packed encoding rules (PER).
buffer | Decode message buffer object |
lower | Lower bound (inclusive) of size constraint |
upper | Upper bound (inclusive) of size constraint |
References Asn1PerDecodeBuffer.ByteAlign(), Asn1OctetString.Decode(), Asn1PerDecodeBuffer.DecodeBitsToOctetArray(), Asn1PerDecodeBuffer.DecodeLength(), Asn1OctetString.mValue, Asn1Type.OCTET_STRING, and Asn1MessageBufferBase.TypeCode.
|
virtual |
This method decodes an ASN.1 octet string using the Octet Encoding Rules (OER).
This implementation expects a length determinant in the encoding. This method may be overridden for ASN.1 types that have a fixed length to invoke DecodeContent with the predetermined length.
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
References Asn1OerDecodeBuffer.DecodeLength().
|
virtual |
Decode an unconstrained octet string from the MDER encoding into this object.
Reimplemented from Asn1Type.
void Decode | ( | Asn1MderDecodeBuffer | buffer, |
int | constrainedLength | ||
) |
Decode an octet string from the MDER encoding into this object.
constrainedLength | The constrained length of the type being encoded. Pass -1 if the type is unconstrained. For a constrained length octet string, exactly that many octets will be read. |
References Asn1DecodeBuffer.Read(), and Asn1DecodeBuffer.Read2Bytes().
void DecodeContent | ( | Asn1OerDecodeBuffer | buffer, |
int | numOctets | ||
) |
This method decodes an ASN.1 OCTET STRING's content that was encoded according to OER, given the total number of octets. This does not decode a length determinant.
buffer | Decode message buffer object |
numOctets | Total number of octets encoding the content. |
|
virtual |
This method decodes ASN.1 octet string type using the XML encoding rules (XER). Extended-XER is supported by the base64
buffer | String containing data to be decoded |
attrs | Attributes string from element tag |
base64 | pass true if encoding is base64 (extended-XER only) |
References Asn1Util.DecodeBase64Array().
override void DecodeXML | ( | System.String | buffer, |
System.String | attrs | ||
) |
This method decodes an ASN.1 octet string type using the XML schema encoding rules(asn2xsd).
buffer | String containing data to be decoded |
attrs | Attributes string from element tag |
References Asn1Util.DecodeBase64Array().
|
virtual |
This method encodes an ASN.1 octet string value including the UNIVERSAL tag value and length if explicit tagging is specified.
buffer | Encode message buffer object |
explicitTagging | Flag indicating explicit tagging should be done |
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
|
virtual |
This method encodes an unconstrained ASN.1 octet string value using the packed encoding rules (PER). The value to be encoded is stored in the 'mValue' public member variable within this class.
buffer | Encode message buffer object |
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
References Asn1PerEncodeBuffer.EncodeOctetString().
|
virtual |
This method encodes a size-constrained ASN.1 octet string value using the packed encoding rules (PER). The value to be encoded is stored in the 'mValue' public member variable within this class.
buffer | Encode message buffer object |
lower | Lower bound (inclusive) of size constraint |
upper | Upper bound (inclusive) of size constraint |
References Asn1PerEncodeBuffer.ByteAlign(), Asn1PerEncodeBuffer.EncodeBits(), Asn1PerEncodeBuffer.EncodeLength(), Asn1PerEncodeBuffer.EncodeOctetString(), Asn1DecodeBuffer.Read(), and Asn1MessageBufferBase.TypeCode.
|
virtual |
This method encodes this ASN.1 OCTET STRING value, according to OER. This encodes the length determinant, assuming that the OCTET STRING is not fixed-size constrained. Subclasses may override this to simply call EncodeContent for fixed-size constrained strings.
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
References Asn1OerEncodeBuffer.EncodeLength().
|
virtual |
Encode this octet string into the MDER encoding. This should be used for octet string types that are not of fixed length.
Asn1MderUnsupported | if the actual length > 65535 (maximum allowed by MDER). |
Reimplemented from Asn1Type.
void Encode | ( | Asn1MderOutputStream | outs, |
int | constrainedLength | ||
) |
Encode this octet string into the MDER encoding.
constrainedLength | The constrained length of the type being encoded. Pass -1 if the type is unconstrained. |
Asn1ConsVioException | if a constrained length is given and the value is not exactly that length. |
Asn1MderUnsupported | if the length is unconstrained and the actual length > 65535 (maximum allowed by MDER). |
References Asn1XerEncoder.EncodeEmptyElement(), Asn1XerEncoder.EncodeEndElement(), Asn1XmlXerEncoder.EncodeHexStrValue(), Asn1XerEncoder.EncodeStartElement(), Asn1XmlXerEncoder.Indent(), Asn1OutputStream.Write(), and Asn1OutputStream.Write2Bytes().
|
virtual |
This method encodes ASN.1 octet string type using the XML encoding rules (XER).
buffer | Encode message buffer object |
elemName | XML element name used to wrap string |
Reimplemented from Asn1Type.
|
virtual |
This method encodes ASN.1 octet string type as an xmlhstring.
buffer | Encode message buffer object |
elemName | XML element name used to wrap string |
nsPrefix | Element namespace value |
Reimplemented from Asn1Type.
|
virtual |
This method encodes ASN.1 octet string type using the XML Encoding as specified in the XML schema standard(asn2xsd).
buffer | Encode message buffer object |
elemName | XML element name used to wrap string |
nsPrefix | Element namespace value |
base64 | Pass true to encode as base64 (extended-XER only, including XSD compilation) |
References Asn1XmlXerEncoder.Copy(), Asn1XmlEncoder.EncodeEmptyElement(), Asn1XmlEncoder.EncodeEndElement(), Asn1XmlXerEncoder.EncodeHexStrValue(), Asn1XmlEncoder.EncodeStartElement(), and Asn1XmlXerEncoder.Indent().
|
virtual |
This method encodes and writes to the stream an ASN.1 octet string 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
outs | BER Output Stream object |
explicitTagging | Flag indicating explicit tagging should be done |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
|
virtual |
This method encodes an unconstrained ASN.1 octet string value using the packed encoding rules (PER). The value to be encoded is stored in the 'mValue' public member variable within this class.
Also throws any exception thrown by the underlying Asn1PerOutputStream.
outs | PER Output Stream object |
Asn1Exception | Thrown, if operation is failed. |
Reimplemented from Asn1Type.
Reimplemented in Asn1OpenType.
|
virtual |
This method encodes a size-constrained ASN.1 octet string value using the packed encoding rules (PER). The value to be encoded is stored in the 'mValue' public member variable within this class.
Also throws any exception thrown by the underlying Asn1PerOutputStream.
outs | PER Output Stream object |
lower | Lower bound (inclusive) of size constraint |
upper | Upper bound (inclusive) of size constraint |
Asn1Exception | Thrown, if operation is failed. |
|
virtual |
This method encodes ASN.1 octet string type using the XML Encoding as specified in the XML schema standard(asn2xsd).
buffer | Encode message buffer object |
elemName | XML element name used to wrap string |
attribute | Element attribute value |
Reimplemented from Asn1Type.
References Asn1XmlXerEncoder.Copy().
|
static |
Encodes xsd:Base64Binary data into ASCII character using the algorithm defined in RFC2045, as defined in w3c stadard http://www.w3.org/tr/2001/rec-xmlschema-2-20010502#base64Binary
base64binary | Array containing base64binary |
References Asn1Tag.PRIM, and Asn1Tag.UNIV.
Referenced by Asn1XmlEncodeBuffer.EncodeXSIAttrs().
void EncodeContent | ( | Asn1OerEncodeBuffer | buffer | ) |
This method encodes the content of an ASN.1 OCTET STRING, according to OER. (The length determinant is not encoded.)
buffer | Encode message buffer object |
References Asn1EncodeBuffer.Copy().
bool Equals | ( | byte [] | value | ) |
This method compares this octet string value to the given value for equality.
value | The byte array to compare with the current Object. |
true
if the specified byte array is equal to the current Object; otherwise, false
. bool Equals | ( | String | s | ) |
This method compares the given ASN.1 OCTET STRING value to this OCTET STRING value for equality.
value | The ASN.1 OCTET STRING value to compare with the current Object. Examples of valid value formats are as follows: Binary string: '11010010111001'B Hex string: '0fa56920014abc'H |
true
if the specified value is equal to this value; otherwise, false
. References Asn1Value.StringEqualsBytes().
override bool Equals | ( | System.Object | value | ) |
This method compares this octet string value to the given value for equality.
value | The Object to compare with the current Object. Object should be instance of Asn1OctetString. |
true
if the specified Object is equal to the current Object; otherwise, false
. References Asn1OctetString.mValue.
override int GetHashCode | ( | ) |
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
int GetMderLength | ( | ) |
Return the length of the MDER encoding for this type, assuming that the type is NOT a fixed length OCTET STRING (if it is fixed length, you need not call this method!).
|
static |
This method decodes an ASN.1 octet string value using the packed encoding rules (PER). The string is assumed to not contain a size constraint.
buffer | Decode message buffer object |
References Asn1PerDecodeBuffer.ByteAlign(), Asn1PerDecodeBuffer.DecodeLength(), Asn1Type.OCTET_STRING, Diag.Prtln(), Asn1DecodeBitBuffer.SkipBits(), and Asn1MessageBufferBase.TypeCode.
|
static |
This method decodes a sized ASN.1 octet string value using the packed encoding rules (PER).
buffer | Decode message buffer object |
lower | Lower bound (inclusive) of size constraint |
upper | Upper bound (inclusive) of size constraint |
References Asn1PerDecodeBuffer.ByteAlign(), Asn1PerDecodeBuffer.DecodeLength(), Asn1Type.OCTET_STRING, Asn1DecodeBitBuffer.SkipBits(), and Asn1MessageBufferBase.TypeCode.
|
virtual |
This method will return a byte array input stream representation of the octet string value.
override System.String ToString | ( | ) |
This method will return a string representation of the octet string value. The format is the ASN.1 value format for this type..
References Asn1BerOutputStream.EncodeOctetString(), Asn1PerEncodeBuffer.EncodeOctetString(), and Asn1Util.ToHexString().
|
static |
The _TAG
constant describes the universal tag for this data type (UNIVERSAL 4).
Referenced by Asn1BMPString.Decode(), Asn1UniversalString.Decode(), Asn1CerOutputStream.EncodeBMPString(), Asn1CerOutputStream.EncodeOctetString(), Asn1CerOutputStream.EncodeUnivString(), and Asn1CharString.validate().
byte [] mValue |
This variable holds the octet string value. These are the octets that are encoded when encode is invoked. It is also where the decoded octet string is stored after a Decode operation.
Referenced by Asn1UTF8String.Asn1UTF8String(), Asn1OctetString.Decode(), Asn1OpenType.SaxHandler.EndElement(), and Asn1OctetString.Equals().
|
get |
Gets the length of the OCTET STRING in octets.
Value:
length of the octet string