package net.curisit.securis; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import net.curisit.securis.utils.LicUtils; import org.apache.commons.io.IOUtils; public class LicenseValidator { private byte[] LOGO_SECRET; public LicenseValidator() { try { LOGO_SECRET = "Logo ipsum s3cr3t test áíóú".getBytes("utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } /** * @return true if logo is correct */ public String getCrcLogo() { InputStream is = getClass().getClassLoader().getResourceAsStream("images/logo_customer.png"); try { String shaLogo = LicUtils.sha256(IOUtils.toByteArray(is), LOGO_SECRET); return shaLogo; } catch (IOException e) { e.printStackTrace(); return null; } } }