Class RsaSha1Method

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String BEGIN_CERT  
      private static java.lang.String KEY_TYPE  
      private static java.util.logging.Logger LOGGER  
      static java.lang.String NAME  
      private static java.lang.String SIGNATURE_ALGORITHM  
    • Constructor Summary

      Constructors 
      Constructor Description
      RsaSha1Method()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String name()
      Returns the name of this signature method, as negotiated through the OAuth protocol.
      java.lang.String sign​(java.lang.String baseString, OAuth1Secrets secrets)
      Generates the RSA-SHA1 signature of OAuth request elements.
      boolean verify​(java.lang.String elements, OAuth1Secrets secrets, java.lang.String signature)
      Verifies the RSA-SHA1 signature of OAuth request elements.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RsaSha1Method

        public RsaSha1Method()
    • Method Detail

      • name

        public java.lang.String name()
        Description copied from interface: OAuth1SignatureMethod
        Returns the name of this signature method, as negotiated through the OAuth protocol.
        Specified by:
        name in interface OAuth1SignatureMethod
        Returns:
        Signature method name.
      • sign

        public java.lang.String sign​(java.lang.String baseString,
                                     OAuth1Secrets secrets)
                              throws InvalidSecretException
        Generates the RSA-SHA1 signature of OAuth request elements.
        Specified by:
        sign in interface OAuth1SignatureMethod
        Parameters:
        baseString - the combined OAuth elements to sign.
        secrets - the secrets object containing the private key for generating the signature.
        Returns:
        the OAuth signature, in base64-encoded form.
        Throws:
        InvalidSecretException - if the supplied secret is not valid.
      • verify

        public boolean verify​(java.lang.String elements,
                              OAuth1Secrets secrets,
                              java.lang.String signature)
                       throws InvalidSecretException
        Verifies the RSA-SHA1 signature of OAuth request elements.
        Specified by:
        verify in interface OAuth1SignatureMethod
        Parameters:
        elements - OAuth elements signature is to be verified against.
        secrets - the secrets object containing the public key for verifying the signature.
        signature - base64-encoded OAuth signature to be verified.
        Returns:
        true if the signature matches the secrets and data.
        Throws:
        InvalidSecretException - if the supplied secret is not valid.