public override void Decode(Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
        {
            var elemLength = explicitTagging ? MatchTag(buffer, Asn1Tag.Sequence) : implicitLength;

            Init();

            var context = new Asn1BerDecodeContext(buffer, elemLength);
            var parsedLen = new IntHolder();

            if (!context.MatchElemTag(0, 0x20, 0x10, parsedLen, false))
            {
                throw ExceptionUtility.CryptographicException(Resources.Asn1MissingRequiredException, buffer.ByteCount);
            }

            Algorithm = new AlgorithmIdentifier();
            Algorithm.Decode(buffer, true, parsedLen.Value);

            if (!context.MatchElemTag(0, 0, 3, parsedLen, false))
            {
                throw ExceptionUtility.CryptographicException(Resources.Asn1MissingRequiredException, buffer.ByteCount);
            }

            SubjectPublicKey = new Asn1BitString();
            SubjectPublicKey.Decode(buffer, true, parsedLen.Value);
        }
 private void Init()
 {
     Algorithm = null;
     SubjectPublicKey = null;
 }