Asn1BuilderAddImplicit Method

Adds implicitly tagged type. Implicit (IMPLICIT OPTIONAL, CHOICE) must derive from primitive types and cannot be constructed.

Definition

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

Parameters

implicitTag  Byte
Implicit tag number. This number equals to tag number in square brackets in ASN module definition of IMPLICIT or CHOICE members.
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 and this method will encode value with specified tag. If mustEncode parameter is set to false, then data in value parameter is considered encoded method will perform tag replacement. 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, an exception will be thrown.

Exceptions

ArgumentNullExceptionvalue parameter is null.
InvalidDataExceptionvalue is not encoded.

See Also