OpenDKIM is a DKIM implementation with both a C library for writing your own applications and a milter-aware filter for use with recent MTAs.