dashboard
repositories
activity
search
login
main
/
securis-client
summary
reflog
commits
tree
compare
forks
blame
|
history
|
raw
|
HEAD
#0 config - Initial commit
Roberto Sánchez
2014-02-19
35905fe25b644bee5e213534887e10672ed58000
[securis-client.git]
/
src
/
net
/
curisit
/
securis
/
LicenseValidator.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
}
}
}