-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Fail 1: https://github.com/EloiStree/HelloRustBending/tree/main/RustEveryDay/2024_06_17_D8_SignRSA
Fail 2: https://github.com/EloiStree/HelloRustBending/tree/main/RustEveryDay/2024_06_21_D12_SignVerifiedFailed
I am blocked... I just try to do this in C#
public static byte[] SignData(byte[] data, RSAParameters privateKey)
{
using (RSA rsa = RSA.Create())
{
rsa.ImportParameters(privateKey);
return rsa.SignData(data, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
}
}
public static bool VerifySignature(byte[] data, byte[] signature, RSAParameters publicKey)
{
using (RSA rsa = RSA.Create())
{
rsa.ImportParameters(publicKey);
return rsa.VerifyData(data, signature, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
}
}But RSA on Crate is ... tricky.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels