2
0

DSA_sign.pod 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. =pod
  2. =head1 NAME
  3. DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures
  4. =head1 SYNOPSIS
  5. #include <openssl/dsa.h>
  6. The following functions have been deprecated since OpenSSL 3.0, and can be
  7. hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
  8. see L<openssl_user_macros(7)>:
  9. int DSA_sign(int type, const unsigned char *dgst, int len,
  10. unsigned char *sigret, unsigned int *siglen, DSA *dsa);
  11. int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp);
  12. int DSA_verify(int type, const unsigned char *dgst, int len,
  13. unsigned char *sigbuf, int siglen, DSA *dsa);
  14. =head1 DESCRIPTION
  15. All of the functions described on this page are deprecated.
  16. Applications should instead use L<EVP_PKEY_sign_init(3)>, L<EVP_PKEY_sign(3)>,
  17. L<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>.
  18. DSA_sign() computes a digital signature on the B<len> byte message
  19. digest B<dgst> using the private key B<dsa> and places its ASN.1 DER
  20. encoding at B<sigret>. The length of the signature is places in
  21. *B<siglen>. B<sigret> must point to DSA_size(B<dsa>) bytes of memory.
  22. DSA_sign_setup() is defined only for backward binary compatibility and
  23. should not be used.
  24. Since OpenSSL 1.1.0 the DSA type is opaque and the output of
  25. DSA_sign_setup() cannot be used anyway: calling this function will only
  26. cause overhead, and does not affect the actual signature
  27. (pre-)computation.
  28. DSA_verify() verifies that the signature B<sigbuf> of size B<siglen>
  29. matches a given message digest B<dgst> of size B<len>.
  30. B<dsa> is the signer's public key.
  31. The B<type> parameter is ignored.
  32. The random generator must be seeded when DSA_sign() (or DSA_sign_setup())
  33. is called.
  34. If the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to
  35. external circumstances (see L<RAND(7)>), the operation will fail.
  36. =head1 RETURN VALUES
  37. DSA_sign() and DSA_sign_setup() return 1 on success, 0 on error.
  38. DSA_verify() returns 1 for a valid signature, 0 for an incorrect
  39. signature and -1 on error. The error codes can be obtained by
  40. L<ERR_get_error(3)>.
  41. =head1 CONFORMING TO
  42. US Federal Information Processing Standard FIPS186-4 (Digital Signature
  43. Standard, DSS), ANSI X9.30
  44. =head1 SEE ALSO
  45. L<DSA_new(3)>, L<ERR_get_error(3)>, L<RAND_bytes(3)>,
  46. L<DSA_do_sign(3)>,
  47. L<RAND(7)>
  48. =head1 HISTORY
  49. All of these functions were deprecated in OpenSSL 3.0.
  50. =head1 COPYRIGHT
  51. Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
  52. Licensed under the Apache License 2.0 (the "License"). You may not use
  53. this file except in compliance with the License. You can obtain a copy
  54. in the file LICENSE in the source distribution or at
  55. L<https://www.openssl.org/source/license.html>.
  56. =cut