Hi everyone, I’m having a problem creating the RSA...
# ktor
d
Hi everyone, I’m having a problem creating the RSA key to sign the JWT Token. I’ve user different key generators online, but without success. The only that works is the one from the ktor documentation, and for obvious reasons I don’t want to use that later in production. These are the ones from their example: Private key
MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAtfJaLrzXILUg1U3N1KV8yJr92GHn5OtYZR7qWk1Mc4cy4JGjklYup7weMjBD9f3bBVoIsiUVX6xNcYIr0Ie0AQIDAQABAkEAg+FBquToDeYcAWBe1EaLVyC45HG60zwfG1S4S3IB+y4INz1FHuZppDjBh09jptQNd+kSMlG1LkAc/3znKTPJ7QIhANpyB0OfTK44lpH4ScJmCxjZV52mIrQcmnS3QzkxWQCDAiEA1Tn7qyoh+0rOO/9vJHP8U/beo51SiQMw0880a1UaiisCIQDNwY46EbhGeiLJR1cidr+JHl86rRwPDsolmeEF5AdzRQIgK3KXL3d0WSoS//K6iOkBX3KMRzaFXNnDl0U/XyeGMuUCIHaXv+n+Brz5BDnRbWS+2vkgIe9bUNlkiArpjWvX+2we
Public Key
6f8856ed-9189-488f-9011-0ff4b6c08edc
All the keys generated online, are completely different, mostly from the public key and can’t work with any of these. These are the generators I used • https://travistidwell.com/jsencrypt/demo/https://www.csfieldguide.org.nz/en/interactives/rsa-key-generator/ I’m a backend beginner, so it would be amazing if you could give me a detailed answer 😅
c
have used the Nimbus JWT RSA Keypair Generator as well as the JVM built-in RSA Keypair generator to create key material used for signing JWTs. You sign the JWT with the private key and validate it with the public key. From the doc it looks like the privateKey is perhaps Base64 encoded, you’ll want to confirm that encoding.
👍 2