dashboard
repositories
activity
search
login
main
/
securis-client
summary
reflog
commits
tree
compare
forks
blame
|
history
|
raw
|
HEAD
#0 feaure - Created main methods for License validation
Roberto Sánchez
2014-02-21
8cc95fdfbe8146af8d5d4bcac7f7b9e3e2eb95c6
[securis-client.git]
/
src
/
main
/
java
/
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;
}
}
}