<html> <head><title>dkim_set_key_lookup()</title></head> <body> <!-- $Id: dkim_set_key_lookup.html,v 1.2 2010/07/24 04:52:15 cm-msk Exp $ --> <h1>dkim_set_key_lookup()</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 <dkim.h> <a href="dkim_stat.html"><tt>DKIM_STAT</tt></a> dkim_set_key_lookup( <a href="dkim_lib.html"><tt>DKIM_LIB</tt></a> *libopendkim, <a href="dkim_cbstat.html"><tt>DKIM_CBSTAT</tt></a> (*func) (<a href="dkim.html"><tt>DKIM</tt></a> *dkim, <a href="dkim_siginfo.html"><tt>DKIM_SIGINFO</tt></a> *siginfo, unsigned char *buf, size_t buflen)); ); </pre> Defines a function which should do key lookups rather than implementing the DKIM specification (e.g a DNS lookup). The query method specified in the signature will be ignored. </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_set_key_lookup()</tt> can be called at any time.</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>libopendkim</td> <td>Library-specific instance handle, returned by <a href="dkim_verify.html"><tt>dkim_init()</tt></a>. </td></tr> <tr valign="top"><td>func</td> <td>A pointer to a function which the library should use in place of its own code to do key lookups. The function will receive four things: A <a href="dkim.html"><tt>DKIM</tt></a> handle referencing the job being processed, a pointer to a <a href="dkim_siginfo.html"><tt>DKIM_SIGINFO</tt></a> handle identifying the signature whose public key should be retrieved, a pointer to a buffer that should receive the result of the key lookup, and the number of bytes available there. The function should return an appropriate <a href="dkim_cbstat.html"><tt>DKIM_CBSTAT</tt></a> return code after loading the buffer with its lookup result (if any). If <tt>func</tt> is NULL, the internal key lookup implementation, which will do what the signature requests, will be used. </td></tr> </table> </td></tr> <!----------- Return Value ----------> <tr> <th valign="top" align=left>RETURN VALUES</th> <td> <ul> <li>DKIM_STAT_OK -- success </ul> </td> </tr> <!----------- Notes ----------> <tr> <th valign="top" align=left>NOTES</th> <td> <ul> <li>The callback should place into the provided buffer a NULL-terminated string formatted as a legal DKIM key record according to RFC4871 Section 3.6.1. </ul> </td> </tr> </table> <hr size="1"> <font size="-1"> Copyright (c) 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>