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, 0, 6, parsedLen, false)) { throw ExceptionUtility.CryptographicException(Resources.Asn1MissingRequiredException, buffer.ByteCount); } _publicKeyParamSet = new Asn1ObjectIdentifier(); _publicKeyParamSet.Decode(buffer, true, parsedLen.Value); if (!context.MatchElemTag(0, 0, 6, parsedLen, false)) { throw ExceptionUtility.CryptographicException(Resources.Asn1MissingRequiredException, buffer.ByteCount); } _digestParamSet = new Asn1ObjectIdentifier(); _digestParamSet.Decode(buffer, true, parsedLen.Value); if (context.MatchElemTag(0, 0, 6, parsedLen, false)) { _encryptionParamSet = new Gost2814789ParamSet(); _encryptionParamSet.Decode(buffer, true, parsedLen.Value); } }
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, 0, 6, parsedLen, false)) { throw ExceptionUtility.CryptographicException(Resources.Asn1MissingRequiredException, buffer.ByteCount); } Algorithm = new Asn1ObjectIdentifier(); Algorithm.Decode(buffer, true, parsedLen.Value); if (!context.Expired()) { Parameters = new Asn1OpenType(); Parameters.Decode(buffer, true, 0); } CheckTc(true); }