Struct bcder::Tag

source ·
pub struct Tag(_);
Expand description

The tag of a BER encoded value.

Each BER encoded value starts with a sequence of one or more octets called the identifier octets. They encode both the tag of the value as well as whether the value uses primitive or constructed encoding. The Tag type represents the tag only. The distinction between primitive and constructed encoding is captured by the decoder types Primitive and Constructed instead.

The tag in turn consists of two parts: the class and the number – the Tag type includes both of them.

At the moment, you can only compare two tags. All necessary values are defined as associated constants; there is no other way to create new tag values.

Limitations

At this time, we can only decode single-octet identifier octets. That is, we only support tag numbers between 0 and 30.

Implementations§

The tag marking the end-of-value in an indefinite length value.

This is UNIVERSAL 0.

The tag for the BOOLEAN type, UNIVERSAL 1.

The tag for the INTEGER type, UNIVERSAL 2.

The tag for the BIT STRING type, UNIVERSAL 3.

The tag for the OCTET STRING type, UNIVERSAL 4.

The tag for the NULL type, UNIVERSAL 5.

The tag for the OBJECT IDENTIFIER type, UNIVERSAL 6.

The tag for the ObjectDescriptor type, UNIVERSAL 7.

The tag for the EXTERNAL and Instance-of types, UNIVERSAL 8.

The tag for the REAL type, UNIVERSAL 9.

The tag for the ENUMERATED type, UNIVERAL 10.

The tag for the EMBEDDED PDV type, UNIVERAL 11.

The tag for the UTF8String type, UNIVERSAL 12

The tag for the RELATIVE-OID type, UNIVERAL 13.

The tag for the SEQUENCE and SEQUENCE OF types, UNIVERSAL 16.

The tag for the SET and SET OF types, UNIVERSAL 17.

The tag for the NumericString type, UNIVERSAL 18.

The tag for the PrintableString type, UNIVERSAL 19.

The tag for the TeletexString type, UNIVERSAL 20.

The tag for the VideotexString type, UNIVERSAL 21.

The tag for the IA5String type, UNIVERSAL 22.

The tag for the UTCTime type, UNIVERSAL 23.

The tag for the GeneralizedType type, UNIVERAL 24.

The tag for the GraphicString type, UNIVERSAL 25.

The tag for the VisibleString type, UNIVERSAL 26.

The tag for the GeneralString type, UNIVERSAL 27.

The tag for the UniversalString type, UNIVERSAL 28.

The tag for the BMPString type, UNIVERSAL 29.

The tag context specific tag [0].

The tag context specific tag [1].

The tag context specific tag [2].

The tag context specific tag [3].

The tag context specific tag [4].

The tag context specific tag [5].

The tag context specific tag [6].

Creates a new tag in the universal class with the given tag number.

Panics

Currently, this function panics if the tag number is greater than 30.

Creates a new tag in the application class with the given tag number.

Panics

Currently, this function panics if the tag number is greater than 30.

Creates a new tag in the context specific class.

Panics

Currently, this function panics if the provided tag number is greater than 30.

Creates a new tag in the private class with the given tag number.

Panics

Currently, this function panics if the provided tag number is greater than 30.

Takes a tag from the beginning of a source.

Upon success, returns both the tag and whether the value is constructed. If there are no more octets available in the source, an error is returned.

Takes a tag from the beginning of a resource if it matches this tag.

If there is no more data available in the source or if the tag is something else, returns Ok(None). If the tag matches self, returns whether the value is constructed.

Returns the number of octets of the encoded form of the tag.

Encodes the tag into a target.

If constructed is true, the encoded tag will signal a value in constructed encoding and primitive encoding otherwise.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.