# dkim_resign()

[back to index]

SYNOPSIS

    #include <dkim.h>

    DKIM_STAT dkim_resign(
    	DKIM *sh,
    	DKIM *vh,
    	bool hdrbind
    );

Binds a signing handle to a verifying handle to re-sign a message being verified. The message only passes through the library once, but now produces a verification result and a new signature.

DESCRIPTION

Called When | `dkim_resign()` must be called after a signing handle is acquired with `dkim_sign()` and a verifying handle is acquired with `dkim_verify()`, but before `dkim_eoh()` has been called.

ARGUMENTS

Argument | Description
--- | ---
sh | Message-specific handle, returned by `dkim_sign()`. It must not yet have been used to process any message data.
vh | Message-specific handle, returned by `dkim_verify()`. `dkim_eoh()` must not already have been called.

hdrbind | If TRUE, indicates that both the header and the body of the message are bound to the verifying handle. If FALSE, only the body is bound, meaning the header is free to add additional header fields prior to calling `dkim_eoh()`.

RETURN VALUES

Value | Description
--- | ---
`DKIM_STAT_OK` | The binding was successful.
One or more of the following:

- `sh` is not a signing handle
- `sh` has already received some message data
- `sh` is already bound to another verifying handle
- `vh` is not a verifying handle
- `vh` has already been passed to `dkim_eoh()`

`DKIM_STAT_INVALID`

NOTES

- Once the binding is made, passing `vh` to `dkim_free()` will fail until `sh` has been freed
- Multiple signing handles may be bound to a common verifying handle
- `vh` should be passed to `dkim_eom()` before `sh` is, after which the new signature can be extracted from `sh`; passing `sh` to `dkim_eom()` before doing so with `vh` will cause that function to return a status of `DKIM_STAT_INVALID`

Copyright (c) 2009, 2010, The OpenDKIM Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the license.