本文整理匯總了C++中ENGINE_get_first函數的典型用法代碼示例。如果您正苦於以下問題:C++ ENGINE_get_first函數的具體用法?C++ ENGINE_get_first怎麽用?C++ ENGINE_get_first使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ENGINE_get_first函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ENGINE_register_all_RAND
void ENGINE_register_all_RAND ()
{
ENGINE *e;
for (e = ENGINE_get_first (); e; e = ENGINE_get_next (e))
ENGINE_register_RAND (e);
}
示例2: ENGINE_register_all_ciphers
void ENGINE_register_all_ciphers()
{
ENGINE *e;
for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e))
ENGINE_register_ciphers(e);
}
示例3: openssl_engine
int openssl_engine(lua_State *L)
{
const ENGINE* eng = NULL;
if (lua_isstring(L, 1))
{
const char* id = luaL_checkstring(L, 1);
eng = ENGINE_by_id(id);
}
else if (lua_isboolean(L, 1))
{
int first = lua_toboolean(L, 1);
if (first)
eng = ENGINE_get_first();
else
eng = ENGINE_get_last();
}
else
luaL_error(L,
"#1 may be string or boolean\n"
"\tstring for an engine id to load\n"
"\ttrue for first engine, false or last engine\n"
"\tbut we get %s:%s", lua_typename(L, lua_type(L, 1)), lua_tostring(L, 1));
if (eng)
{
PUSH_OBJECT((void*)eng, "openssl.engine");
}
else
lua_pushnil(L);
return 1;
}
示例4: ENGINE_register_all_pkey_asn1_meths
void ENGINE_register_all_pkey_asn1_meths(void)
{
ENGINE *e;
for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
ENGINE_register_pkey_asn1_meths(e);
}
示例5: ENGINE_register_all_STORE
void ENGINE_register_all_STORE ()
{
ENGINE *e;
for (e = ENGINE_get_first (); e; e = ENGINE_get_next (e))
ENGINE_register_STORE (e);
}
示例6: ENGINE_register_all_complete
int ENGINE_register_all_complete(void)
{
ENGINE *e;
for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e))
ENGINE_register_complete(e);
return 1;
}
示例7: ENGINE_register_all_DH
void
ENGINE_register_all_DH(void)
{
ENGINE *e;
for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
ENGINE_register_DH(e);
}
示例8: defined
/* Return list of OpenSSL crypto engine names.
*/
struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data)
{
struct curl_slist *list = NULL;
#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)
ENGINE *e;
for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
list = curl_slist_append(list, ENGINE_get_id(e));
#endif
(void) data;
return (list);
}
示例9: ossl_engine_s_engines
static VALUE
ossl_engine_s_engines(VALUE klass, SEL sel)
{
ENGINE *e;
VALUE ary, obj;
ary = rb_ary_new();
for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)){
WrapEngine(klass, obj, e);
rb_ary_push(ary, obj);
}
return ary;
}
示例10: ossl_engine_s_engines
static VALUE
ossl_engine_s_engines(VALUE klass)
{
ENGINE *e;
VALUE ary, obj;
ary = rb_ary_new();
for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)){
/* Need a ref count of two here because of ENGINE_free being
* called internally by OpenSSL when moving to the next ENGINE
* and by us when releasing the ENGINE reference */
ENGINE_up_ref(e);
WrapEngine(klass, obj, e);
rb_ary_push(ary, obj);
}
return ary;
}
示例11: display_engine_list
static void display_engine_list(void)
{
ENGINE *h;
int loop;
h = ENGINE_get_first();
loop = 0;
printf("listing available engine types\n");
while(h)
{
printf("engine %i, id = \"%s\", name = \"%s\"\n",
loop++, ENGINE_get_id(h), ENGINE_get_name(h));
h = ENGINE_get_next(h);
}
printf("end of list\n");
/* ENGINE_get_first() increases the struct_ref counter, so we
must call ENGINE_free() to decrease it again */
ENGINE_free(h);
}
示例12: throw
std::vector<std::string> Engines::getEnginesList() throw (EngineException)
{
ENGINE *e;
const char *name;
std::vector<std::string> ret;
e = ENGINE_get_first();
if (!e)
{
throw EngineException(EngineException::ENGINE_NOT_FOUND, "Engines::getEnginesList");
}
name = ENGINE_get_name(e);
ret.push_back(name);
while ((e = ENGINE_get_next(e)) != NULL)
{
name = ENGINE_get_name(e);
ret.push_back(name);
}
return ret;
}
示例13: engine_get_first_nif
ERL_NIF_TERM engine_get_first_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* () */
#ifdef HAS_ENGINE_SUPPORT
ERL_NIF_TERM ret, result;
ENGINE *engine;
ErlNifBinary engine_bin;
struct engine_ctx *ctx = NULL;
ASSERT(argc == 0);
if ((engine = ENGINE_get_first()) == NULL) {
if (!enif_alloc_binary(0, &engine_bin))
goto err;
engine_bin.size = 0;
return enif_make_tuple2(env, atom_ok, enif_make_binary(env, &engine_bin));
}
if ((ctx = enif_alloc_resource(engine_ctx_rtype, sizeof(struct engine_ctx))) == NULL)
goto err;
ctx->engine = engine;
ctx->id = NULL;
result = enif_make_resource(env, ctx);
ret = enif_make_tuple2(env, atom_ok, result);
goto done;
err:
ret = enif_make_badarg(env);
done:
if (ctx)
enif_release_resource(ctx);
return ret;
#else
return atom_notsup;
#endif
}
示例14: show_available_engines
void
show_available_engines ()
{
#if HAVE_OPENSSL_ENGINE /* Only defined for OpenSSL */
ENGINE *e;
printf ("OpenSSL Crypto Engines\n\n");
ENGINE_load_builtin_engines ();
e = ENGINE_get_first ();
while (e)
{
printf ("%s [%s]\n",
ENGINE_get_name (e),
ENGINE_get_id (e));
e = ENGINE_get_next (e);
}
ENGINE_cleanup ();
#else
printf ("Sorry, OpenSSL hardware crypto engine functionality is not available.\n");
#endif
}
示例15: myModConfig
const char *ssl_cmd_SSLCryptoDevice(cmd_parms *cmd,
void *dcfg,
const char *arg)
{
SSLModConfigRec *mc = myModConfig(cmd->server);
const char *err;
ENGINE *e;
if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) {
return err;
}
if (strcEQ(arg, "builtin")) {
mc->szCryptoDevice = NULL;
}
else if ((e = ENGINE_by_id(arg))) {
mc->szCryptoDevice = arg;
ENGINE_free(e);
}
else {
err = "SSLCryptoDevice: Invalid argument; must be one of: "
"'builtin' (none)";
e = ENGINE_get_first();
while (e) {
ENGINE *en;
err = apr_pstrcat(cmd->pool, err, ", '", ENGINE_get_id(e),
"' (", ENGINE_get_name(e), ")", NULL);
en = ENGINE_get_next(e);
ENGINE_free(e);
e = en;
}
return err;
}
apn_set_unsupport(cmd, "SSLCryptoDevice: No relevant directive in Nginx.");
return NULL;
}