0

我正在尝试创建一个端点来返回有关公钥的详细信息,以便像 Krakend 这样的 API 网关使用这些详细信息来验证 JWT。端点需要返回类似于以下 json 响应的响应。

{
   "keys":[
      {
         "alg":"RS256",
         "kty":"RSA",
         "use":"sig",
         "n":"5dfikb_OwXGysznPX5Z4lcdXTGTmcDpBu4P_IYf9agP71NpVLF3nGnhedJGbiAk6hC6PMtrh7slURD6CWSgIjpvxemyXrPeSIlmpG068TKYHzFjYrJKou-Z1YbYGepRtKhepktN65vMPnqbMpqMrZKoY12dzPuD7EVHjvoQQ2EZ7K3TqMyPFm3MS7hYp8cL0CpSd1Tz40CEKY6l-WorCYbc7ULIMdAeiAlPesllerqzSc3MIkq9RKGrcbg-qWWEumxsdVG0nh-sI1q8UL_ctx1LB3yrF9F2gyLvsWIPDPfObP9zv40XcuALr83NwroofkeRLcP1jjoEvX-BN6Dyzdw",
         "e":"AQAB",
         "kid":"MDNGMjU2M0U3RERFQUEwOUUzQUMwQ0NBN0Y1RUY0OEIxNTRDM0IxMw",
         "x5t":"MDNGMjU2M0U3RERFQUEwOUUzQUMwQ0NBN0Y1RUY0OEIxNTRDM0IxMw",
         "x5c":[
            "MIIC8jCCAdqgAwIBAgIJH4krc5YgOHTtMA0GCSqGSIb3DQEBBQUAMCAxHjAcBgNVBAMTFWFsYmVydC10ZXN0LmF1dGgwLmNvbTAeFw0xNzAxMjIxNjM0MThaFw0zMDEwMDExNjM0MThaMCAxHjAcBgNVBAMTFWFsYmVydC10ZXN0LmF1dGgwLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOXX4pG/zsFxsrM5z1+WeJXHV0xk5nA6QbuD/yGH/WoD+9TaVSxd5xp4XnSRm4gJOoQujzLa4e7JVEQ+glkoCI6b8Xpsl6z3kiJZqRtOvEymB8xY2KySqLvmdWG2BnqUbSoXqZLTeubzD56mzKajK2SqGNdncz7g+xFR476EENhGeyt06jMjxZtzEu4WKfHC9AqUndU8+NAhCmOpflqKwmG3O1CyDHQHogJT3rJZXq6s0nNzCJKvUShq3G4PqllhLpsbHVRtJ4frCNavFC/3LcdSwd8qxfRdoMi77FiDwz3zmz/c7+NF3LgC6/NzcK6KH5HkS3D9Y46BL1/gTeg8s3cCAwEAAaMvMC0wDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQUpb+3dP0YoLyGitKFk5mp426n+LUwDQYJKoZIhvcNAQEFBQADggEBADSg3K6Exwr4CSgO+VgDmuUuEy+svF/SbT1i3mN54hWtJmIpSTI2tuXZo+eT1A6M4Iyd1EK/lWH0lt+HuPgSgC7Ir3G8ctW0TPpmiTaiG8uMgbnSN7StWSdj1AZwDO6SHTsTQnFWbHVVtL8QX4yJ8f+ToAYOQlcdWtPqUBFqKK1NjvVUd5ZWIbTTJAigDCd/jYZhmTJ8CcUVvPAJ51yNGjaxoVwFZNR190B1qd+aygsUqrxTzSe3h3bnzYhQA4X6yHwP8du8JcrPiig7E29IRMQ0a/JzdmUVVJp3i+x1gZ2Z9KE/qyd3fiYMEwghszV2c2Jmd3pYOQ24lXTUsn1tIdo="
         ]
      }
   ]
}

我通过运行 Laravel Passport keys 命令生成了公钥和私钥

php artisan passport:keys
4

0 回答 0