Samuel-Tyler / fast_ber

A C++11 ASN.1 BER Encoding and Decoding Library
Boost Software License 1.0
84 stars 11 forks source link

Add encoding scheme as a template argument to types #27

Open Samuel-Tyler opened 4 years ago

Samuel-Tyler commented 4 years ago

Currently all types are encoded / decoded as ber. A NTTP should be added to each ASN.1 type which allows the user to specify expected encoding scheme. An enum class should be defined to select the scheme. The encoding should be defined for types to allow optimised storage of their encoding.

Expected format:

enum class Asn1Encoding
{
    ber,
    der,
    cer,
    ...
};

template <Asn1Encoding encoding = Asn1Encoding::ber, typename Identifier = ExplicitId<UniversalTag::integer>>
class Integer
{
     ...
};