Class UrlSigningServiceImpl
java.lang.Object
org.opencastproject.security.urlsigning.service.impl.UrlSigningServiceImpl
- All Implemented Interfaces:
UrlSigningService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the signing service accepts to sign thebaseUrl.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.
-
Constructor Details
-
UrlSigningServiceImpl
public UrlSigningServiceImpl()
-
-
Method Details
-
accepts
Description copied from interface:UrlSigningServiceReturns true if the signing service accepts to sign thebaseUrl.- Specified by:
acceptsin interfaceUrlSigningService- 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
public String sign(String baseUrl, Long validUntilDuration, Long validFromDuration, String ipAddr) throws UrlSigningException Description copied from interface:UrlSigningServiceCreate 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.- Specified by:
signin interfaceUrlSigningService- 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 benull(optional).ipAddr- The IP address of the client that is allowed to view the resource; may benull(optional).- Returns:
- A query string signature for this resource.
- Throws:
UrlSigningException- Thrown if unable to sign the resource.
-
sign
public String sign(String baseUrl, org.joda.time.DateTime validUntil, org.joda.time.DateTime validFrom, String ipAddr) throws UrlSigningException Description copied from interface:UrlSigningServiceCreate a secure signature for a resource using DateTime objects.- Specified by:
signin interfaceUrlSigningService- 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 benull(optional).ipAddr- The IP address of the client that is allowed to view the resource; may benull(optional).- Returns:
- A query string signature for this resource.
- Throws:
UrlSigningException- Thrown if unable to sign the resource.
-