Asn1BuilderAddExplicit(Byte, Byte, Boolean) Method

Adds explicitly tagged type. Explicit (EXPLICIT OPTIONAL) must have at least one primitive or constructed nested type.

Definition

Namespace: SysadminsLV.Asn1Parser
Assembly: SysadminsLV.Asn1Parser (in SysadminsLV.Asn1Parser.dll) Version: 1.2.11
C#
public Asn1Builder AddExplicit(
	byte explicitTag,
	byte[] value,
	bool mustEncode
)

Parameters

explicitTag  Byte
Explicit tag number. This number equals to tag number in square brackets in ASN module definition of EXPLICIT.
value  Byte
Value to encode.
mustEncode  Boolean
Specifies if data in value parameter must be encoded or not. See Remarks for more details.

Return Value

Asn1Builder
Current instance with added value.

Remarks

If mustEncode parameter is set to true, then data in value parameter is untagged. If mustEncode parameter is set to false, then data in value parameter is explicitly tagged and only tag name change is necessary. Caller must have knowledge in advance if value is tagged or not. If mustEncode parameter is set to false and value passed in value parameter is untagged, invalid type will be produced.

Exceptions

ArgumentNullExceptionvalue parameter is null.
InvalidDataExceptionvalue is not encoded.

See Also