Package thredds.util

Class LocalApiSigner

java.lang.Object
thredds.util.LocalApiSigner

public final class LocalApiSigner extends Object
Signature based authentication for the TDS local API

Use an HMAC SHA256 algorithm to generate a hash based on components of properties of the request and an ISO formatted date/time string (rounded down to the nearest time boundary [five second window by default]) The client and server must have access to the same key used to initialize the hash generator.

Since:
5.7
  • Field Details

  • Constructor Details

    • LocalApiSigner

      public LocalApiSigner(String key)
  • Method Details

    • generateSignatureGet

      public String generateSignatureGet(String url)
      An HMAC SHA256 algorithm is used to generate a hash of the path and query components of the request, along with the ISO formatted date/time (rounded down to the nearest time boundary [five second window by default]).
      Parameters:
      url - string of the GET request url
      Returns:
      signature hash
    • verifySignatureGet

      public boolean verifySignatureGet(String url, String expectedSignature)