Asn1Tag 结构

定义

此类型表示 ASN.1 标记,如 ITU-T 建议 X.680 中所述。This type represents an ASN.1 tag, as described in ITU-T Recommendation X.680.

public value class Asn1Tag : IEquatable<System::Formats::Asn1::Asn1Tag>
public struct Asn1Tag : IEquatable<System.Formats.Asn1.Asn1Tag>
type Asn1Tag = struct
Public Structure Asn1Tag
Implements IEquatable(Of Asn1Tag)
继承
Asn1Tag
实现

构造函数

Asn1Tag(TagClass, Int32, Boolean)

为指定标记类中的指定值创建 Asn1TagCreate an Asn1Tag for a specified value within a specified tag class.

Asn1Tag(UniversalTagNumber, Boolean)

为通用类中的标记创建 Asn1TagCreate an Asn1Tag for a tag from the UNIVERSAL class.

字段

Boolean

表示布尔值的通用类标记。Represents the universal class tag for a Boolean value.

ConstructedBitString

表示采用结构化编码的位字符串值的通用类标记。Represents the universal class tag for a Bit String value under a constructed encoding.

ConstructedOctetString

表示采用结构化编码的八进制字符串值的通用类标记。Represents the universal class tag for a Octet String value under a constructed encoding.

Enumerated

表示枚举值的通用类标记。Represents the universal class tag for an Enumerated value.

GeneralizedTime

表示 GeneralizedTime 值的通用类标记。Represents the universal class tag for a GeneralizedTime value.

Integer

表示整数值的通用类标记。Represents the universal class tag for an Integer value.

Null

表示 null 值的通用类标记。Represents the universal class tag for a null value.

ObjectIdentifier

表示对象标识符值的通用类标记。Represents the universal class tag for an Object Identifier value.

PrimitiveBitString

表示采用原始编码的位字符串值的通用类标记。Represents the universal class tag for a Bit String value under a primitive encoding.

PrimitiveOctetString

表示采用原始编码的八进制字符串值的通用类标记。Represents the universal class tag for an Octet String value under a primitive encoding.

Sequence

表示序列值的通用类标记(始终采用结构化编码)。Represents the universal class tag for a Sequence value (always a constructed encoding).

SetOf

表示 SetOf 值的通用类标记(始终采用结构化编码)。Represents the universal class tag for a SetOf value (always a constructed encoding).

UtcTime

表示 UtcTime 值的通用类标记。Represents the universal class tag for a UtcTime value.

属性

IsConstructed

指示标记表示结构化编码 (true) 还是原始编码 (false)。Indicates if the tag represents a constructed encoding (true), or a primitive encoding (false).

TagClass

此标记所属于的标记类。The tag class to which this tag belongs.

TagValue

此标记的数值。The numeric value for this tag.

方法

AsConstructed()

生成一个具有相同的 TagClassTagValue 值的标记,但其 IsConstructedtrueProduces a tag with the same TagClass and TagValue values, but whose IsConstructed is true.

AsPrimitive()

生成一个具有相同的 TagClassTagValue 值的标记,但其 IsConstructedfalseProduces a tag with the same TagClass and TagValue values, but whose IsConstructed is false.

CalculateEncodedSize()

报告此标记的 BER 编码所需的字节数。Reports the number of bytes required for the BER-encoding of this tag.

Decode(ReadOnlySpan<Byte>, Int32)

读取从 source 开始的 BER 编码标记。Reads a BER-encoded tag which starts at source.

Encode(Span<Byte>)

将此标记的 BER 编码形式写入到 destinationWrites the BER-encoded form of this tag to destination.

Equals(Asn1Tag)

测试 other 的编码是否与此标记相同。Tests if other has the same encoding as this tag.

Equals(Object)

测试 obj 是否是 Asn1Tag 并且与此标记的编码相同。Tests if obj is an Asn1Tag with the same encoding as this tag.

GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

HasSameClassAndValue(Asn1Tag)

测试 otherTagClassTagValue 值是否与此标记相同,不比较 IsConstructedTests if other has the same TagClass and TagValue values as this tag, and does not compare IsConstructed.

ToString()

提供此标记的便于调试的文本表示形式。Provides a text representation of this tag suitable for debugging.

TryDecode(ReadOnlySpan<Byte>, Asn1Tag, Int32)

尝试读取从 source 开始的 BER 编码的标记。Attempts to read a BER-encoded tag which starts at source.

TryEncode(Span<Byte>, Int32)

尝试将此标记的 BER 编码形式写入到 destinationAttempts to write the BER-encoded form of this tag to destination.

运算符

Equality(Asn1Tag, Asn1Tag)

测试两个 Asn1Tag 值是否具有相同的 BER 编码。Tests if two Asn1Tag values have the same BER encoding.

Inequality(Asn1Tag, Asn1Tag)

测试两个 Asn1Tag 值是否具有不同的 BER 编码。Tests if two Asn1Tag values have a different BER encoding.

适用于