public static byte[] verifyJwsSignature(final Key signingKey, final String asString) {
        return Unchecked.supplier(() -> {
            val jws = new JsonWebSignature();
            jws.setCompactSerialization(asString);
            jws.setKey(signingKey);

            val verified = jws.verifySignature();
            if (verified) {
                val payload = jws.getEncodedPayload();
                LOGGER.trace("Successfully decoded value. Result in Base64url-encoding is [{}]", payload);
                return EncodingUtils.decodeUrlSafeBase64(payload);
            }
            return null;
        }).get();
    }
Verify jws signature byte [ ].

@param signingKey the signing key
@param asString   the as string
@return the byte [ ]
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/EncodingUtils.java