DSA_sign.pod 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. =pod
  2. =head1 NAME
  3. DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
  4. =head1 SYNOPSIS
  5. #include <openssl/dsa.h>
  6. int DSA_sign(int type, const unsigned char *dgst, int len,
  7. unsigned char *sigret, unsigned int *siglen, DSA *dsa);
  8. int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp,
  9. BIGNUM **rp);
  10. int DSA_verify(int type, const unsigned char *dgst, int len,
  11. unsigned char *sigbuf, int siglen, DSA *dsa);
  12. =head1 DESCRIPTION
  13. DSA_sign() computes a digital signature on the B<len> byte message
  14. digest B<dgst> using the private key B<dsa> and places its ASN.1 DER
  15. encoding at B<sigret>. The length of the signature is places in
  16. *B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory.
  17. DSA_sign_setup() is defined only for backward binary compatibility and
  18. should not be used.
  19. Since OpenSSL 1.1.0 the DSA type is opaque and the output of
  20. DSA_sign_setup() cannot be used anyway: calling this function will only
  21. cause overhead, and does not affect the actual signature
  22. (pre-)computation.
  23. DSA_verify() verifies that the signature B<sigbuf> of size B<siglen>
  24. matches a given message digest B<dgst> of size B<len>.
  25. B<dsa> is the signer's public key.
  26. The B<type> parameter is ignored.
  27. The PRNG must be seeded before DSA_sign() (or DSA_sign_setup())
  28. is called.
  29. =head1 RETURN VALUES
  30. DSA_sign() and DSA_sign_setup() return 1 on success, 0 on error.
  31. DSA_verify() returns 1 for a valid signature, 0 for an incorrect
  32. signature and -1 on error. The error codes can be obtained by
  33. L<ERR_get_error(3)>.
  34. =head1 CONFORMING TO
  35. US Federal Information Processing Standard FIPS 186 (Digital Signature
  36. Standard, DSS), ANSI X9.30
  37. =head1 SEE ALSO
  38. L<dsa(3)>, L<ERR_get_error(3)>, L<rand(3)>,
  39. L<DSA_do_sign(3)>
  40. =head1 COPYRIGHT
  41. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
  42. Licensed under the OpenSSL license (the "License"). You may not use
  43. this file except in compliance with the License. You can obtain a copy
  44. in the file LICENSE in the source distribution or at
  45. L<https://www.openssl.org/source/license.html>.
  46. =cut