DSA_SET_METHOD(3SSL)

πŸ’– DSA_SET_METHOD πŸ’–

okay bestie, welcome to a page from the OpenSSL manual, section 3SSL β€” yes that's the "library functions" section, and yes this whole page is basically a shrine to the DSA method-selection squad πŸŽ€


✨ NAME ✨

DSA_set_default_method, DSA_get_default_method, DSA_set_method, DSA_new_method, DSA_OpenSSL β€” select DSA method πŸ¦‹


🌸 SYNOPSIS 🌸

#include <openssl/dsa.h>

so here's the tea: the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” check openssl_user_macros(7) for the deets πŸ‘‘

void DSA_set_default_method(const DSA_METHOD *meth);

const DSA_METHOD *DSA_get_default_method(void);

int DSA_set_method(DSA *dsa, const DSA_METHOD *meth);

DSA *DSA_new_method(ENGINE *engine);

const DSA_METHOD *DSA_OpenSSL(void);

πŸ’… DESCRIPTION πŸ’…

girl. all of the functions described on this page are deprecated. Applications should providers instead of method overrides. i'm so serious 😭

A DSA_METHOD specifies the functions that OpenSSL uses for DSA operations. By modifying the method, alternative implementations such as hardware accelerators may be used. it's giving plug-and-play, iconic behavior ✨

Initially, the default DSA_METHOD is the OpenSSL internal implementation, as returned by DSA_OpenSSL() β€” the OG, the main character πŸ‘‘

  • DSA_set_default_method() β€” makes meth the default method for all DSA structures created later. NB: this function is not thread-safe and should not be called at the same time as other OpenSSL functions. so like… don't multitask with it bestie, fr fr πŸ’€
  • DSA_get_default_method() β€” returns a pointer to the current default DSA_METHOD.
  • DSA_set_method() β€” selects meth to perform all operations using the key dsa. This will replace the DSA_METHOD used by the DSA key. 🫢
heads up: it's possible to have DSA keys that only work with certain DSA_METHOD implementations, and in such cases attempting to change the DSA_METHOD for the key can have unexpected results. read that again, no cap πŸ™ˆ

See DSA_meth_new(3) for information on constructing custom DSA_METHOD objects.

  • DSA_new_method() β€” allocates and initializes a DSA structure so that the DSA_METHOD controlled by DSA_set_default_method() is used. engine must be NULL. that's the whole vibe check, don't fight it 🌈

⭐ RETURN VALUES ⭐

  • DSA_OpenSSL() and DSA_get_default_method() return pointers to the respective DSA_METHODs. πŸ’œ
  • DSA_set_default_method() returns no value. (it's mysterious like that)
  • DSA_set_method() returns nonzero if the provided meth was successfully set as the method for dsa.
  • DSA_new_method() returns NULL and sets an error code that can be obtained by ERR_get_error(3) if the allocation fails. Otherwise it returns a pointer to the newly allocated structure. πŸ“

🧚 SEE ALSO 🧚


πŸ“œ HISTORY πŸ“œ

All of these functions were deprecated in OpenSSL 3.0. rip to a real one 😭


Copyright 2000-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page, periodt πŸ’… this was OpenSSL 4.0.3, dated 2026-09-29, and it lives under DSA_SET_METHOD(3SSL) β€” go forth and set your methods wisely, bestie πŸ¦‹πŸŽ€πŸ’–

πŸ“¦ where this page comes from