dkim_getsigihdr()

SYNOPSIS
#include <dkim.h>
DKIM_STAT dkim_getsighdr(
	DKIM *dkim,
        unsigned char *buf,
        size_t len,
        size_t margin,
        size_t initial
);
Compute and retrieve the signature header for a message.
DESCRIPTION
Called When dkim_getsig() is called after dkim_eom() when dkim is a signing handle, i.e. one returned by an earlier call to dkim_sign().
ARGUMENTS
ArgumentDescription
dkim Message-specific handle, returned by dkim_sign().
buf A buffer into which the signature header should be stored.
len Number of bytes available at buf.
margin Desired line length for the header. If 0, return the header unwrapped.
initial Line length already consumed on the first line. Used to leave space when wrapping headers for the name of the header itself.
NOTES
  • It is an error to call this function with a handle that was created using dkim_verify().
  • If for example, you want to have your headers wrapped at 75 bytes and the header to be added will be called "DKIM-Signature", the margin value should be 75, and the initial value should be 16 (length of the header's name plus room for a colon and a space).
  • When signing and "simple" canonicalization is in use, the header added to the message must be identical to the internal version used to generate the signature, or the message will not verify. In that case, the value of initial should be 16 (or more portably, strlen(DKIM_SIGNHEADER) + 2), and margin should be 75 (or the constant DKIM_HDRMARGIN).

Copyright (c) 2005 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.