Home | History | Annotate | Download | only in engine

Lines Matching refs:ENGINE

1 /* openssl/engine.h */
70 #error ENGINE is disabled.
122 * internally to control registration of ENGINE implementations, and can be set
127 /* ENGINE flags that can be set by ENGINE_set_flags(). */
132 * control commands on behalf of the ENGINE using their "cmd_defns" data. */
136 * "ENGINE_by_id()". When an ENGINE must store state (eg. if ENGINE_ctrl()
139 * to obtain the ENGINE will result in it being copied into a new structure.
141 * the existing ENGINE's structural reference count. */
170 * same functionality to their own ENGINE-specific control functions that can be
173 * fact that application code can find and use them without requiring per-ENGINE
196 /* These control commands allow an application to deal with an arbitrary engine
199 * including ENGINE-specific command types, return zero for an error.
201 * An ENGINE can choose to implement these ctrl functions, and can internally
204 * ENGINE_ctrl() code handles this on the ENGINE's behalf using the cmd_defns
205 * data (set using ENGINE_set_cmd_defns()). This means an ENGINE's ctrl()
209 /* Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", then
211 * checking this first if the caller is trying to "discover" the engine's
215 * engine. Returns zero if no ctrl commands are supported. */
217 /* The 'long' argument specifies a command implemented by the engine, and the
236 * engine-specific ctrl command expects. */
239 /* ENGINE implementations should start the numbering of their own control
244 * functionality is now available through ENGINE-specific control commands
249 /* Flags specific to the nCipher "chil" engine */
259 /* If an ENGINE supports its own specific control commands and wishes the
278 typedef int (*ENGINE_GEN_INT_FUNC_PTR)(ENGINE *);
280 typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void));
282 typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
284 typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl,
287 /* These callback types are for an ENGINE's handler for cipher and digest logic.
289 * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
290 * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
299 typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, int);
300 typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int);
301 typedef int (*ENGINE_PKEY_METHS_PTR)(ENGINE *, EVP_PKEY_METHOD **, const int **, int);
302 typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **, const int **, int);
303 /* STRUCTURE functions ... all of these functions deal with pointers to ENGINE
309 * decrement the structural reference count of the "current" ENGINE and
310 * increment the structural reference count of the ENGINE it returns (unless it
313 /* Get the first/last "ENGINE" type available. */
314 ENGINE *ENGINE_get_first(void);
315 ENGINE *ENGINE_get_last(void);
316 /* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
317 ENGINE *ENGINE_get_next(ENGINE *e);
318 ENGINE *ENGINE_get_prev(ENGINE *e);
319 /* Add another "ENGINE" type into the array. */
320 int ENGINE_add(ENGINE *e);
321 /* Remove an existing "ENGINE" type from the array. */
322 int ENGINE_remove(ENGINE *e);
323 /* Retrieve an engine from the list by its unique "id" value. */
324 ENGINE *ENGINE_by_id(const char *id);
362 int ENGINE_register_RSA(ENGINE *e);
363 void ENGINE_unregister_RSA(ENGINE *e);
366 int ENGINE_register_DSA(ENGINE *e);
367 void ENGINE_unregister_DSA(ENGINE *e);
370 int ENGINE_register_ECDH(ENGINE *e);
371 void ENGINE_unregister_ECDH(ENGINE *e);
374 int ENGINE_register_ECDSA(ENGINE *e);
375 void ENGINE_unregister_ECDSA(ENGINE *e);
378 int ENGINE_register_DH(ENGINE *e);
379 void ENGINE_unregister_DH(ENGINE *e);
382 int ENGINE_register_RAND(ENGINE *e);
383 void ENGINE_unregister_RAND(ENGINE *e);
386 int ENGINE_register_STORE(ENGINE *e);
387 void ENGINE_unregister_STORE(ENGINE *e);
390 int ENGINE_register_ciphers(ENGINE *e);
391 void ENGINE_unregister_ciphers(ENGINE *e);
394 int ENGINE_register_digests(ENGINE *e);
395 void ENGINE_unregister_digests(ENGINE *e);
398 int ENGINE_register_pkey_meths(ENGINE *e);
399 void ENGINE_unregister_pkey_meths(ENGINE *e);
402 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
403 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
410 int ENGINE_register_complete(ENGINE *e);
413 /* Send parametrised control commands to the engine. The possibilities to send
417 * reference to an engine, but many control commands may require the engine be
419 * operational ENGINE, and only use functional references in such situations. */
420 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void));
422 /* This function tests if an ENGINE-specific command is usable as a "setting".
426 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
432 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
435 /* This function passes a command-name and argument to an ENGINE. The cmd_name
437 * 'arg' as an argument (unless the ENGINE doesn't support such a command, in
440 * cmd_optional is non-zero, then if the ENGINE doesn't support the given
443 * engine-specific config data to the ENGINE at run-time to control behaviour of
450 * other words, vendors of 'ENGINE'-enabled devices should write ENGINE
452 * compliant ENGINE-based applications can work consistently with the same
453 * configuration for the same ENGINE-enabled devices, across applications. */
454 int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
457 /* These functions are useful for manufacturing new ENGINE structures. They
458 * don't address reference counting at all - one uses them to populate an ENGINE
460 * directly or adding it to the builtin ENGINE list in OpenSSL. These are also
461 * here so that the ENGINE structure doesn't have to be exposed and break binary
463 ENGINE *ENGINE_new(void);
464 int ENGINE_free(ENGINE *e);
465 int ENGINE_up_ref(ENGINE *e);
466 int ENGINE_set_id(ENGINE *e, const char *id);
467 int ENGINE_set_name(ENGINE *e, const char *name);
468 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
469 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
470 int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth);
471 int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth);
472 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
473 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
474 int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_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, ENGINE_LOAD_KEY_PTR loadpriv_f);
480 int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
481 int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
483 int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
484 int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
485 int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
486 int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
487 int ENGINE_set_flags(ENGINE *e, int flags);
488 int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
489 /* These functions allow control over any per-structure ENGINE data. */
492 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
493 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
501 /* These return values from within the ENGINE structure. These can be useful
505 const char *ENGINE_get_id(const ENGINE *e);
506 const char *ENGINE_get_name(const ENGINE *e);
507 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
508 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
509 const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e);
510 const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e);
511 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
512 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
513 const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e);
514 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
515 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
516 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
517 ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
518 ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
519 ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
520 ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
521 ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
522 ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
523 ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
524 ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
525 const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
526 const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
527 const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
528 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
529 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
531 const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
533 const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
534 int ENGINE_get_flags(const ENGINE *e);
536 /* FUNCTIONAL functions. These functions deal with ENGINE structures
539 * engine types, creating new engine types, and other "list" operations.
543 * attached or not functioning correctly. Each ENGINE has 2 reference
548 /* Initialise a engine type for use (or up its reference count if it's
549 * already in use). This will fail if the engine is not currently
551 int ENGINE_init(ENGINE *e);
552 /* Free a functional reference to a engine type. This does not require
555 int ENGINE_finish(ENGINE *e);
558 * location, handled by the engine. The storage may be on a card or
560 EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
562 EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
564 int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
569 /* This returns a pointer for the current ENGINE structure that
573 ENGINE *ENGINE_get_default_RSA(void);
575 ENGINE *ENGINE_get_default_DSA(void);
576 ENGINE *ENGINE_get_default_ECDH(void);
577 ENGINE *ENGINE_get_default_ECDSA(void);
578 ENGINE *ENGINE_get_default_DH(void);
579 ENGINE *ENGINE_get_default_RAND(void);
582 ENGINE *ENGINE_get_cipher_engine(int nid);
583 ENGINE *ENGINE_get_digest_engine(int nid);
584 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
585 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
587 /* This sets a new default ENGINE structure for performing RSA
588 * operations. If the result is non-zero (success) then the ENGINE
591 int ENGINE_set_default_RSA(ENGINE *e);
592 int ENGINE_set_default_string(ENGINE *e, const char *def_list);
594 int ENGINE_set_default_DSA(ENGINE *e);
595 int ENGINE_set_default_ECDH(ENGINE *e);
596 int ENGINE_set_default_ECDSA(ENGINE *e);
597 int ENGINE_set_default_DH(ENGINE *e);
598 int ENGINE_set_default_RAND(ENGINE *e);
599 int ENGINE_set_default_ciphers(ENGINE *e);
600 int ENGINE_set_default_digests(ENGINE *e);
601 int ENGINE_set_default_pkey_meths(ENGINE *e);
602 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
609 int ENGINE_set_default(ENGINE *e, unsigned int flags);
617 /* DYNAMIC ENGINE SUPPORT */
626 /* When compiling an ENGINE entirely as an external shared library, loadable by
627 * the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' structure
684 /* This function is passed the ENGINE structure to initialise with its own
687 * be aborted, (b) the previous ENGINE state will be memcpy'd back onto the
690 * could leak. The 'id' parameter, if non-NULL, represents the ENGINE id that
692 * return failure or to initialise a 'default' ENGINE. If non-NULL, the shared
693 * library must initialise only an ENGINE matching the passed 'id'. The function
696 * the parameter 'fn' is a callback function that populates the ENGINE structure
698 * [static] int fn(ENGINE *e, const char *id); */
699 typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
703 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
720 /* If the loading application (or library) and the loaded ENGINE library share
724 * loaded ENGINE has (or gets from through the loader) its own copy of the
727 * and let the loading application and loaded ENGINE compare their respective
741 /* Error codes for the ENGINE functions. */