protected byte[] verifySignature(final byte[] value, final Key givenKey) {
        if (givenKey == null) {
            return value;
        }
        try {
            val activeSigningKey = givenKey instanceof final IdentifiableKey idk ? idk.getKey() : givenKey;
            if (activeSigningKey instanceof final RSAPrivateKey privKey) {
                val keySpec = new RSAPublicKeySpec(privKey.getModulus(), RSA_PUBLIC_KEY_EXPONENT);
                val pubKey = KeyFactory.getInstance("RSA").generatePublic(keySpec);
                return EncodingUtils.verifyJwsSignature(pubKey, value);
            }
            return EncodingUtils.verifyJwsSignature(activeSigningKey, value);
        } catch (final Exception e) {
            throw new IllegalArgumentException(e);
        }
    }
Sets signing key. If the key provided is resolved as a private key,
then will create use the private key as is, and will sign values
using RSA. Otherwise, AES is used.

@param signingSecretKey the signing secret key
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/cipher/AbstractCipherExecutor.java