Пример #1
0
        public PayLoadDTO GetPayLoadDTO(GMService gMService, string priKey)
        {
            var rawKey = gMService.SM2Decrypt("04" + this.Key, priKey, false);
            var rawPayLod = gMService.SM4_Decrypt_CBC(this.PayLoad, rawKey, this.IV, false);
            var rawPayLodObj = PayLoadDTO.FromJSON(rawPayLod);

            return rawPayLodObj;

        }
Пример #2
0
 public string GetPayLoadValue(GMService gMService,string priKey)
 {
     var rawKey = gMService.SM2Decrypt("04"+this.Key, priKey,false);
     var rawPayLod=gMService.SM4_Decrypt_CBC(this.PayLoad, rawKey, this.IV,false);
     var rawPayLodObj= PayLoadDTO.FromJSON(rawPayLod);
     var dataHex= Common.Utils.HexUtil.ByteArrayToString(Encoding.UTF8.GetBytes(rawPayLodObj.Data));
     var myHash = gMService.SM3(dataHex);
     if (!myHash.ToUpper().Equals(rawPayLodObj.Hash.ToUpper()))
     {
         return null;
     }
     return rawPayLodObj.Data;
 }