Roberto Sánchez
2014-02-25 bc372a688bf2062ba1e7e2ef2f9e69123d7873db
src/main/java/net/curisit/securis/utils/SignatureHelper.java
....@@ -36,7 +36,7 @@
3636 private static SignatureHelper singleton = new SignatureHelper();
3737
3838 private static final String DEFAULT_ALGORITHM = "RSA";
39
- protected static final String SIGNATURE_GENERATION_ALGORITHM = "SHA256withRSA";
39
+ public static final String SIGNATURE_GENERATION_ALGORITHM = "SHA256withRSA";
4040
4141 private SignatureHelper() {
4242 }
....@@ -45,7 +45,7 @@
4545 return singleton;
4646 }
4747
48
- protected void prepareSignature(Signature signature, LicenseBean licBean) throws SeCurisException {
48
+ public void prepareSignature(Signature signature, LicenseBean licBean) throws SeCurisException {
4949 try {
5050 log.info("JSON: {}", JsonUtils.toJSON(licBean));
5151 signature.update(JsonUtils.toJSON(licBean).getBytes("utf-8"));
....@@ -98,7 +98,7 @@
9898 return publicKey;
9999 }
100100
101
- protected PrivateKey generatePrivateKey(File privateKeyFile) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException {
101
+ public PrivateKey generatePrivateKey(File privateKeyFile) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException {
102102 String privKeyBase64 = FileUtils.readFileToString(privateKeyFile);
103103 int from = privKeyBase64.indexOf('\n');
104104 int to = privKeyBase64.indexOf("-----END", from);
....@@ -111,7 +111,7 @@
111111 return privateKey;
112112 }
113113
114
- private KeyPair generateKeyPair(File privateKeyFile, File publicKeyFile) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException {
114
+ public KeyPair generateKeyPair(File privateKeyFile, File publicKeyFile) throws NoSuchAlgorithmException, InvalidKeySpecException, IOException {
115115
116116 PublicKey publicKey = generatePublicKey(publicKeyFile);
117117 PrivateKey privateKey = generatePrivateKey(privateKeyFile);