1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimDSA_set_default_method, DSA_get_default_method, 6e71b7053SJung-uk KimDSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method 7e71b7053SJung-uk Kim 8e71b7053SJung-uk Kim=head1 SYNOPSIS 9e71b7053SJung-uk Kim 10e71b7053SJung-uk Kim #include <openssl/dsa.h> 11e71b7053SJung-uk Kim 12*b077aed3SPierre ProncheryThe following functions have been deprecated since OpenSSL 3.0, and can be 13*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 14*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>: 15*b077aed3SPierre Pronchery 16e71b7053SJung-uk Kim void DSA_set_default_method(const DSA_METHOD *meth); 17e71b7053SJung-uk Kim 18e71b7053SJung-uk Kim const DSA_METHOD *DSA_get_default_method(void); 19e71b7053SJung-uk Kim 20e71b7053SJung-uk Kim int DSA_set_method(DSA *dsa, const DSA_METHOD *meth); 21e71b7053SJung-uk Kim 22e71b7053SJung-uk Kim DSA *DSA_new_method(ENGINE *engine); 23e71b7053SJung-uk Kim 24*b077aed3SPierre Pronchery const DSA_METHOD *DSA_OpenSSL(void); 25e71b7053SJung-uk Kim 26e71b7053SJung-uk Kim=head1 DESCRIPTION 27e71b7053SJung-uk Kim 28*b077aed3SPierre ProncheryAll of the functions described on this page are deprecated. 29*b077aed3SPierre ProncheryApplications should providers instead of method overrides. 30*b077aed3SPierre Pronchery 31e71b7053SJung-uk KimA B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA 32e71b7053SJung-uk Kimoperations. By modifying the method, alternative implementations 33e71b7053SJung-uk Kimsuch as hardware accelerators may be used. IMPORTANT: See the NOTES section for 34e71b7053SJung-uk Kimimportant information about how these DSA API functions are affected by the use 35e71b7053SJung-uk Kimof B<ENGINE> API calls. 36e71b7053SJung-uk Kim 37e71b7053SJung-uk KimInitially, the default DSA_METHOD is the OpenSSL internal implementation, 38e71b7053SJung-uk Kimas returned by DSA_OpenSSL(). 39e71b7053SJung-uk Kim 40e71b7053SJung-uk KimDSA_set_default_method() makes B<meth> the default method for all DSA 41e71b7053SJung-uk Kimstructures created later. 42e71b7053SJung-uk KimB<NB>: This is true only whilst no ENGINE has 43e71b7053SJung-uk Kimbeen set as a default for DSA, so this function is no longer recommended. 44e71b7053SJung-uk KimThis function is not thread-safe and should not be called at the same time 45e71b7053SJung-uk Kimas other OpenSSL functions. 46e71b7053SJung-uk Kim 47e71b7053SJung-uk KimDSA_get_default_method() returns a pointer to the current default 48e71b7053SJung-uk KimDSA_METHOD. However, the meaningfulness of this result is dependent on 49e71b7053SJung-uk Kimwhether the ENGINE API is being used, so this function is no longer 50e71b7053SJung-uk Kimrecommended. 51e71b7053SJung-uk Kim 52e71b7053SJung-uk KimDSA_set_method() selects B<meth> to perform all operations using the key 53e71b7053SJung-uk KimB<rsa>. This will replace the DSA_METHOD used by the DSA key and if the 54e71b7053SJung-uk Kimprevious method was supplied by an ENGINE, the handle to that ENGINE will 55e71b7053SJung-uk Kimbe released during the change. It is possible to have DSA keys that only 5658f35182SJung-uk Kimwork with certain DSA_METHOD implementations (e.g. from an ENGINE module 57e71b7053SJung-uk Kimthat supports embedded hardware-protected keys), and in such cases 58e71b7053SJung-uk Kimattempting to change the DSA_METHOD for the key can have unexpected 59*b077aed3SPierre Proncheryresults. See L<DSA_meth_new(3)> for information on constructing custom DSA_METHOD 60e71b7053SJung-uk Kimobjects; 61e71b7053SJung-uk Kim 62e71b7053SJung-uk KimDSA_new_method() allocates and initializes a DSA structure so that B<engine> 63e71b7053SJung-uk Kimwill be used for the DSA operations. If B<engine> is NULL, the default engine 64e71b7053SJung-uk Kimfor DSA operations is used, and if no default ENGINE is set, the DSA_METHOD 65e71b7053SJung-uk Kimcontrolled by DSA_set_default_method() is used. 66e71b7053SJung-uk Kim 67e71b7053SJung-uk Kim=head1 RETURN VALUES 68e71b7053SJung-uk Kim 69e71b7053SJung-uk KimDSA_OpenSSL() and DSA_get_default_method() return pointers to the respective 70e71b7053SJung-uk KimB<DSA_METHOD>s. 71e71b7053SJung-uk Kim 72e71b7053SJung-uk KimDSA_set_default_method() returns no value. 73e71b7053SJung-uk Kim 7458f35182SJung-uk KimDSA_set_method() returns nonzero if the provided B<meth> was successfully set as 75e71b7053SJung-uk Kimthe method for B<dsa> (including unloading the ENGINE handle if the previous 76e71b7053SJung-uk Kimmethod was supplied by an ENGINE). 77e71b7053SJung-uk Kim 78e71b7053SJung-uk KimDSA_new_method() returns NULL and sets an error code that can be 79e71b7053SJung-uk Kimobtained by L<ERR_get_error(3)> if the allocation 80e71b7053SJung-uk Kimfails. Otherwise it returns a pointer to the newly allocated structure. 81e71b7053SJung-uk Kim 82e71b7053SJung-uk Kim=head1 SEE ALSO 83e71b7053SJung-uk Kim 84e71b7053SJung-uk KimL<DSA_new(3)>, L<DSA_new(3)>, L<DSA_meth_new(3)> 85e71b7053SJung-uk Kim 86*b077aed3SPierre Pronchery=head1 HISTORY 87*b077aed3SPierre Pronchery 88*b077aed3SPierre ProncheryAll of these functions were deprecated in OpenSSL 3.0. 89*b077aed3SPierre Pronchery 90e71b7053SJung-uk Kim=head1 COPYRIGHT 91e71b7053SJung-uk Kim 92*b077aed3SPierre ProncheryCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. 93e71b7053SJung-uk Kim 94*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 95e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 96e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 97e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 98e71b7053SJung-uk Kim 99e71b7053SJung-uk Kim=cut 100