static int DecodeHeader(IBerInput input, BerTag expectedTag)
{
var tag = BerEncoding.DecodeTag(input);
if (tag != expectedTag)
{
throw new BerException(4001, String.Format("Expected tag {0}, found tag {1}", tag, expectedTag));
}
return(BerEncoding.DecodeLength(input));
}