Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Agent.Result SignResult (Agent.Result resut, string agentId) {
- string salt = CryptoUtils.RandomString(32);
- byte[] sign = null;
- if (RSASigner.Sign(Encoding.UTF8.GetBytes(salt + agentId + resut.SessionId), privateKey, out sign)) {
- resut.Sign = new Agent.sign_data() {
- Salt = salt,
- Sign = Convert.ToBase64String(sign)
- };
- } else {
- Log.Error(Ident, $"RSA sign failed for agent '{agentId}' session '{resut.SessionId}'");
- }
- return resut;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement