示例#1
0
static char *test_jwt_array_has_string(apr_pool_t *pool) {
	apr_array_header_t *haystack = apr_array_make(pool, 3, sizeof(const char*));
	*(const char**) apr_array_push(haystack) = "a";
	*(const char**) apr_array_push(haystack) = "b";
	*(const char**) apr_array_push(haystack) = "c";
	TST_ASSERT("jwt_array_has_string (1)",
			apr_jwt_array_has_string(haystack, "a"));
	TST_ASSERT("jwt_array_has_string (2)",
			apr_jwt_array_has_string(haystack, "d") == FALSE);
	return 0;
}
示例#2
0
/*
 * check if the provided signing algorithm is supported
 */
apr_byte_t apr_jws_algorithm_is_supported(apr_pool_t *pool, const char *alg) {
    return apr_jwt_array_has_string(apr_jws_supported_algorithms(pool), alg);
}
示例#3
0
/*
 * check if the provided encryption algorithm is supported
 */
apr_byte_t apr_jwe_encryption_is_supported(apr_pool_t *pool, const char *enc) {
	return apr_jwt_array_has_string(apr_jwe_supported_encryptions(pool), enc);
}