NAME
DSA_meth_new
,
DSA_meth_free
, DSA_meth_dup
,
DSA_meth_set_sign
,
DSA_meth_set_finish
—
build up DSA methods
SYNOPSIS
#include
<openssl/dsa.h>
DSA_METHOD *
DSA_meth_new
(const char *name,
int flags);
void
DSA_meth_free
(DSA_METHOD
*meth);
DSA_METHOD *
DSA_meth_dup
(const DSA_METHOD
*meth);
int
DSA_meth_set_sign
(DSA_METHOD
*meth, DSA_SIG *(*sign)(const unsigned char *, int,
DSA *));
int
DSA_meth_set_finish
(DSA_METHOD
*meth, int (*finish)(DSA *));
DESCRIPTION
The DSA_METHOD structure holds function pointers for custom DSA implementations.
DSA_meth_new
()
creates a new DSA_METHOD structure. A copy of the
NUL-terminated name is stored in the new
DSA_METHOD object. Any new DSA
object constructed from this DSA_METHOD will have the
given flags set by default.
DSA_meth_dup
()
creates a deep copy of meth. This might be useful for
creating a new DSA_METHOD based on an existing one,
but with some differences.
DSA_meth_free
()
destroys meth and frees any memory associated with
it.
DSA_meth_set_sign
()
sets the function used for creating a DSA signature. This function will be
called from
DSA_do_sign(3) and indirectly from
DSA_sign(3). The parameters of sign have the
same meaning as for
DSA_do_sign(3).
DSA_meth_set_finish
()
sets an optional function for destroying a DSA object.
Unless finish is NULL
, it will
be called from
DSA_free(3). It takes the same argument and is intended to do DSA
implementation specific cleanup. The memory used by the
DSA object itself should not be freed by the
finish function.
RETURN VALUES
DSA_meth_new
() and
DSA_meth_dup
() return the newly allocated DSA_METHOD
object or NULL on failure.
All DSA_meth_set_*
() functions return 1 on
success or 0 on failure.
SEE ALSO
DSA_do_sign(3), DSA_new(3), DSA_set_method(3), DSA_SIG_new(3), DSA_sign(3)
HISTORY
These functions first appeared in OpenSSL 1.1.0 and have been available since OpenBSD 6.3.