parent
ae67b12313
commit
fefa2da218
43 changed files with 884 additions and 477 deletions
|
@ -12,6 +12,7 @@ using Org.BouncyCastle.Math;
|
|||
using FrostFS.Refs;
|
||||
using FrostFS.SDK.Cryptography;
|
||||
using FrostFS.Session;
|
||||
using FrostFS.SDK.ProtosV2.Interfaces;
|
||||
|
||||
namespace FrostFS.SDK.ClientV2;
|
||||
|
||||
|
@ -67,20 +68,21 @@ public static class RequestSigner
|
|||
{
|
||||
var hash = new byte[65];
|
||||
hash[0] = 0x04;
|
||||
key
|
||||
.SignHash(SHA512.Create().ComputeHash(data))
|
||||
.CopyTo(hash, 1);
|
||||
|
||||
key.SignHash(SHA512.Create().ComputeHash(data)).CopyTo(hash, 1);
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static Signature SignMessagePart(this ECDsa key, IMessage? data)
|
||||
{
|
||||
var data2Sign = data is null ? Array.Empty<byte>() : data.ToByteArray();
|
||||
var data2Sign = data is null ? [] : data.ToByteArray();
|
||||
var sig = new Signature
|
||||
{
|
||||
Key = ByteString.CopyFrom(key.PublicKey()),
|
||||
Sign = ByteString.CopyFrom(key.SignData(data2Sign)),
|
||||
};
|
||||
|
||||
return sig;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue