Class Verifier

java.lang.Object
com.saxonica.config.Verifier
Direct Known Subclasses:
JavaVerifier

public abstract class Verifier extends Object
A helper class for EnterpriseConfiguration that handles license keys as issued for the Java platform.
  • Field Details

  • Method Details

    • setPrimaryLicense

      protected void setPrimaryLicense(Verifier.License license)
    • getPrimaryLicense

      protected Verifier.License getPrimaryLicense()
    • getFeature

      public String getFeature(String name, Configuration config)
    • getLicenseFeatures

      public Properties getLicenseFeatures(Configuration config)
    • loadLicense

      protected abstract void loadLicense(Configuration config)
      Locate the license file, read it, and verify it
      Parameters:
      config - the Saxon configuration
      Throws:
      LicenseException - if, for example, a license is found and is invalid
    • connectToURI

      protected InputStream connectToURI(String uri) throws IOException
      Throws:
      IOException
    • readLicenseFile

      protected Verifier.License readLicenseFile(InputStream is)
    • convertHexToBinary

      protected static byte[] convertHexToBinary(String hex)
      Convert a Hex String into the corresponding byte array by encoding each two hexadecimal digits as a byte.
      Parameters:
      hex - Hexadecimal digits representation
      Returns:
      byte Byte array
    • verify

      protected abstract boolean verify(String data, String signature) throws LicenseException
      This method validates license data based on the signature and the public key.
      Parameters:
      data - the license data.
      signature - the digital signature
      Returns:
      a boolean whether or the license is valid.
      Throws:
      LicenseException - if a failure occurs in the verification process
    • verify2

      protected abstract boolean verify2(String data, String signature) throws LicenseException
      This method validates license data based on the V2 signature and the public key.
      Parameters:
      data - the license data.
      signature - the digital signature
      Returns:
      a boolean whether or the license is valid.
      Throws:
      LicenseException - if a failure occurs in the verification process
    • main

      public static void main(String[] args) throws Exception
      Test program to verify that a license contained in a specific file is valid
      Parameters:
      args - Command line arguments. First argument is the filename of the license file to be tested.
      Throws:
      Exception - if any failure occurs