MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cpp-samples / GetAlgorithmFromString

Function GetAlgorithmFromString

iot/mqtt-ciotc/mqtt_ciotc.c:88–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static 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

Callers 1

CreateJwtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected