You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i tried creating a JWT with the following code from your documentation:
let path = Bundle.main.path(forResource: "privateKey", ofType: "key")
let privateKeyPath = URL(fileURLWithPath: path!)
let privateKey: Data = try Data(contentsOf: privateKeyPath, options: .alwaysMapped)
let jwtSigner = JWTSigner.rs256(privateKey: privateKey)
let signedJwt = try jwt.sign(using: jwtSigner)
but at the last line i get an exception telling me that the 'Provided private key could not be used to sign JWT'.
I've first tried a key that has always worked in java and then a key generated with
ssh-keygen -t rsa -b 4096 -m PEM -f privateKey.key
The second one is much longer, but both keys produce the same result.
The text was updated successfully, but these errors were encountered:
Hello,
i tried creating a JWT with the following code from your documentation:
let path = Bundle.main.path(forResource: "privateKey", ofType: "key")
let privateKeyPath = URL(fileURLWithPath: path!)
let privateKey: Data = try Data(contentsOf: privateKeyPath, options: .alwaysMapped)
let jwtSigner = JWTSigner.rs256(privateKey: privateKey)
let signedJwt = try jwt.sign(using: jwtSigner)
but at the last line i get an exception telling me that the 'Provided private key could not be used to sign JWT'.
I've first tried a key that has always worked in java and then a key generated with
ssh-keygen -t rsa -b 4096 -m PEM -f privateKey.key
The second one is much longer, but both keys produce the same result.
The text was updated successfully, but these errors were encountered: