Blame doc/man3/DSA_sign.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/dsa.h>
Packit c4476c
Packit c4476c
 int DSA_sign(int type, const unsigned char *dgst, int len,
Packit c4476c
              unsigned char *sigret, unsigned int *siglen, DSA *dsa);
Packit c4476c
Packit c4476c
 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp);
Packit c4476c
Packit c4476c
 int DSA_verify(int type, const unsigned char *dgst, int len,
Packit c4476c
                unsigned char *sigbuf, int siglen, DSA *dsa);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
DSA_sign() computes a digital signature on the B<len> byte message
Packit c4476c
digest B<dgst> using the private key B<dsa> and places its ASN.1 DER
Packit c4476c
encoding at B<sigret>. The length of the signature is places in
Packit c4476c
*B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory.
Packit c4476c
Packit c4476c
DSA_sign_setup() is defined only for backward binary compatibility and
Packit c4476c
should not be used.
Packit c4476c
Since OpenSSL 1.1.0 the DSA type is opaque and the output of
Packit c4476c
DSA_sign_setup() cannot be used anyway: calling this function will only
Packit c4476c
cause overhead, and does not affect the actual signature
Packit c4476c
(pre-)computation.
Packit c4476c
Packit c4476c
DSA_verify() verifies that the signature B<sigbuf> of size B<siglen>
Packit c4476c
matches a given message digest B<dgst> of size B<len>.
Packit c4476c
B<dsa> is the signer's public key.
Packit c4476c
Packit c4476c
The B<type> parameter is ignored.
Packit c4476c
Packit c4476c
The random generator must be seeded when DSA_sign() (or DSA_sign_setup())
Packit c4476c
is called.
Packit c4476c
If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
Packit c4476c
external circumstances (see L<RAND(7)>), the operation will fail.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
DSA_sign() and DSA_sign_setup() return 1 on success, 0 on error.
Packit c4476c
DSA_verify() returns 1 for a valid signature, 0 for an incorrect
Packit c4476c
signature and -1 on error. The error codes can be obtained by
Packit c4476c
L<ERR_get_error(3)>.
Packit c4476c
Packit c4476c
=head1 CONFORMING TO
Packit c4476c
Packit c4476c
US Federal Information Processing Standard FIPS 186 (Digital Signature
Packit c4476c
Standard, DSS), ANSI X9.30
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
Packit c4476c
L<DSA_do_sign(3)>,
Packit c4476c
L<RAND(7)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut