Package rs.baselib.licensing.internal
Class OctetLicenseVerifier
java.lang.Object
rs.baselib.licensing.internal.OctetLicenseVerifier
- All Implemented Interfaces:
ILicenseVerifier
public class OctetLicenseVerifier extends java.lang.Object implements ILicenseVerifier
Verifies an Octet License.
- Author:
- ralph
-
Constructor Summary
Constructors Constructor Description OctetLicenseVerifier()Constructor. -
Method Summary
Modifier and Type Method Description protected static java.lang.Stringungroup(java.lang.String s)Returns the un-grouped version of the key.protected booleanverify(byte[] signature, SimpleLicense license, ILicenseContext context)Verifies the signatureILicenseverify(java.lang.String licenseKey, ILicenseContext context)Verifies the given license string.
-
Constructor Details
-
OctetLicenseVerifier
public OctetLicenseVerifier()Constructor.
-
-
Method Details
-
verify
Verifies the given license string.- Specified by:
verifyin interfaceILicenseVerifier- Parameters:
licenseKey- the license stringcontext- the verification context- Returns:
- the license verified
-
verify
protected boolean verify(byte[] signature, SimpleLicense license, ILicenseContext context) throws DecryptionException, SigningException, java.io.UnsupportedEncodingExceptionVerifies the signature- Parameters:
signature- signature to be verifiedlicense- the license to be checked againstcontext- the context- Returns:
truewhen signature is ok- Throws:
DecryptionException- - when decryption failsSigningException- - when signing verification failsjava.io.UnsupportedEncodingException- - when the encoding is not supported
-
ungroup
protected static java.lang.String ungroup(java.lang.String s)Returns the un-grouped version of the key.- Parameters:
s- the key- Returns:
- the un-grouped version (dashes removed)
-