문제

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#

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top