ValueAsnReader.ReadNamedBitListValue 메서드

정의

오버로드

Name Description
ReadNamedBitListValue(Type, Nullable<Asn1Tag>)

다음 값을 지정된 태그가 있는 NamedBitList로 읽어 지정된 [FlagsAttribute] 열거형 flagsEnumType으로 변환합니다.

ReadNamedBitListValue<TFlagsEnum>(Nullable<Asn1Tag>)

다음 값을 지정된 태그가 있는 NamedBitList로 읽어 지정된 [FlagsAttribute] 열거형 TFlagsEnum으로 변환합니다.

ReadNamedBitListValue(Type, Nullable<Asn1Tag>)

Source:
AsnDecoder.NamedBitList.cs

다음 값을 지정된 태그가 있는 NamedBitList로 읽어 지정된 [FlagsAttribute] 열거형 flagsEnumType으로 변환합니다.

public Enum ReadNamedBitListValue(Type flagsEnumType, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.ReadNamedBitListValue : Type * Nullable<System.Formats.Asn1.Asn1Tag> -> Enum
Public Function ReadNamedBitListValue (flagsEnumType As Type, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As Enum

매개 변수

flagsEnumType
Type

대상 형식을 나타내는 형식 개체입니다.

expectedTag
Nullable<Asn1Tag>

읽기 전에 확인할 태그입니다.

반품

로 변환된 NamedBitList 값입니다 flagsEnumType.

예외

다음 값에는 올바른 태그가 없습니다.

-또는-

길이 인코딩은 현재 인코딩 규칙에 따라 유효하지 않습니다.

-또는-

콘텐츠는 현재 인코딩 규칙에 따라 유효하지 않습니다.

-또는-

인코딩된 값이 너무 커서 값에 flagsEnumType 맞지 않습니다.

flagsEnumType 가 열거형 형식이 아닌 경우

 -or-

 <code data-dev-comment-type="paramref">flagsEnumType</code> was not declared with <xref data-throw-if-not-resolved="true" uid="System.FlagsAttribute"></xref>

 -or-

 <code data-dev-comment-type="paramref">expectedTag</code>.<xref data-throw-if-not-resolved="true" uid="System.Formats.Asn1.Asn1Tag.TagClass"></xref> is
 <xref data-throw-if-not-resolved="true" uid="System.Formats.Asn1.TagClass.Universal"></xref>, but
 <code data-dev-comment-type="paramref">expectedTag</code>.<xref data-throw-if-not-resolved="true" uid="System.Formats.Asn1.Asn1Tag.TagValue"></xref> is not correct for
 the method.

flagsEnumTypenull인 경우

추가 정보

적용 대상

ReadNamedBitListValue<TFlagsEnum>(Nullable<Asn1Tag>)

Source:
AsnDecoder.NamedBitList.cs

다음 값을 지정된 태그가 있는 NamedBitList로 읽어 지정된 [FlagsAttribute] 열거형 TFlagsEnum으로 변환합니다.

public TFlagsEnum ReadNamedBitListValue<TFlagsEnum>(System.Formats.Asn1.Asn1Tag? expectedTag = default) where TFlagsEnum : Enum;
member this.ReadNamedBitListValue : Nullable<System.Formats.Asn1.Asn1Tag> -> 'FlagsEnum (requires 'FlagsEnum :> Enum)
Public Function ReadNamedBitListValue(Of TFlagsEnum As Enum) (Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As TFlagsEnum

형식 매개 변수

TFlagsEnum

대상 열거형 형식입니다.

매개 변수

expectedTag
Nullable<Asn1Tag>

읽기 전에 확인할 태그입니다.

반품

TFlagsEnum

로 변환된 NamedBitList 값입니다 TFlagsEnum.

예외

다음 값에는 올바른 태그가 없습니다.

-또는-

길이 인코딩은 현재 인코딩 규칙에 따라 유효하지 않습니다.

-또는-

콘텐츠는 현재 인코딩 규칙에 따라 유효하지 않습니다.

-또는-

인코딩된 값이 너무 커서 값에 TFlagsEnum 맞지 않습니다.

TFlagsEnum 가 열거형 형식이 아닌 경우

 -or-

 <code data-dev-comment-type="typeparamref">TFlagsEnum</code> was not declared with <xref data-throw-if-not-resolved="true" uid="System.FlagsAttribute"></xref>

 -or-

 <code data-dev-comment-type="paramref">expectedTag</code>.<xref data-throw-if-not-resolved="true" uid="System.Formats.Asn1.Asn1Tag.TagClass"></xref> is
 <xref data-throw-if-not-resolved="true" uid="System.Formats.Asn1.TagClass.Universal"></xref>, but
 <code data-dev-comment-type="paramref">expectedTag</code>.<xref data-throw-if-not-resolved="true" uid="System.Formats.Asn1.Asn1Tag.TagValue"></xref> is not correct for
 the method.

설명

이 메서드에서 수행하는 비트 맞춤은 값의 첫 번째 바이트에서 가장 중요한 비트를 가장 중요한 비트 TFlagsEnum로 해석하고, 비트는 첫 번째 바이트의 가장 중요한 비트까지 값이 증가하고, 두 번째 바이트의 가장 중요한 비트를 계속 진행하는 것입니다. 이 체계에서 다음 ASN.1 형식 선언 및 C# 열거형을 함께 사용할 수 있습니다.

KeyUsage ::= BIT STRING {
  digitalSignature   (0),
  nonRepudiation     (1),
  keyEncipherment    (2),
  dataEncipherment   (3),
  keyAgreement       (4),
  keyCertSign        (5),
  cRLSign            (6),
  encipherOnly       (7),
  decipherOnly       (8) }
[Flags]
enum KeyUsage
{
    None              = 0,
    DigitalSignature  = 1 << (0),
    NonRepudiation    = 1 << (1),
    KeyEncipherment   = 1 << (2),
    DataEncipherment  = 1 << (3),
    KeyAgreement      = 1 << (4),
    KeyCertSign       = 1 << (5),
    CrlSign           = 1 << (6),
    EncipherOnly      = 1 << (7),
    DecipherOnly      = 1 << (8),
}

이 예제에서는 RFC 3280(4.2.1.3)의 KeyUsage NamedBitList를 사용하지만 예제 열거형은 System.Security.Cryptography.X509Certificates.X509KeyUsageFlags와 다른 값을 사용합니다.

적용 대상