Home | History | Annotate | Line # | Download | only in man7
      1 =pod
      2 
      3 =head1 NAME
      4 
      5 provider-keymgmt - The KEYMGMT library E<lt>-E<gt> provider functions
      6 
      7 =head1 SYNOPSIS
      8 
      9  #include <openssl/core_dispatch.h>
     10 
     11  /*
     12   * None of these are actual functions, but are displayed like this for
     13   * the function signatures for functions that are offered as function
     14   * pointers in OSSL_DISPATCH arrays.
     15   */
     16 
     17  /* Key object (keydata) creation and destruction */
     18  void *OSSL_FUNC_keymgmt_new(void *provctx);
     19  void OSSL_FUNC_keymgmt_free(void *keydata);
     20 
     21  /* Generation, a more complex constructor */
     22  void *OSSL_FUNC_keymgmt_gen_init(void *provctx, int selection,
     23                                   const OSSL_PARAM params[]);
     24  int OSSL_FUNC_keymgmt_gen_set_template(void *genctx, void *template);
     25  int OSSL_FUNC_keymgmt_gen_get_params(void *genctx, OSSL_PARAM params[]);
     26  int OSSL_FUNC_keymgmt_gen_set_params(void *genctx, const OSSL_PARAM params[]);
     27  const OSSL_PARAM *OSSL_FUNC_keymgmt_gen_gettable_params(void *genctx,
     28                                                          void *provctx);
     29  const OSSL_PARAM *OSSL_FUNC_keymgmt_gen_settable_params(void *genctx,
     30                                                          void *provctx);
     31  void *OSSL_FUNC_keymgmt_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg);
     32  void OSSL_FUNC_keymgmt_gen_cleanup(void *genctx);
     33 
     34  /* Key loading by object reference, also a constructor */
     35  void *OSSL_FUNC_keymgmt_load(const void *reference, size_t reference_sz);
     36 
     37  /* Key object information */
     38  int OSSL_FUNC_keymgmt_get_params(void *keydata, OSSL_PARAM params[]);
     39  const OSSL_PARAM *OSSL_FUNC_keymgmt_gettable_params(void *provctx);
     40  int OSSL_FUNC_keymgmt_set_params(void *keydata, const OSSL_PARAM params[]);
     41  const OSSL_PARAM *OSSL_FUNC_keymgmt_settable_params(void *provctx);
     42 
     43  /* Key object content checks */
     44  int OSSL_FUNC_keymgmt_has(const void *keydata, int selection);
     45  int OSSL_FUNC_keymgmt_match(const void *keydata1, const void *keydata2,
     46                              int selection);
     47 
     48  /* Discovery of supported operations */
     49  const char *OSSL_FUNC_keymgmt_query_operation_name(int operation_id);
     50 
     51  /* Key object import and export functions */
     52  int OSSL_FUNC_keymgmt_import(void *keydata, int selection, const OSSL_PARAM params[]);
     53  const OSSL_PARAM *OSSL_FUNC_keymgmt_import_types(int selection);
     54  const OSSL_PARAM *OSSL_FUNC_keymgmt_import_types_ex(void *provctx, int selection);
     55  int OSSL_FUNC_keymgmt_export(void *keydata, int selection,
     56                               OSSL_CALLBACK *param_cb, void *cbarg);
     57  const OSSL_PARAM *OSSL_FUNC_keymgmt_export_types(int selection);
     58  const OSSL_PARAM *OSSL_FUNC_keymgmt_export_types_ex(void *provctx, int selection);
     59 
     60  /* Key object duplication, a constructor */
     61  void *OSSL_FUNC_keymgmt_dup(const void *keydata_from, int selection);
     62 
     63  /* Key object validation */
     64  int OSSL_FUNC_keymgmt_validate(const void *keydata, int selection, int checktype);
     65 
     66 =head1 DESCRIPTION
     67 
     68 The KEYMGMT operation doesn't have much public visibility in OpenSSL
     69 libraries, it's rather an internal operation that's designed to work
     70 in tandem with operations that use private/public key pairs.
     71 
     72 Because the KEYMGMT operation shares knowledge with the operations it
     73 works with in tandem, they must belong to the same provider.
     74 The OpenSSL libraries will ensure that they do.
     75 
     76 The primary responsibility of the KEYMGMT operation is to hold the
     77 provider side key data for the OpenSSL library EVP_PKEY structure.
     78 
     79 All "functions" mentioned here are passed as function pointers between
     80 F<libcrypto> and the provider in L<OSSL_DISPATCH(3)> arrays via
     81 L<OSSL_ALGORITHM(3)> arrays that are returned by the provider's
     82 provider_query_operation() function
     83 (see L<provider-base(7)/Provider Functions>).
     84 
     85 All these "functions" have a corresponding function type definition
     86 named B<OSSL_FUNC_{name}_fn>, and a helper function to retrieve the
     87 function pointer from a L<OSSL_DISPATCH(3)> element named
     88 B<OSSL_FUNC_{name}>.
     89 For example, the "function" OSSL_FUNC_keymgmt_new() has these:
     90 
     91  typedef void *(OSSL_FUNC_keymgmt_new_fn)(void *provctx);
     92  static ossl_inline OSSL_FUNC_keymgmt_new_fn
     93      OSSL_FUNC_keymgmt_new(const OSSL_DISPATCH *opf);
     94 
     95 L<OSSL_DISPATCH(3)> arrays are indexed by numbers that are provided as
     96 macros in L<openssl-core_dispatch.h(7)>, as follows:
     97 
     98  OSSL_FUNC_keymgmt_new                  OSSL_FUNC_KEYMGMT_NEW
     99  OSSL_FUNC_keymgmt_free                 OSSL_FUNC_KEYMGMT_FREE
    100 
    101  OSSL_FUNC_keymgmt_gen_init             OSSL_FUNC_KEYMGMT_GEN_INIT
    102  OSSL_FUNC_keymgmt_gen_set_template     OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE
    103  OSSL_FUNC_keymgmt_gen_get_params       OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS
    104  OSSL_FUNC_keymgmt_gen_gettable_params  OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS
    105  OSSL_FUNC_keymgmt_gen_set_params       OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS
    106  OSSL_FUNC_keymgmt_gen_settable_params  OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS
    107  OSSL_FUNC_keymgmt_gen                  OSSL_FUNC_KEYMGMT_GEN
    108  OSSL_FUNC_keymgmt_gen_cleanup          OSSL_FUNC_KEYMGMT_GEN_CLEANUP
    109 
    110  OSSL_FUNC_keymgmt_load                 OSSL_FUNC_KEYMGMT_LOAD
    111 
    112  OSSL_FUNC_keymgmt_get_params           OSSL_FUNC_KEYMGMT_GET_PARAMS
    113  OSSL_FUNC_keymgmt_gettable_params      OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS
    114  OSSL_FUNC_keymgmt_set_params           OSSL_FUNC_KEYMGMT_SET_PARAMS
    115  OSSL_FUNC_keymgmt_settable_params      OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS
    116 
    117  OSSL_FUNC_keymgmt_query_operation_name OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME
    118 
    119  OSSL_FUNC_keymgmt_has                  OSSL_FUNC_KEYMGMT_HAS
    120  OSSL_FUNC_keymgmt_validate             OSSL_FUNC_KEYMGMT_VALIDATE
    121  OSSL_FUNC_keymgmt_match                OSSL_FUNC_KEYMGMT_MATCH
    122 
    123  OSSL_FUNC_keymgmt_import               OSSL_FUNC_KEYMGMT_IMPORT
    124  OSSL_FUNC_keymgmt_import_types         OSSL_FUNC_KEYMGMT_IMPORT_TYPES
    125  OSSL_FUNC_keymgmt_import_types_ex      OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX
    126  OSSL_FUNC_keymgmt_export               OSSL_FUNC_KEYMGMT_EXPORT
    127  OSSL_FUNC_keymgmt_export_types         OSSL_FUNC_KEYMGMT_EXPORT_TYPES
    128  OSSL_FUNC_keymgmt_export_types_ex      OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX
    129 
    130  OSSL_FUNC_keymgmt_dup                  OSSL_FUNC_KEYMGMT_DUP
    131 
    132 =head2 Key Objects
    133 
    134 A key object is a collection of data for an asymmetric key, and is
    135 represented as I<keydata> in this manual.
    136 
    137 The exact contents of a key object are defined by the provider, and it
    138 is assumed that different operations in one and the same provider use
    139 the exact same structure to represent this collection of data, so that
    140 for example, a key object that has been created using the KEYMGMT
    141 interface that we document here can be passed as is to other provider
    142 operations, such as OP_signature_sign_init() (see
    143 L<provider-signature(7)>).
    144 
    145 With some of the KEYMGMT functions, it's possible to select a specific
    146 subset of data to handle, governed by the bits in a I<selection>
    147 indicator.  The bits are:
    148 
    149 =over 4
    150 
    151 =item B<OSSL_KEYMGMT_SELECT_PRIVATE_KEY>
    152 
    153 Indicating that the private key data in a key object should be
    154 considered.
    155 
    156 =item B<OSSL_KEYMGMT_SELECT_PUBLIC_KEY>
    157 
    158 Indicating that the public key data in a key object should be
    159 considered.
    160 
    161 =item B<OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS>
    162 
    163 Indicating that the domain parameters in a key object should be
    164 considered.
    165 
    166 =item B<OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS>
    167 
    168 Indicating that other parameters in a key object should be
    169 considered.
    170 
    171 Other parameters are key parameters that don't fit any other
    172 classification.  In other words, this particular selector bit works as
    173 a last resort bit bucket selector.
    174 
    175 =back
    176 
    177 Some selector bits have also been combined for easier use:
    178 
    179 =over 4
    180 
    181 =item B<OSSL_KEYMGMT_SELECT_ALL_PARAMETERS>
    182 
    183 Indicating that all key object parameters should be considered,
    184 regardless of their more granular classification.
    185 
    186 =for comment This should used by EVP functions such as
    187 EVP_PKEY_copy_parameters() and EVP_PKEY_parameters_eq()
    188 
    189 This is a combination of B<OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS> and
    190 B<OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS>.
    191 
    192 =for comment If more parameter categories are added, they should be
    193 mentioned here too.
    194 
    195 =item B<OSSL_KEYMGMT_SELECT_KEYPAIR>
    196 
    197 Indicating that both the whole key pair in a key object should be
    198 considered, i.e. the combination of public and private key.
    199 
    200 This is a combination of B<OSSL_KEYMGMT_SELECT_PRIVATE_KEY> and
    201 B<OSSL_KEYMGMT_SELECT_PUBLIC_KEY>.
    202 
    203 =item B<OSSL_KEYMGMT_SELECT_ALL>
    204 
    205 Indicating that everything in a key object should be considered.
    206 
    207 =back
    208 
    209 The exact interpretation of those bits or how they combine is left to
    210 each function where you can specify a selector.
    211 
    212 It's left to the provider implementation to decide what is reasonable
    213 to do with regards to received selector bits and how to do it.
    214 Among others, an implementation of OSSL_FUNC_keymgmt_match() might opt
    215 to not compare the private half if it has compared the public half,
    216 since a match of one half implies a match of the other half.
    217 
    218 =head2 Constructing and Destructing Functions
    219 
    220 OSSL_FUNC_keymgmt_new() should create a provider side key object.  The
    221 provider context I<provctx> is passed and may be incorporated in the
    222 key object, but that is not mandatory.
    223 
    224 OSSL_FUNC_keymgmt_free() should free the passed I<keydata>.
    225 
    226 OSSL_FUNC_keymgmt_gen_init(), OSSL_FUNC_keymgmt_gen_set_template(),
    227 OSSL_FUNC_keymgmt_gen_get_params(), OSSL_FUNC_keymgmt_gen_gettable_params(),
    228 OSSL_FUNC_keymgmt_gen_set_params(), OSSL_FUNC_keymgmt_gen_settable_params(),
    229 OSSL_FUNC_keymgmt_gen() and OSSL_FUNC_keymgmt_gen_cleanup() work together as a
    230 more elaborate context based key object constructor.
    231 
    232 OSSL_FUNC_keymgmt_gen_init() should create the key object generation context
    233 and initialize it with I<selections>, which will determine what kind
    234 of contents the key object to be generated should get.
    235 The I<params>, if not NULL, should be set on the context in a manner similar to
    236 using OSSL_FUNC_keymgmt_set_params().
    237 
    238 OSSL_FUNC_keymgmt_gen_set_template() should add I<template> to the context
    239 I<genctx>.  The I<template> is assumed to be a key object constructed
    240 with the same KEYMGMT, and from which content that the implementation
    241 chooses can be used as a template for the key object to be generated.
    242 Typically, the generation of a DSA or DH key would get the domain
    243 parameters from this I<template>.
    244 
    245 OSSL_FUNC_keymgmt_gen_get_params() should retrieve parameters into
    246 I<params> in the key object generation context I<genctx>.
    247 
    248 OSSL_FUNC_keymgmt_gen_gettable_params() should return a constant array of
    249 descriptor L<OSSL_PARAM(3)>, for parameters that
    250 OSSL_FUNC_keymgmt_gen_get_params() can handle.
    251 
    252 OSSL_FUNC_keymgmt_gen_set_params() should set additional parameters from
    253 I<params> in the key object generation context I<genctx>.
    254 
    255 OSSL_FUNC_keymgmt_gen_settable_params() should return a constant array of
    256 descriptor L<OSSL_PARAM(3)>, for parameters that OSSL_FUNC_keymgmt_gen_set_params()
    257 can handle.
    258 
    259 OSSL_FUNC_keymgmt_gen() should perform the key object generation itself, and
    260 return the result.  The callback I<cb> should be called at regular
    261 intervals with indications on how the key object generation
    262 progresses.
    263 
    264 OSSL_FUNC_keymgmt_gen_cleanup() should clean up and free the key object
    265 generation context I<genctx>
    266 
    267 OSSL_FUNC_keymgmt_load() creates a provider side key object based on a
    268 I<reference> object with a size of I<reference_sz> bytes, that only the
    269 provider knows how to interpret, but that may come from other operations.
    270 Outside the provider, this reference is simply an array of bytes.
    271 
    272 At least one of OSSL_FUNC_keymgmt_new(), OSSL_FUNC_keymgmt_gen() and
    273 OSSL_FUNC_keymgmt_load() are mandatory, as well as OSSL_FUNC_keymgmt_free() and
    274 OSSL_FUNC_keymgmt_has(). Additionally, if OSSL_FUNC_keymgmt_gen() is present,
    275 OSSL_FUNC_keymgmt_gen_init() and OSSL_FUNC_keymgmt_gen_cleanup() must be
    276 present as well.
    277 
    278 =head2 Key Object Information Functions
    279 
    280 OSSL_FUNC_keymgmt_get_params() should extract information data associated
    281 with the given I<keydata>, see L</Common Information Parameters>.
    282 
    283 OSSL_FUNC_keymgmt_gettable_params() should return a constant array of
    284 descriptor L<OSSL_PARAM(3)>, for parameters that OSSL_FUNC_keymgmt_get_params()
    285 can handle.
    286 
    287 If OSSL_FUNC_keymgmt_gettable_params() is present, OSSL_FUNC_keymgmt_get_params()
    288 must also be present, and vice versa.
    289 
    290 OSSL_FUNC_keymgmt_set_params() should update information data associated
    291 with the given I<keydata>, see L</Common Information Parameters>.
    292 
    293 OSSL_FUNC_keymgmt_settable_params() should return a constant array of
    294 descriptor L<OSSL_PARAM(3)>, for parameters that OSSL_FUNC_keymgmt_set_params()
    295 can handle.
    296 
    297 If OSSL_FUNC_keymgmt_settable_params() is present, OSSL_FUNC_keymgmt_set_params()
    298 must also be present, and vice versa.
    299 
    300 =head2 Key Object Checking Functions
    301 
    302 OSSL_FUNC_keymgmt_query_operation_name() should return the name of the
    303 supported algorithm for the operation I<operation_id>.  This is
    304 similar to provider_query_operation() (see L<provider-base(7)>),
    305 but only works as an advisory.  If this function is not present, or
    306 returns NULL, the caller is free to assume that there's an algorithm
    307 from the same provider, of the same name as the one used to fetch the
    308 keymgmt and try to use that.
    309 
    310 OSSL_FUNC_keymgmt_has() should check whether the given I<keydata> contains the subsets
    311 of data indicated by the I<selector>.  A combination of several
    312 selector bits must consider all those subsets, not just one.  An
    313 implementation is, however, free to consider an empty subset of data
    314 to still be a valid subset. For algorithms where some selection is
    315 not meaningful such as B<OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS> for
    316 RSA keys the function should just return 1 as the selected subset
    317 is not really missing in the key.
    318 
    319 OSSL_FUNC_keymgmt_validate() should check if the I<keydata> contains valid
    320 data subsets indicated by I<selection>.  Some combined selections of
    321 data subsets may cause validation of the combined data.
    322 For example, the combination of B<OSSL_KEYMGMT_SELECT_PRIVATE_KEY> and
    323 B<OSSL_KEYMGMT_SELECT_PUBLIC_KEY> (or B<OSSL_KEYMGMT_SELECT_KEYPAIR>
    324 for short) is expected to check that the pairwise consistency of
    325 I<keydata> is valid. The I<checktype> parameter controls what type of check is
    326 performed on the subset of data. Two types of check are defined:
    327 B<OSSL_KEYMGMT_VALIDATE_FULL_CHECK> and B<OSSL_KEYMGMT_VALIDATE_QUICK_CHECK>.
    328 The interpretation of how much checking is performed in a full check versus a
    329 quick check is key type specific. Some providers may have no distinction
    330 between a full check and a quick check. For algorithms where some selection is
    331 not meaningful such as B<OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS> for
    332 RSA keys the function should just return 1 as there is nothing to validate for
    333 that selection.
    334 
    335 OSSL_FUNC_keymgmt_match() should check if the data subset indicated by
    336 I<selection> in I<keydata1> and I<keydata2> match.  It is assumed that
    337 the caller has ensured that I<keydata1> and I<keydata2> are both owned
    338 by the implementation of this function.
    339 
    340 =head2 Key Object Import, Export and Duplication Functions
    341 
    342 OSSL_FUNC_keymgmt_import() should import data indicated by I<selection> into
    343 I<keydata> with values taken from the L<OSSL_PARAM(3)> array I<params>.
    344 
    345 OSSL_FUNC_keymgmt_export() should extract values indicated by I<selection>
    346 from I<keydata>, create an L<OSSL_PARAM(3)> array with them and call
    347 I<param_cb> with that array as well as the given I<cbarg>.
    348 
    349 OSSL_FUNC_keymgmt_import_types() and OSSL_FUNC_keymgmt_import_types_ex()
    350 should return a constant array of descriptor
    351 L<OSSL_PARAM(3)> for data indicated by I<selection>, for parameters that
    352 OSSL_FUNC_keymgmt_import() can handle.
    353 Either OSSL_FUNC_keymgmt_import_types() or OSSL_FUNC_keymgmt_import_types_ex(),
    354 must be implemented, if OSSL_FUNC_keymgmt_import_types_ex() is implemented, then
    355 it is preferred over OSSL_FUNC_keymgmt_import_types().
    356 Providers that are supposed to be backward compatible with OpenSSL 3.0 or 3.1
    357 must continue to implement OSSL_FUNC_keymgmt_import_types().
    358 
    359 OSSL_FUNC_keymgmt_export_types() and OSSL_FUNC_keymgmt_export_types_ex()
    360 should return a constant array of descriptor
    361 L<OSSL_PARAM(3)> for data indicated by I<selection>, that the
    362 OSSL_FUNC_keymgmt_export() callback can expect to receive.
    363 Either OSSL_FUNC_keymgmt_export_types() or OSSL_FUNC_keymgmt_export_types_ex(),
    364 must be implemented, if OSSL_FUNC_keymgmt_export_types_ex() is implemented, then
    365 it is preferred over OSSL_FUNC_keymgmt_export_types().
    366 Providers that are supposed to be backward compatible with OpenSSL 3.0 or 3.1
    367 must continue to implement OSSL_FUNC_keymgmt_export_types().
    368 
    369 OSSL_FUNC_keymgmt_dup() should duplicate data subsets indicated by
    370 I<selection> or the whole key data I<keydata_from> and create a new
    371 provider side key object with the data.
    372 
    373 =head2 Common Information Parameters
    374 
    375 See L<OSSL_PARAM(3)> for further details on the parameters structure.
    376 
    377 Common information parameters currently recognised by all built-in
    378 keymgmt algorithms are as follows:
    379 
    380 =over 4
    381 
    382 =item "bits" (B<OSSL_PKEY_PARAM_BITS>) <integer>
    383 
    384 The value should be the cryptographic length of the cryptosystem to
    385 which the key belongs, in bits.  The definition of cryptographic
    386 length is specific to the key cryptosystem.
    387 
    388 =item "max-size" (B<OSSL_PKEY_PARAM_MAX_SIZE>) <integer>
    389 
    390 The value should be the maximum size that a caller should allocate to
    391 safely store a signature (called I<sig> in L<provider-signature(7)>),
    392 the result of asymmetric encryption / decryption (I<out> in
    393 L<provider-asym_cipher(7)>, a derived secret (I<secret> in
    394 L<provider-keyexch(7)>, and similar data).
    395 
    396 Providers need to implement this parameter
    397 in order to properly support various use cases such as CMS signing.
    398 
    399 Because an EVP_KEYMGMT method is always tightly bound to another method
    400 (signature, asymmetric cipher, key exchange, ...) and must be of the
    401 same provider, this number only needs to be synchronised with the
    402 dimensions handled in the rest of the same provider.
    403 
    404 =item "security-bits" (B<OSSL_PKEY_PARAM_SECURITY_BITS>) <integer>
    405 
    406 The value should be the number of security bits of the given key.
    407 Bits of security is defined in SP800-57.
    408 
    409 =item "mandatory-digest" (B<OSSL_PKEY_PARAM_MANDATORY_DIGEST>) <UTF8 string>
    410 
    411 If there is a mandatory digest for performing a signature operation with
    412 keys from this keymgmt, this parameter should get its name as value.
    413 
    414 When EVP_PKEY_get_default_digest_name() queries this parameter and it's
    415 filled in by the implementation, its return value will be 2.
    416 
    417 If the keymgmt implementation fills in the value C<""> or C<"UNDEF">,
    418 L<EVP_PKEY_get_default_digest_name(3)> will place the string C<"UNDEF"> into
    419 its argument I<mdname>.  This signifies that no digest should be specified
    420 with the corresponding signature operation.
    421 
    422 =item "default-digest" (B<OSSL_PKEY_PARAM_DEFAULT_DIGEST>) <UTF8 string>
    423 
    424 If there is a default digest for performing a signature operation with
    425 keys from this keymgmt, this parameter should get its name as value.
    426 
    427 When L<EVP_PKEY_get_default_digest_name(3)> queries this parameter and it's
    428 filled in by the implementation, its return value will be 1.  Note that if
    429 B<OSSL_PKEY_PARAM_MANDATORY_DIGEST> is responded to as well,
    430 L<EVP_PKEY_get_default_digest_name(3)> ignores the response to this
    431 parameter.
    432 
    433 If the keymgmt implementation fills in the value C<""> or C<"UNDEF">,
    434 L<EVP_PKEY_get_default_digest_name(3)> will place the string C<"UNDEF"> into
    435 its argument I<mdname>.  This signifies that no digest has to be specified
    436 with the corresponding signature operation, but may be specified as an
    437 option.
    438 
    439 =back
    440 
    441 The OpenSSL FIPS provider also supports the following parameters:
    442 
    443 =over 4
    444 
    445 =item "fips-indicator" (B<OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR>) <integer>
    446 
    447 A getter that returns 1 if the operation is FIPS approved, or 0 otherwise.
    448 This may be used after calling OSSL_FUNC_keymgmt_gen() function. It may
    449 return 0 if either the "key-check", or "sign-check" are set to 0.
    450 
    451 =item "key-check" (B<OSSL_PKEY_PARAM_FIPS_KEY_CHECK>) <integer>
    452 
    453 If required this parameter should be set using OSSL_FUNC_keymgmt_gen_set_params()
    454 or OSSL_FUNC_keymgmt_gen_init().
    455 The default value of 1 causes an error during the init if the key is not FIPS
    456 approved (e.g. The key has a security strength of less than 112 bits). Setting
    457 this to 0 will ignore the error and set the approved "fips-indicator" to 0.
    458 This option breaks FIPS compliance if it causes the approved "fips-indicator"
    459 to return 0.
    460 
    461 =item "sign-check" (B<OSSL_PKEY_PARAM_FIPS_SIGN_CHECK>) <integer>
    462 
    463 If required this parameter should be set before the OSSL_FUNC_keymgmt_gen()
    464 function. This value is not supported by all keygen algorithms.
    465 The default value of 1 will cause an error if the generated key is not
    466 allowed to be used for signing.
    467 Setting this to 0 will ignore the error and set the approved "fips-indicator" to 0.
    468 This option breaks FIPS compliance if it causes the approved "fips-indicator"
    469 to return 0.
    470 
    471 =back
    472 
    473 =head1 RETURN VALUES
    474 
    475 OSSL_FUNC_keymgmt_new() and OSSL_FUNC_keymgmt_dup() should return a valid
    476 reference to the newly created provider side key object, or NULL on failure.
    477 
    478 OSSL_FUNC_keymgmt_import(), OSSL_FUNC_keymgmt_export(), OSSL_FUNC_keymgmt_get_params() and
    479 OSSL_FUNC_keymgmt_set_params() should return 1 for success or 0 on error.
    480 
    481 OSSL_FUNC_keymgmt_validate() should return 1 on successful validation, or 0 on
    482 failure.
    483 
    484 OSSL_FUNC_keymgmt_has() should return 1 if all the selected data subsets are contained
    485 in the given I<keydata> or 0 otherwise.
    486 
    487 OSSL_FUNC_keymgmt_query_operation_name() should return a pointer to a string matching
    488 the requested operation, or NULL if the same name used to fetch the keymgmt
    489 applies.
    490 
    491 OSSL_FUNC_keymgmt_gettable_params() and OSSL_FUNC_keymgmt_settable_params()
    492 OSSL_FUNC_keymgmt_import_types(), OSSL_FUNC_keymgmt_import_types_ex(),
    493 OSSL_FUNC_keymgmt_export_types(), OSSL_FUNC_keymgmt_export_types_ex()
    494 should
    495 always return a constant L<OSSL_PARAM(3)> array.
    496 
    497 =head1 SEE ALSO
    498 
    499 L<EVP_PKEY_get_size(3)>,
    500 L<EVP_PKEY_get_bits(3)>,
    501 L<EVP_PKEY_get_security_bits(3)>,
    502 L<provider(7)>,
    503 L<EVP_PKEY-X25519(7)>,
    504 L<EVP_PKEY-X448(7)>,
    505 L<EVP_PKEY-ED25519(7)>,
    506 L<EVP_PKEY-ED448(7)>,
    507 L<EVP_PKEY-EC(7)>,
    508 L<EVP_PKEY-RSA(7)>,
    509 L<EVP_PKEY-DSA(7)>,
    510 L<EVP_PKEY-DH(7)>,
    511 L<EVP_PKEY-ML-DSA(7)>,
    512 L<EVP_PKEY-ML-KEM(7)>,
    513 L<EVP_PKEY-SLH-DSA(7)>.
    514 
    515 =head1 HISTORY
    516 
    517 The KEYMGMT interface was introduced in OpenSSL 3.0.
    518 
    519 Functions OSSL_FUNC_keymgmt_import_types_ex(), and OSSL_FUNC_keymgmt_export_types_ex()
    520 were added with OpenSSL 3.2.
    521 
    522 The functions OSSL_FUNC_keymgmt_gen_get_params() and
    523 OSSL_FUNC_keymgmt_gen_gettable_params() were added in OpenSSL 3.4.
    524 
    525 The parameters "sign-check" and "fips-indicator" were added in OpenSSL 3.4.
    526 
    527 Support for the B<ML-DSA>, B<ML-KEM> and B<SLH-DSA> algorithms was added in OpenSSL 3.5.
    528 
    529 =head1 COPYRIGHT
    530 
    531 Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
    532 
    533 Licensed under the Apache License 2.0 (the "License").  You may not use
    534 this file except in compliance with the License.  You can obtain a copy
    535 in the file LICENSE in the source distribution or at
    536 L<https://www.openssl.org/source/license.html>.
    537 
    538 =cut
    539