public static boolean verify(JWSInput input, PublicKey publicKey) { try { Signature verifier = getSignature(input.getHeader().getAlgorithm()); verifier.initVerify(publicKey); verifier.update(input.getContent()); return verifier.verify(input.getSignature()); } catch (Exception e) { throw new RuntimeException(e); } }
@SuppressWarnings("unchecked") public <T> T readContent(Class<T> type) { MediaType mediaType = MediaType.WILDCARD_TYPE; if (header.getContentType() != null) { mediaType = MediaType.valueOf(header.getContentType()); } return (T) readContent(type, null, null, mediaType); }
public static boolean verify(JWSInput input, SecretKey key) { try { byte[] signature = sign(input.getContent(), input.getHeader().getAlgorithm(), key); String x = Base64Url.encode(signature); return x.equals(input.getEncodedSignature()); } catch (Exception e) { throw new RuntimeException(e); } }
@SuppressWarnings("unchecked") public <T> T readContent(Class<T> type) { MediaType mediaType = MediaType.WILDCARD_TYPE; if (header.getContentType() != null) { mediaType = MediaType.valueOf(header.getContentType()); } return (T) readContent(type, null, null, mediaType); }
public static boolean verify(JWSInput input, byte[] sharedSecret) { try { byte[] signature = sign(input.getContent(), input.getHeader().getAlgorithm(), sharedSecret); String x = Base64Url.encode(signature); return x.equals(input.getEncodedSignature()); } catch (Exception e) { throw new RuntimeException(e); } }
public static boolean verify(JWSInput input, PublicKey publicKey) { try { Signature verifier = getSignature(input.getHeader().getAlgorithm()); verifier.initVerify(publicKey); verifier.update(input.getContent()); return verifier.verify(input.getSignature()); } catch (Exception e) { throw new RuntimeException(e); } }
public static boolean verify(JWSInput input, byte[] sharedSecret) { try { byte[] signature = sign(input.getContent(), input.getHeader().getAlgorithm(), sharedSecret); String x = Base64Url.encode(signature); return x.equals(input.getEncodedSignature()); } catch (Exception e) { throw new RuntimeException(e); } }
public static boolean verify(JWSInput input, SecretKey key) { try { byte[] signature = sign(input.getContent(), input.getHeader().getAlgorithm(), key); String x = Base64Url.encode(signature); return x.equals(input.getEncodedSignature()); } catch (Exception e) { throw new RuntimeException(e); } }