【发布时间】:2016-07-01 10:18:45
【问题描述】:
根据JWT(特别是使用Box.com api),您需要
创建您的标头和声明,使用 base 64 url 对它们进行编码,并用点将它们连接起来。
You then need to take that and the secret key (a little confusion here, more on that in a second) and then encrypt them。对于 Box.com,它将使用 RS256。
然后您将其发送给提供商(在本例中为 Box.com),一切都应该很好。
第 1 步没问题。
第 2 步对我来说有点问题。
我假设我使用我的……私钥?编辑:不,私钥是用来解密的。
尽管有太多使用 HSA 执行此操作的示例,但我需要使用 RSA,并且 System.IdentityModel.Tokens.JWT_stuff 流程并没有提供帮助。如果 Box.com 允许 HSA256,我还可以使用其他几个包和库。
我查看了this question,但并没有非常有用。
那么我需要做什么才能完成第 2 步?换句话说:如何在 C# 中使用 RSA256 进行加密?
【问题讨论】:
标签: c# encryption jwt box