We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JWT.Encode method throws exception complaining on invalid key, but the key is RSA type and valid.
JWT.Encode
`
const string key = @"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRsqElHKG158ZujNSLzDR9Btv/o2EWNO74b24jUpd3U2Am461rakorD0jm0rFEi5yqHDkPhSS+WW6pSY32w5eTuNTEGhGcoZFrnzHAEO6W4tBRqtS2UTA84zvA92DTHyDK+HKVmQW9JmA4uaPe1CEwVS4ZCGreviUXu66fl1iSUUcgrPV6K2E1TrpbIsWP1uHeZDOhtLHkT6ubrcgC1VW3QMaiC4uAjYxeWsGhhKdr4Wr2q3ywU1OmBlbQOJva29qrAVhykqv0CxBDuezIZbaeJKvQjyd4BAXnYDQwFcXfjSXCNPHFjSi9g7E5okx/E/eeS4bBQ35rzShoOwhb0a0VK5gZm7MODtXiYZX+ws7F1ioBCOzHVJhimkXWBvSNbvqQRApBL57zD19DUw7btfjqYx4lXJj/lYG+ON72O4tzCa5nvObmIgnYcWxypQYBFo6UZfYcAfSL4t4HGN5eyON7qPs4Woy3lzhJkKLVvHu/+W7PvEgAvQucPzh0pU4O+q8= hms\dmitryl@PRCD1DMITRY ";
string ssToken; MssGetJWTTokenRS512("{\r\n \"extra\": \"param\", \"alg\": \"RS512\",\r\n \"typ\": \"JWT\"\r\n}", "{\r\n \"sub\": \"1234567890\",\r\n \"name\": \"Dmitry Lubenskiy\",\r\n \"iat\": 1516239022\r\n}", key, out ssToken);
public void MssGetJWTTokenRS512(string ssHeaderJson, string ssPayloadJson, string ssKey, out string ssToken) { Dictionary<string, object> hvalues = JsonConvert.DeserializeObject<Dictionary<string, object>>(ssHeaderJson); var header = hvalues; Dictionary<string, object> pvalues = JsonConvert.DeserializeObject<Dictionary<string, object>>(ssPayloadJson); var payload = pvalues; var key = Encoding.UTF8.GetBytes(ssKey); ssToken = JWT.Encode(payload, key, JwsAlgorithm.RS512, header); }
The text was updated successfully, but these errors were encountered:
Hi @Lionberg ,
ssh-rsa ....
Sorry, something went wrong.
No branches or pull requests
JWT.Encode
method throws exception complaining on invalid key, but the key is RSA type and valid.`
The text was updated successfully, but these errors were encountered: