我需要加密 JWT 令牌,我看到创建对称密钥,有不同的选项。最常见的是:
new SymmetricSecurityKey(Convert.FromBase64String(myPassword));
或
new SymmetricSecurityKey(System.Text.Encoding.Default.GetBytes(paramClaveCifrado));
有什么不同吗?因为在这两种情况下,它都使用 SymmetricSecurityKey() 方法来生成密钥,但我不知道是否使用 GetByte() 或 FromBase64Stirng() 它可以引入一些差异。
有区别吗?
谢谢。