Open EloiStree opened 3 months ago
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.
Ring ? https://docs.rs/ring/latest/ring/index.html Open SSL ? https://docs.rs/openssl/latest/openssl/
https://youtu.be/1H9FHhRntAk
Or... Maybe do a Websocket server with all the RSA tools in usable from Rust.
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#
But RSA on Crate is ... tricky.