Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > b5fdf68d1ef6711be4a04d1550358feb > files > 42

libopendkim-devel-2.4.2-5.fc14.x86_64.rpm

<html>
<head><title>dkim_getsighdr_d()</title></head>
<body>
<!--
$Id: dkim_getsighdr_d.html,v 1.2 2010/07/24 04:52:15 cm-msk Exp $
-->
<h1>dkim_getsighdr_d()</h1>
<p align="right"><a href="index.html">[back to index]</a></p>

<table border="0" cellspacing=4 cellpadding=4>
<!---------- Synopsis ----------->
<tr><th valign="top" align=left width=150>SYNOPSIS</th><td>
<pre>
#include &lt;dkim.h&gt;
<a href="dkim_stat.html"><tt>DKIM_STAT</tt></a> dkim_getsighdr_d(
	<a href="dkim.html"><tt>DKIM</tt></a> *dkim,
        size_t initial,
        unsigned char **buf,
        size_t *len
);
</pre>
Compute and retrieve the signature header for a message.  This is similar
to <a href="dkim_getsighdr.html"><tt>dkim_getsighdr()</tt></a> except that
memory will be allocated for an arbitrarily long signature header, and
a pointer to that memory will be returned as well as the length of the string
at that location. <p>

The memory thus allocated will be deallocated by the library when the
<tt>dkim</tt> handle is closed. <p>
</td></tr>

<!----------- Description ---------->
<tr><th valign="top" align=left>DESCRIPTION</th><td>
<table border="1" cellspacing=1 cellpadding=4>
<tr align="left" valign=top>
<th width="80">Called When</th>
<td><tt>dkim_getsig()</tt> is called after
    <a href="dkim_eom.html"><tt>dkim_eom()</tt></a> when <tt>dkim</tt> is a
    signing handle, i.e. one returned by an earlier call to
    <a href="dkim_sign.html"><tt>dkim_sign()</tt></a>. </td>
</tr>
</table>

<!----------- Arguments ---------->
<tr><th valign="top" align=left>ARGUMENTS</th><td>
    <table border="1" cellspacing=0>
    <tr bgcolor="#dddddd"><th>Argument</th><th>Description</th></tr>
    <tr valign="top"><td>dkim</td>
	<td>Message-specific handle, returned by <a href="dkim_sign.html">
        <tt>dkim_sign()</tt></a>.
	</td></tr>
    <tr valign="top"><td>initial</td>
	<td>Line length already consumed on the first line.  Used to
            leave space when wrapping headers for the name of the header
            itself.
	</td></tr>
    <tr valign="top"><td>buf</td>
	<td>The address of a pointer that will be updated to reference
	    a buffer into which the generated signature header was
	    placed.  The buffer is NUL-terminated.
	</td></tr>
    <tr valign="top"><td>len</td>
	<td>The address of an integer that will be updated to contain the
	    length of the generated signature header.  The length does not
	    include the NUL byte at the end.
	</td></tr>
    </table>
</td></tr>

<!----------- Notes ---------->
<tr>
<th valign="top" align=left>NOTES</th> 
<td>
<ul>
<li>It is an error to call this function with a handle that was created
    using <a href="dkim_verify.html"><tt>dkim_verify()</tt></a>.
<li>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
    <tt>initial</tt> value should be 16 (length of the header's name plus
    room for a colon and a space).  The default margin is 75; see
    <a href="dkim_set_margin.html"><tt>dkim_set_margin()</tt></a>.
<li>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
    <tt>initial</tt> should be 16 (or more portably,
    <tt>strlen(DKIM_SIGNHEADER) + 2)</tt>. </a>
</ul>
</td>
</tr>
</table>

<hr size="1">
<font size="-1">
Copyright (c) 2005, 2007 Sendmail, Inc. and its suppliers.
All rights reserved.
<br>
Copyright (c) 2009-2011, The OpenDKIM Project.  All rights reserved.

<br>
By using this file, you agree to the terms and conditions set
forth in the respective licenses.
</font>
</body>
</html>