Lines Matching refs:ENGINE
54 * internally to control registration of ENGINE implementations, and can be
60 /* ENGINE flags that can be set by ENGINE_set_flags(). */
67 * these control commands on behalf of the ENGINE using their "cmd_defns"
74 * via "ENGINE_by_id()". When an ENGINE must store state (eg. if
77 * then each attempt to obtain the ENGINE will result in it being copied into
79 * ENGINE_by_id() just increments the existing ENGINE's structural reference
85 * This flag if for an ENGINE that does not want its methods registered as
127 * the same functionality to their own ENGINE-specific control functions that
131 * without requiring per-ENGINE hacking.
162 * commands, including ENGINE-specific command types, return zero for an
163 * error. An ENGINE can choose to implement these ctrl functions, and can
166 * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the
167 * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's
173 * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not",
215 * ENGINE implementations should start the numbering of their own control
222 * functionality is now available through ENGINE-specific control commands
242 * If an ENGINE supports its own specific control commands and wishes the
261 typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
263 typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
266 typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
269 typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
276 * These callback types are for an ENGINE's handler for cipher and digest logic.
278 * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
279 * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
290 typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
292 typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
294 typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
296 typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
300 * ENGINE structures where the pointers have a "structural reference". This
306 * "current" ENGINE and increment the structural reference count of the
307 * ENGINE it returns (unless it is NULL).
310 /* Get the first/last "ENGINE" type available. */
311 ENGINE *ENGINE_get_first(void);
312 ENGINE *ENGINE_get_last(void);
313 /* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
314 ENGINE *ENGINE_get_next(ENGINE *e);
315 ENGINE *ENGINE_get_prev(ENGINE *e);
316 /* Add another "ENGINE" type into the array. */
317 int ENGINE_add(ENGINE *e);
318 /* Remove an existing "ENGINE" type from the array. */
319 int ENGINE_remove(ENGINE *e);
321 ENGINE *ENGINE_by_id(const char *id);
358 int ENGINE_register_RSA(ENGINE *e);
359 void ENGINE_unregister_RSA(ENGINE *e);
362 int ENGINE_register_DSA(ENGINE *e);
363 void ENGINE_unregister_DSA(ENGINE *e);
366 int ENGINE_register_EC(ENGINE *e);
367 void ENGINE_unregister_EC(ENGINE *e);
370 int ENGINE_register_DH(ENGINE *e);
371 void ENGINE_unregister_DH(ENGINE *e);
374 int ENGINE_register_RAND(ENGINE *e);
375 void ENGINE_unregister_RAND(ENGINE *e);
378 int ENGINE_register_ciphers(ENGINE *e);
379 void ENGINE_unregister_ciphers(ENGINE *e);
382 int ENGINE_register_digests(ENGINE *e);
383 void ENGINE_unregister_digests(ENGINE *e);
386 int ENGINE_register_pkey_meths(ENGINE *e);
387 void ENGINE_unregister_pkey_meths(ENGINE *e);
390 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
391 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
400 int ENGINE_register_complete(ENGINE *e);
410 * commands that require an operational ENGINE, and only use functional
413 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void));
416 * This function tests if an ENGINE-specific command is usable as a
421 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
429 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
433 * This function passes a command-name and argument to an ENGINE. The
435 * called using 'arg' as an argument (unless the ENGINE doesn't support such
438 * to a numeric value. If cmd_optional is non-zero, then if the ENGINE
441 * (or config files) can supply engine-specific config data to the ENGINE at
449 * 'ENGINE'-enabled devices should write ENGINE implementations with
450 * parameterisations that work in this scheme, so that compliant ENGINE-based
452 * same ENGINE-enabled devices, across applications.
454 int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
458 * These functions are useful for manufacturing new ENGINE structures. They
460 * ENGINE structure with personalised implementations of things prior to
461 * using it directly or adding it to the builtin ENGINE list in OpenSSL.
462 * These are also here so that the ENGINE structure doesn't have to be
465 ENGINE *ENGINE_new(void);
466 int ENGINE_free(ENGINE *e);
467 int ENGINE_up_ref(ENGINE *e);
468 int ENGINE_set_id(ENGINE *e, const char *id);
469 int ENGINE_set_name(ENGINE *e, const char *name);
470 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
471 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
472 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
473 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
474 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
475 int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
476 int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
477 int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
478 int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
479 int ENGINE_set_load_privkey_function(ENGINE *e,
481 int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
482 int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
485 int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
486 int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
487 int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
488 int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
489 int ENGINE_set_flags(ENGINE *e, int flags);
490 int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
491 /* These functions allow control over any per-structure ENGINE data. */
494 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
495 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
506 * These return values from within the ENGINE structure. These can be useful
511 const char *ENGINE_get_id(const ENGINE *e);
512 const char *ENGINE_get_name(const ENGINE *e);
513 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
514 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
515 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
516 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
517 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
518 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
519 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
520 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
521 ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
522 ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
523 ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
524 ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
526 ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
527 ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
528 ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
529 ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
530 const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
531 const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
532 const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
533 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
534 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
537 const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
540 const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
541 int ENGINE_get_flags(const ENGINE *e);
544 * FUNCTIONAL functions. These functions deal with ENGINE structures that
551 * ENGINE has 2 reference counts; structural and functional. Every time a
561 int ENGINE_init(ENGINE *e);
567 int ENGINE_finish(ENGINE *e);
574 EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
576 EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
578 int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
584 * This returns a pointer for the current ENGINE structure that is (by
589 ENGINE *ENGINE_get_default_RSA(void);
591 ENGINE *ENGINE_get_default_DSA(void);
592 ENGINE *ENGINE_get_default_EC(void);
593 ENGINE *ENGINE_get_default_DH(void);
594 ENGINE *ENGINE_get_default_RAND(void);
599 ENGINE *ENGINE_get_cipher_engine(int nid);
600 ENGINE *ENGINE_get_digest_engine(int nid);
601 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
602 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
605 * This sets a new default ENGINE structure for performing RSA operations. If
606 * the result is non-zero (success) then the ENGINE structure will have had
610 int ENGINE_set_default_RSA(ENGINE *e);
611 int ENGINE_set_default_string(ENGINE *e, const char *def_list);
613 int ENGINE_set_default_DSA(ENGINE *e);
614 int ENGINE_set_default_EC(ENGINE *e);
615 int ENGINE_set_default_DH(ENGINE *e);
616 int ENGINE_set_default_RAND(ENGINE *e);
617 int ENGINE_set_default_ciphers(ENGINE *e);
618 int ENGINE_set_default_digests(ENGINE *e);
619 int ENGINE_set_default_pkey_meths(ENGINE *e);
620 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
629 int ENGINE_set_default(ENGINE *e, unsigned int flags);
637 /* DYNAMIC ENGINE SUPPORT */
649 * When compiling an ENGINE entirely as an external shared library, loadable
650 * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns'
697 * This function is passed the ENGINE structure to initialise with its own
700 * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
704 * represents the ENGINE id that the loader is looking for. If this is NULL,
706 * 'default' ENGINE. If non-NULL, the shared library must initialise only an
707 * ENGINE matching the passed 'id'. The function is expected to be
710 * 'fn' is a callback function that populates the ENGINE structure and
712 * [static] int fn(ENGINE *e, const char *id);
714 typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
718 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
720 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
731 * If the loading application (or library) and the loaded ENGINE library
735 * the loaded ENGINE has (or gets from through the loader) its own copy of
738 * static data and let the loading application and loaded ENGINE compare