public NoteAPIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , IHttpContextAccessor accessor, NoteService noteService, NoteContentService noteContentService, NotebookService notebookService, NoteRepositoryService noteRepositoryService, TrashService trashService, EPassService ePass, GMService gMService, DataSignService dataSignService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.attachService = attachService; this.noteService = noteService; this.tokenSerivce = tokenSerivce; this.noteContentService = noteContentService; this.trashService = trashService; this.accessor = accessor; this.notebookService = notebookService; this.noteRepositoryService = noteRepositoryService; this.ePassService = ePass; this.dataSignService = dataSignService; this.gMService = gMService; }
public string GetPayLoadSM3(GMService gMService, string priKey) { var payload = GetPayLoadDTO(gMService, priKey); var dataHex = Common.Utils.HexUtil.ByteArrayToString(Encoding.UTF8.GetBytes(payload.Data)); var myHash = gMService.SM3(dataHex); return myHash; }
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; }
public void SetData(string data) { var gm = new GMService(); this.Data = data; var hex = Common.Utils.HexUtil.ByteArrayToString(Encoding.UTF8.GetBytes(data)); this.Hash = gm.SM3(hex); }
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; }
public UserAPIController(AttachService attachService , TokenSerivce tokenSerivce , NoteFileService noteFileService , UserService userService , ConfigFileService configFileService , GMService gMService , RealNameService realNameService , IHttpContextAccessor accessor, AuthService authService , EPassService ePass , DataSignService dataSignService ) : base(attachService, tokenSerivce, noteFileService, userService, configFileService, accessor) { this.authService = authService; this.userService = userService; this.tokenSerivce = tokenSerivce; this.realNameService = realNameService; this.ePassService = ePass; this.gMService = gMService; this.dataSignService = dataSignService; }
public string getSM4Key(GMService gMService, string priKey) { var rawKey = gMService.SM2Decrypt("04" + this.Key, priKey, false); return rawKey; }