Package tigase.form

# Class FormSignatureVerifier

java.lang.Object
tigase.form.FormSignatureVerifier

public class FormSignatureVerifier extends Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `FormSignatureVerifier.SignatureVerifyHandler`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FormSignatureVerifier(String oauthConsumerKey, String oauthConsumerSecret)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `isFormSigned(Form form)`
  `long`
  `verify(JID to, Form form)`
  Verify signature of given form.
  `long`
  `verify(JID to, Form form, FormSignatureVerifier.SignatureVerifyHandler handler)`
  Verify signature of given form.
  `long`
  `verify(JID to, Element form)`
  Verify signature of given form.
  `long`
  `verify(JID to, Element form, FormSignatureVerifier.SignatureVerifyHandler handler)`
  Verify signature of given form.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FormSignatureVerifier

    public FormSignatureVerifier(String oauthConsumerKey, String oauthConsumerSecret)

- ## Method Details

  - ### verify

    public long verify(JID to, Element form) throws FormSignerException
    Verify signature of given form.
    Parameters:
      `to` - the full destination address, including resource, if any.
      `form` - signed Form to verify.
    Returns:
      timestamp of signature is signature is valid. If signature is invalid exception will be throwed.
    Throws:
      `FormSignerException` - if signature is invalid or can't be checked.

  - ### verify

    public long verify(JID to, Element form, FormSignatureVerifier.SignatureVerifyHandler handler) throws FormSignerException
    Verify signature of given form.
    Parameters:
      `to` - the full destination address, including resource, if any.
      `form` - signed Form to verify.
      `handler` - handler to make additional verification (for example validate received `oauth_token`).
    Returns:
      timestamp of signature is signature is valid. If signature is invalid exception will be throwed.
    Throws:
      `FormSignerException` - if signature is invalid or can't be checked.

  - ### verify

    public long verify(JID to, Form form) throws FormSignerException
    Verify signature of given form.
    Parameters:
      `to` - the full destination address, including resource, if any.
      `form` - signed Form to verify.
    Returns:
      timestamp of signature is signature is valid. If signature is invalid exception will be throwed.
    Throws:
      `FormSignerException` - if signature is invalid or can't be checked.

  - ### verify

    public long verify(JID to, Form form, FormSignatureVerifier.SignatureVerifyHandler handler) throws FormSignerException
    Verify signature of given form.
    Parameters:
      `to` - the full destination address, including resource, if any.
      `form` - signed Form to verify.
      `handler` - handler to make additional verification (for example validate received `oauth_token`).
    Returns:
      timestamp of signature is signature is valid. If signature is invalid exception will be throwed.
    Throws:
      `FormSignerException` - if signature is invalid or can't be checked.

  - ### isFormSigned

    protected boolean isFormSigned(Form form)