code: public boolean verifySignature(String message, String signature, PublicKey publicKey){
          boolean result = false;
          try {
              byte[] sigbytes = Base64.decode(signature.getBytes());
              Signature sigChecker = SIG_CHECKER.get();
              sigChecker.initVerify(publicKey);
              sigChecker.update(message.getBytes());
              result = sigChecker.verify(sigbytes);
          } catch (InvalidKeyException e) {
              // Rare exception: The private key was incorrectly formatted
          } catch (SignatureException e) {
              // Rare exception: Catch-all exception for the signature checker
          }
          return result;
      }
docs: Does the actual Java cryptographic verification of the signature. This
  method does no handling of the many rare exceptions it is required to
  catch.
  
  This can also be used to verify the signature from the x-amz-sns-signature http header
  
  @param message
  Exact string that was signed.  In the case of the x-amz-sns-signature header the
  signing string is the entire post body
  @param signature
  Base64-encoded signature of the message
  @return