public override int Encode(Asn1BerEncodeBuffer buffer, bool explicitTagging) { if (Value.Length < 1) { throw ExceptionUtility.CryptographicException(Resources.Asn1InvalidObjectIdException); } var len = 0; for (var i = Value.Length - 1; i >= 0; i--) { len += buffer.EncodeIdentifier(Value[i]); } if (explicitTagging) { len += buffer.EncodeTagAndLength(Tag, len); } return len; }
public override int Encode(Asn1BerEncodeBuffer buffer, bool explicitTagging) { if (Value.Length < 1) { throw new Exception("Asn1InvalidObjectIdException"); } var len = 0; for (var i = Value.Length - 1; i >= 0; i--) { len += buffer.EncodeIdentifier(Value[i]); } if (explicitTagging) { len += buffer.EncodeTagAndLength(Tag, len); } return(len); }
public override int Encode(Asn1BerEncodeBuffer buffer, bool explicitTagging) { if (((Value.Length < 2) || (Value[0] > 2)) || ((Value[0] != 2) && (Value[1] > 0x27))) { throw ExceptionUtility.CryptographicException(Resources.Asn1InvalidObjectIdException); } var len = 0; for (var i = Value.Length - 1; i >= 1; i--) { len += buffer.EncodeIdentifier((i == 1) ? ((Value[0] * 40) + Value[1]) : Value[i]); } if (explicitTagging) { len += buffer.EncodeTagAndLength(Tag, len); } return len; }