Table of Contents

Class DerBitString

Namespace
Org.BouncyCastle.Asn1
Assembly
BouncyCastle.Cryptography.dll
public class DerBitString : DerStringBase, IAsn1String, Asn1BitStringParser, IAsn1Convertible
Inheritance
DerBitString
Implements
Derived
Inherited Members

Constructors

DerBitString(Asn1Encodable)

public DerBitString(Asn1Encodable obj)

Parameters

obj Asn1Encodable

DerBitString(IAsn1Convertible)

public DerBitString(IAsn1Convertible obj)

Parameters

obj IAsn1Convertible

DerBitString(byte, int)

public DerBitString(byte data, int padBits)

Parameters

data byte
padBits int

DerBitString(byte[])

public DerBitString(byte[] data)

Parameters

data byte[]

DerBitString(byte[], int)

public DerBitString(byte[] data, int padBits)

Parameters

data byte[]
padBits int

DerBitString(int)

public DerBitString(int namedBits)

Parameters

namedBits int

DerBitString(ReadOnlySpan<byte>)

public DerBitString(ReadOnlySpan<byte> data)

Parameters

data ReadOnlySpan<byte>

DerBitString(ReadOnlySpan<byte>, int)

public DerBitString(ReadOnlySpan<byte> data, int padBits)

Parameters

data ReadOnlySpan<byte>
padBits int

Properties

IntValue

public virtual int IntValue { get; }

Property Value

int

PadBits

Return the number of pad bits, if any, in the final byte, if any, read from GetBitStream().

public virtual int PadBits { get; }

Property Value

int

The number of pad bits. In the range zero to seven.

Remarks

This number is in the range zero to seven. That number of the least significant bits of the final byte, if any, are not part of the contents and should be ignored. NOTE: Must be called AFTER the stream has been fully processed. (Does not need to be called if GetOctetStream() was used instead of GetBitStream().

Parser

public Asn1BitStringParser Parser { get; }

Property Value

Asn1BitStringParser

Methods

Asn1Equals(Asn1Object)

protected override bool Asn1Equals(Asn1Object asn1Object)

Parameters

asn1Object Asn1Object

Returns

bool

Asn1GetHashCode()

protected override int Asn1GetHashCode()

Returns

int

FromContentsOptional(byte[])

public static DerBitString FromContentsOptional(byte[] contents)

Parameters

contents byte[]

Returns

DerBitString

GetBitStream()

Return a Stream representing the contents of the BIT STRING. The final byte, if any, may include pad bits. See PadBits.

public Stream GetBitStream()

Returns

Stream

A Stream with its source as the BIT STRING content.

Exceptions

IOException

GetBytes()

public virtual byte[] GetBytes()

Returns

byte[]

GetBytesLength()

public virtual int GetBytesLength()

Returns

int

GetInstance(Asn1TaggedObject, bool)

public static DerBitString GetInstance(Asn1TaggedObject obj, bool isExplicit)

Parameters

obj Asn1TaggedObject
isExplicit bool

Returns

DerBitString

GetInstance(object)

public static DerBitString GetInstance(object obj)

Parameters

obj object

Returns

DerBitString

GetOctetStream()

Return a Stream representing the contents of the BIT STRING, where the content is expected to be octet-aligned (this will be automatically checked during parsing).

public Stream GetOctetStream()

Returns

Stream

A Stream with its source as the BIT STRING content.

Exceptions

IOException

GetOctets()

public virtual byte[] GetOctets()

Returns

byte[]

GetOptional(Asn1Encodable)

public static DerBitString GetOptional(Asn1Encodable element)

Parameters

element Asn1Encodable

Returns

DerBitString

GetString()

public override string GetString()

Returns

string

GetTagged(Asn1TaggedObject, bool)

public static DerBitString GetTagged(Asn1TaggedObject taggedObject, bool declaredExplicit)

Parameters

taggedObject Asn1TaggedObject
declaredExplicit bool

Returns

DerBitString

IsOctetAligned()

public virtual bool IsOctetAligned()

Returns

bool