dkim_getsighdr()

[back to index]

SYNOPSIS
#include <dkim.h>
DKIM_STAT dkim_getsighdr(
	DKIM *dkim,
        unsigned char *buf,
        size_t len,
        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.
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 initial value should be 16 (length of the header's name plus room for a colon and a space). The default margin is 75; see dkim_set_margin().
  • 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).

Copyright (c) 2005, 2007 Sendmail, Inc. and its suppliers. All rights reserved.
Copyright (c) 2009, 2010, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the respective licenses.