xref: /freebsd/crypto/openssl/doc/man3/DSA_SIG_new.pod (revision a7148ab39c03abd4d1a84997c70bf96f15dd2a09)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimDSA_SIG_get0, DSA_SIG_set0,
6e71b7053SJung-uk KimDSA_SIG_new, DSA_SIG_free - allocate and free DSA signature objects
7e71b7053SJung-uk Kim
8e71b7053SJung-uk Kim=head1 SYNOPSIS
9e71b7053SJung-uk Kim
10e71b7053SJung-uk Kim #include <openssl/dsa.h>
11e71b7053SJung-uk Kim
12e71b7053SJung-uk Kim DSA_SIG *DSA_SIG_new(void);
13e71b7053SJung-uk Kim void DSA_SIG_free(DSA_SIG *a);
14e71b7053SJung-uk Kim void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
15e71b7053SJung-uk Kim int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
16e71b7053SJung-uk Kim
17e71b7053SJung-uk Kim=head1 DESCRIPTION
18e71b7053SJung-uk Kim
19e71b7053SJung-uk KimDSA_SIG_new() allocates an empty B<DSA_SIG> structure.
20e71b7053SJung-uk Kim
21e71b7053SJung-uk KimDSA_SIG_free() frees the B<DSA_SIG> structure and its components. The
22e71b7053SJung-uk Kimvalues are erased before the memory is returned to the system.
23*a7148ab3SEnji CooperIf the argument is NULL, nothing is done.
24e71b7053SJung-uk Kim
25e71b7053SJung-uk KimDSA_SIG_get0() returns internal pointers to the B<r> and B<s> values contained
26e71b7053SJung-uk Kimin B<sig>.
27e71b7053SJung-uk Kim
28e71b7053SJung-uk KimThe B<r> and B<s> values can be set by calling DSA_SIG_set0() and passing the
29e71b7053SJung-uk Kimnew values for B<r> and B<s> as parameters to the function. Calling this
30e71b7053SJung-uk Kimfunction transfers the memory management of the values to the DSA_SIG object,
31e71b7053SJung-uk Kimand therefore the values that have been passed in should not be freed directly
32e71b7053SJung-uk Kimafter this function has been called.
33e71b7053SJung-uk Kim
34e71b7053SJung-uk Kim=head1 RETURN VALUES
35e71b7053SJung-uk Kim
36e71b7053SJung-uk KimIf the allocation fails, DSA_SIG_new() returns B<NULL> and sets an
37e71b7053SJung-uk Kimerror code that can be obtained by
38e71b7053SJung-uk KimL<ERR_get_error(3)>. Otherwise it returns a pointer
39e71b7053SJung-uk Kimto the newly allocated structure.
40e71b7053SJung-uk Kim
41e71b7053SJung-uk KimDSA_SIG_free() returns no value.
42e71b7053SJung-uk Kim
43e71b7053SJung-uk KimDSA_SIG_set0() returns 1 on success or 0 on failure.
44e71b7053SJung-uk Kim
45e71b7053SJung-uk Kim=head1 SEE ALSO
46e71b7053SJung-uk Kim
47b077aed3SPierre ProncheryL<EVP_PKEY_new(3)>, L<EVP_PKEY_free(3)>, L<EVP_PKEY_get_bn_param(3)>,
48b077aed3SPierre ProncheryL<ERR_get_error(3)>
49e71b7053SJung-uk Kim
50e71b7053SJung-uk Kim=head1 COPYRIGHT
51e71b7053SJung-uk Kim
52*a7148ab3SEnji CooperCopyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
53e71b7053SJung-uk Kim
54b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
55e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
56e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
57e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
58e71b7053SJung-uk Kim
59e71b7053SJung-uk Kim=cut
60