Interface UrlSigningService

All Known Implementing Classes:
UrlSigningServiceImpl

public interface UrlSigningService
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accepts(String baseUrl)
    Returns true if the signing service accepts to sign the baseUrl.
    sign(String baseUrl, Long validUntilDuration, Long validFromDuration, String ipAddr)
    Create a secure signature for a resource by adding the validUntilDuration to the current time and optionally adding the validFromDuration to the current time to create the available and expiry dates for the signature.
    sign(String baseUrl, org.joda.time.DateTime validUntil, org.joda.time.DateTime validFrom, String ipAddr)
    Create a secure signature for a resource using DateTime objects.
  • Method Details

    • accepts

      boolean accepts(String baseUrl)
      Returns true if the signing service accepts to sign the baseUrl.
      Parameters:
      baseUrl - The base URL of the resource that needs to be signed
      Returns:
      True, if the signing service accepts to sign the URL; false otherwise.
    • sign

      String sign(String baseUrl, Long validUntilDuration, Long validFromDuration, String ipAddr) throws UrlSigningException
      Create a secure signature for a resource by adding the validUntilDuration to the current time and optionally adding the validFromDuration to the current time to create the available and expiry dates for the signature.
      Parameters:
      baseUrl - The required url that refers to the resource.
      validUntilDuration - The required number of seconds from now that the resource will expire.
      validFromDuration - The number of seconds after now that the resource will become available; may be null (optional).
      ipAddr - The IP address of the client that is allowed to view the resource; may be null (optional).
      Returns:
      A query string signature for this resource.
      Throws:
      UrlSigningException - Thrown if unable to sign the resource.
    • sign

      String sign(String baseUrl, org.joda.time.DateTime validUntil, org.joda.time.DateTime validFrom, String ipAddr) throws UrlSigningException
      Create a secure signature for a resource using DateTime objects.
      Parameters:
      baseUrl - The required url that refers to the resource.
      validUntil - The required date and time this signature will expire.
      validFrom - The date and time the resource will become available; may be null (optional).
      ipAddr - The IP address of the client that is allowed to view the resource; may be null (optional).
      Returns:
      A query string signature for this resource.
      Throws:
      UrlSigningException - Thrown if unable to sign the resource.