code: public static boolean verify(PublicKey key, String base64Signature, String content, String timestamp, int duration)
                                                                                                                         throws Exception {
          if (key == null || base64Signature == null || content == null || timestamp == null) {
              return false;
          }
          
          try {
              if (timestamp != null && duration > 0) {
                  validateTime(timestamp, duration);
              }
              
              Signature signature = Signature.getInstance(SIGN_ALGORITHM);
              signature.initVerify(key);
              signature.update(content.getBytes());
              byte[] signatureBytes = Base64.decodeBase64(base64Signature);
              return signature.verify(signatureBytes);
          } catch (Exception e) {
              log.error("Authentication Exception:verifySignature", e);
              throw e;
          }
      }
docs: Verifies a digitally signed payload.
  
  @param key Public key to verify digital signature.
  @param base64Signature Digital signature of content.
  @param content The content that was signed.
  @param timestamp Optional timestamp for time-sensitive payloads.
  @param duration Optional validity duration in minutes for time-sensitive payloads.
  @return True if signature is valid.
  @throws Exception Unspecified exception.