MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / verifyHmac

Method verifyHmac

CodenameOne/src/com/codename1/security/Jwt.java:230–236  ·  view source on GitHub ↗
(String expectedAlg, byte[] secret)

Source from the content-addressed store, hash-verified

228 }
229
230 private boolean verifyHmac(String expectedAlg, byte[] secret) {
231 if (!expectedAlg.equals(getAlgorithm())) {
232 return false;
233 }
234 byte[] expected = computeHmac(expectedAlg, secret, signingInput);
235 return Hmac.constantTimeEquals(expected, signature);
236 }
237
238 /// Verifies an RSA or ECDSA signature using the given public key. The
239 /// algorithm must match the token's `alg` header (RS256/384/512 or

Callers 3

verifyHs256Method · 0.95
verifyHs384Method · 0.95
verifyHs512Method · 0.95

Calls 4

getAlgorithmMethod · 0.95
computeHmacMethod · 0.95
constantTimeEqualsMethod · 0.95
equalsMethod · 0.65

Tested by

no test coverage detected