sign a request using SHA1 and private.key

MaxPlatinum

Member
Joined
Aug 4, 2023
Messages
18
Programming Experience
1-3
Hello, I have private key like:
C#:
string privateKey = @"-----BEGIN PRIVATE KEY-----
MIICd...............................
hqhPg==
-----END PRIVATE KEY-----";
And request like:
C#:
string request = "<?xml version=\"1.0\" encoding=\"windows-1251\"?><request>...............</request>";
.

I need to write code in C# based on Openssl commands:
Rich (BB code):
openssl dgst –sha1 -out request.sign –sign private.key request.txt
openssl base64 -in request.sign –out request.enc

How to code these commands in C#? I tried a lot of exmaples and didnt get result. Could anyone code it please? How to read private key?
 

Latest posts

Back
Top Bottom