dsa.pod 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. =pod
  2. =head1 NAME
  3. dsa - Digital Signature Algorithm
  4. =head1 SYNOPSIS
  5. #include <openssl/dsa.h>
  6. #include <openssl/engine.h>
  7. DSA * DSA_new(void);
  8. void DSA_free(DSA *dsa);
  9. int DSA_size(const DSA *dsa);
  10. DSA * DSA_generate_parameters(int bits, unsigned char *seed,
  11. int seed_len, int *counter_ret, unsigned long *h_ret,
  12. void (*callback)(int, int, void *), void *cb_arg);
  13. DH * DSA_dup_DH(const DSA *r);
  14. int DSA_generate_key(DSA *dsa);
  15. int DSA_sign(int dummy, const unsigned char *dgst, int len,
  16. unsigned char *sigret, unsigned int *siglen, DSA *dsa);
  17. int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp,
  18. BIGNUM **rp);
  19. int DSA_verify(int dummy, const unsigned char *dgst, int len,
  20. const unsigned char *sigbuf, int siglen, DSA *dsa);
  21. void DSA_set_default_method(const DSA_METHOD *meth);
  22. const DSA_METHOD *DSA_get_default_method(void);
  23. int DSA_set_method(DSA *dsa, const DSA_METHOD *meth);
  24. DSA *DSA_new_method(ENGINE *engine);
  25. const DSA_METHOD *DSA_OpenSSL(void);
  26. int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(),
  27. int (*dup_func)(), void (*free_func)());
  28. int DSA_set_ex_data(DSA *d, int idx, char *arg);
  29. char *DSA_get_ex_data(DSA *d, int idx);
  30. DSA_SIG *DSA_SIG_new(void);
  31. void DSA_SIG_free(DSA_SIG *a);
  32. int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
  33. DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length);
  34. DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
  35. int DSA_do_verify(const unsigned char *dgst, int dgst_len,
  36. DSA_SIG *sig, DSA *dsa);
  37. DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length);
  38. DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
  39. DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length);
  40. int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
  41. int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
  42. int i2d_DSAparams(const DSA *a,unsigned char **pp);
  43. int DSAparams_print(BIO *bp, const DSA *x);
  44. int DSAparams_print_fp(FILE *fp, const DSA *x);
  45. int DSA_print(BIO *bp, const DSA *x, int off);
  46. int DSA_print_fp(FILE *bp, const DSA *x, int off);
  47. =head1 DESCRIPTION
  48. These functions implement the Digital Signature Algorithm (DSA). The
  49. generation of shared DSA parameters is described in
  50. L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>;
  51. L<DSA_generate_key(3)|DSA_generate_key(3)> describes how to
  52. generate a signature key. Signature generation and verification are
  53. described in L<DSA_sign(3)|DSA_sign(3)>.
  54. The B<DSA> structure consists of several BIGNUM components.
  55. struct
  56. {
  57. BIGNUM *p; // prime number (public)
  58. BIGNUM *q; // 160-bit subprime, q | p-1 (public)
  59. BIGNUM *g; // generator of subgroup (public)
  60. BIGNUM *priv_key; // private key x
  61. BIGNUM *pub_key; // public key y = g^x
  62. // ...
  63. }
  64. DSA;
  65. In public keys, B<priv_key> is NULL.
  66. Note that DSA keys may use non-standard B<DSA_METHOD> implementations,
  67. either directly or by the use of B<ENGINE> modules. In some cases (eg. an
  68. ENGINE providing support for hardware-embedded keys), these BIGNUM values
  69. will not be used by the implementation or may be used for alternative data
  70. storage. For this reason, applications should generally avoid using DSA
  71. structure elements directly and instead use API functions to query or
  72. modify keys.
  73. =head1 CONFORMING TO
  74. US Federal Information Processing Standard FIPS 186 (Digital Signature
  75. Standard, DSS), ANSI X9.30
  76. =head1 SEE ALSO
  77. L<bn(3)|bn(3)>, L<dh(3)|dh(3)>, L<err(3)|err(3)>, L<rand(3)|rand(3)>,
  78. L<rsa(3)|rsa(3)>, L<sha(3)|sha(3)>, L<engine(3)|engine(3)>,
  79. L<DSA_new(3)|DSA_new(3)>,
  80. L<DSA_size(3)|DSA_size(3)>,
  81. L<DSA_generate_parameters(3)|DSA_generate_parameters(3)>,
  82. L<DSA_dup_DH(3)|DSA_dup_DH(3)>,
  83. L<DSA_generate_key(3)|DSA_generate_key(3)>,
  84. L<DSA_sign(3)|DSA_sign(3)>, L<DSA_set_method(3)|DSA_set_method(3)>,
  85. L<DSA_get_ex_new_index(3)|DSA_get_ex_new_index(3)>,
  86. L<RSA_print(3)|RSA_print(3)>
  87. =cut