| 86 | } |
| 87 | |
| 88 | static int GetAlgorithmFromString(const char* algorithm) { |
| 89 | if (strcmp(algorithm, "RS256") == 0) { |
| 90 | return JWT_ALG_RS256; |
| 91 | } |
| 92 | if (strcmp(algorithm, "ES256") == 0) { |
| 93 | return JWT_ALG_ES256; |
| 94 | } |
| 95 | return -1; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Calculates a JSON Web Token (JWT) given the path to a EC private key and |