且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到401 JWT令牌

更新时间:2023-11-19 18:31:46

问题可能是加密的私钥.

Problem be is encrypted private key.

通常在传输或发送私钥之前,会对私钥进行加密并使用密码短语或密码进行保护.收到加密的私钥时,必须解密私钥才能使用私钥.

Private key is normally encrypted and protected with a passphrase or password before the private key is transmitted or sent. When you receive an encrypted private key, you must decrypt the private key in order to use the private key.

要确定私钥是否已加密,请在任何文本编辑器中打开私钥.加密密钥的前几行类似于以下内容,并带有ENCRYPTED字:

To identify whether a private key is encrypted or not, open the private key in any text editor. An encrypted key has the first few lines that similar to the following, with the ENCRYPTED word:

---BEGIN RSA PRIVATE KEY---
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC,AB8E2B5B2D989271273F6730B6F9C687
------
------
------
---END RSA PRIVATE KEY---

另一方面,未加密的密钥将具有以下格式:

On the other hand, an unecrypted key will have the following format:

---BEGIN RSA PRIVATE KEY---
------
------
------
---END RSA PRIVATE KEY---

在大多数情况下,加密密钥不能直接在应用程序中使用.必须先将其解密.

Encrypted key cannot be used directly in applications in most scenario. It must be decrypted first.

Linux中的OpenSSL是解密加密私钥的最简单方法.使用以下命令解密加密的RSA密钥:

OpenSSL in Linux is the easiest way to decrypt an encrypted private key. Use the following command to decrypt an encrypted RSA key:

openssl rsa -in ssl.key.secure -out ssl.key

openssl rsa -in ssl.key.secure -out ssl.key

请确保将"server.key.secure"替换为加密密钥的文件名,并将"server.key"替换为所需的加密输出密钥文件的文件名.

Make sure to replace the "server.key.secure" with the filename of your encrypted key, and "server.key" with the file name that you want for your encrypted output key file.

如果加密密钥受密码或密码保护,请在出现提示时输入密码.

If the encrypted key is protected by a passphrase or password, enter the pass phrase when prompted.

完成后,您会注意到文件中的加密字眼已经消失.

Once done, you will notice that the ENCRYPTED wording in the file has gone.

如果我不使用Postman,那么我将不会看到Symfony的错误,它可以帮助我找到问题的根源.如果Lesik LexikJWTAuthenticationBundle处理了此错误,那就太好了.