Skip to content

opendkim.sig_getidentity()

Christopher Mooney edited this page May 8, 2017 · 5 revisions

DESCRIPTION

This call retrieves the signing identity from the signature ultimately used to verify a message. This must be called after either opendkim.chunk_end() or opendkim.eom(). This function uses the signature handle found by opendkim.get_signature() to pull the identity from. Internally, this function calls opendkim.get_signature(), so there is no need to explicitly call it yourself.

ARGUMENTS

Type: undefined

RETURN VALUES

  • throws an error if ** The function was called before opendkim.chunk_end() or opendkim.eom() and thus opendkim.verify() ** The message represented was not signed.
  • returns the identity string on success.

NOTES

  • throws an error if there is simply no signature on the message.

EXAMPLE

try {
  var opendkim = new OpenDKIM();

  opendkim.verify({id: undefined});
  opendkim.chunk({
    message: message,
    length: message.length
  });
  opendkim.chunk_end();
  opendkim.sig_getidentity();
} catch (err) {
  console.log(err);
}