ReadAppDirsRequest.cs 1.0 KB

123456789101112131415161718192021222324252627
  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. /// 获取卡片内所有应用目录的数量和应用目录 ID
  9. /// Desfire 卡中的目录 ID 长度为 3 字节,因此每 3 个字节的数据为一个应用目录 ID
  10. /// </summary>
  11. public class ReadAppDirsRequest : MessageBase
  12. {
  13. public enum ValidationTypeEnum { 不验证主控密钥 = 0, 验证主控密钥 = 1 }
  14. public ReadAppDirsRequest(byte[] rootKey) : this(ValidationTypeEnum.验证主控密钥, rootKey)
  15. {
  16. }
  17. public ReadAppDirsRequest(ValidationTypeEnum validationType, byte[] rootKey)
  18. {
  19. if (rootKey.Length != 16)
  20. throw new ArgumentException("rootKey must has its length to 16");
  21. base.命令代码 = CommandType.DesFireEV1操作命令_获取卡片应用目录信息;
  22. base.RawDataAndCheck = new byte[] { (byte)validationType }.Concat(rootKey).ToList();
  23. }
  24. }
  25. }