FormatCardRequest.cs 895 B

1234567891011121314151617181920212223
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ShengJu_CUT100_DES.MessageEntity.Outgoing
  6. {
  7. /// <summary>
  8. /// 验证卡片原根密钥后格式化卡片,重新创建文件结构,并将根密钥修改成用户指定的密钥值。
  9. /// </summary>
  10. public class FormatCardRequest : MessageBase
  11. {
  12. public FormatCardRequest(byte[] oldKey, byte[] newKey)
  13. {
  14. if (oldKey == null || newKey == null)
  15. throw new ArgumentNullException("must provide oldKey and newKey");
  16. if (oldKey.Length != 16 || newKey.Length != 16)
  17. throw new ArgumentException("oldKey and newKey must has its length to 16");
  18. base.命令代码 = CommandType.DesFireEV1操作命令_格式化卡片;
  19. base.RawDataAndCheck = oldKey.Concat(newKey).ToList();
  20. }
  21. }
  22. }