Package tigase.form

Class FormSignatureVerifier


  • public class FormSignatureVerifier
    extends java.lang.Object
    • Constructor Detail

      • FormSignatureVerifier

        public FormSignatureVerifier​(java.lang.String oauthConsumerKey,
                                     java.lang.String oauthConsumerSecret)
    • Method Detail

      • 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)