Loading the Jira Public Certificate in .Net from a string (how to convert ASN.1 encoded SubjectPublicKeyInfo to X509 Cert in .Net)

匆匆过客 提交于 2019-12-05 22:48:41

Jira should provide you with a Certificate (not just a public key).

Typically the Java world will give a base64 encoded or PEM certificate. X509Certificate2 from .Net can automatically .Load a base64, PEM or binary certificate.

you can generate your XML RSA certificate via .NET using RSACryptoServiceProvider. This will give you XML (FromXmlString method), the public key then needs to be encoded, for example by using this service:

https://superdry.apphb.com/tools/online-rsa-key-converter

and then used to create application link to JIRA.

The private key in XML form you got previously, can be used for signing .NET app requests directly.

I personally used DonNetAuth library for signing, exchannging tokens, etc and it works for me. The only bug I encountered was regarding jql queries, where the signing needed a bit of tweaking to work correctly. Here is the link:

http://samondotnet.blogspot.sk/2012/12/introduction-to-dotnetauth.html

Additionally see this link: https://answers.atlassian.com/questions/172760/is-there-any-jira-oauth-implementation-example-in-net

Hope this helps.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!