public override void Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength) { int llen = implicitLength; // decode CHOICE Asn1Tag tag = new Asn1Tag(); buffer.Mark(); int len = buffer.DecodeTagAndLength(tag); if (tag.Equals(Asn1Tag.Universal, Asn1Tag.PRIM, 5)) { buffer.Reset(); NULLParams null_ = new NULLParams(); SetElement(_NULL_, null_); Element.Decode(buffer, true, len); } else if (tag.Equals(Asn1Tag.Universal, Asn1Tag.PRIM, 6)) { buffer.Reset(); GostR3411_94_DigestParameters params_ = new GostR3411_94_DigestParameters(); SetElement(_PARAMS_, params_); Element.Decode(buffer, true, len); } else { throw new Exception("Asn1InvalidChoiceOptionException (buffer, tag)"); } }
public override int Encode(Asn1BerEncodeBuffer buffer, bool explicitTagging) { int _aal = 0, len; switch (ChoiceId) { // encode null_ case _NULL_: NULLParams null_ = (NULLParams)GetElement(); len = null_.Encode(buffer, true); _aal += len; break; // encode params_ case _PARAMS_: GostR3411_94_DigestParameters params_ = (GostR3411_94_DigestParameters)GetElement(); len = params_.Encode(buffer, true); _aal += len; break; default: throw new Exception("Asn1InvalidChoiceOptionException()"); } return(_aal); }
public void Set_params_(GostR3411_94_DigestParameters value) { SetElement(_PARAMS_, value); }