Overview

To sign a message under DomainKeys, make the following calls:
  1. lib = dk_init();
  2. dk = dk_sign(lib, ...);
  3. stat = dk_header(dk, ...);
  4. stat = dk_eoh(dk);
  5. stat = dk_body(dk, ...);
  6. stat = dk_eom(dk, ...);
  7. stat = dk_getsig(dk, ...);
  8. stat = dk_free(dk);
  9. stat = dk_close(dk);

To verify a message under DomainKeys, make the following calls:
  1. lib = dk_init();
  2. dk = dk_verify(lib, ...);
  3. stat = dk_header(dk, ...);
  4. stat = dk_eoh(dk);
  5. stat = dk_body(dk, ...);
  6. stat = dk_eom(dk, ...);
  7. stat = dk_free(dk);
  8. stat = dk_close(dk);

One application, having called dk_init() once, can call dk_sign() or dk_verify() more than once each, and furthermore can have more than one signing/verifying handle in existence at any given time.