Question

Trying to connect to chef api from c# .

documentation says, sign the header with the private pem key

My Collegues working on node js use a library called ursa which lets them sign a string using the method privateEncrypt

what is wierd though is that method is called 'privateEncrypt' , i thought private keys are for decryption.

any opinion on an equivalent in the c# world ? or how to connect to chef api from c#

Was it helpful?

Solution

If you want to encrypt something with RSA in C# you could use the RSA class: http://msdn.microsoft.com/en-us/library/system.security.cryptography.rsa(v=vs.110).aspx

Asymmetric cryptography is just a pair of keys for decrypting/encrypting. You just choose one of them to be private and the other one to be public. If you encrypt using one of them the decryption should be done with the other one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top