Package com.saxonica.config
Class Verifier
java.lang.Object
com.saxonica.config.Verifier
- Direct Known Subclasses:
JavaVerifier
A helper class for EnterpriseConfiguration that handles license keys as issued for the Java platform.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStream
connectToURI
(String uri) protected static byte[]
convertHexToBinary
(String hex) Convert a Hex String into the corresponding byte array by encoding each two hexadecimal digits as a byte.getFeature
(String name, Configuration config) getLicenseFeatures
(Configuration config) protected Verifier.License
protected abstract void
loadLicense
(Configuration config) Locate the license file, read it, and verify itstatic void
Test program to verify that a license contained in a specific file is validprotected Verifier.License
protected void
setPrimaryLicense
(Verifier.License license) protected abstract boolean
This method validates license data based on the signature and the public key.protected abstract boolean
This method validates license data based on the V2 signature and the public key.
-
Field Details
-
status
protected int status -
LICENSE_FILE_NAME
- See Also:
-
-
Method Details
-
setPrimaryLicense
-
getPrimaryLicense
-
getFeature
-
getLicenseFeatures
-
loadLicense
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
- Throws:
IOException
-
readLicenseFile
-
convertHexToBinary
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
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
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
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
-