summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java
diff options
context:
space:
mode:
authorThomas <thomas.lenz@egiz.gv.at>2019-12-05 09:52:48 +0100
committerThomas <thomas.lenz@egiz.gv.at>2019-12-05 09:52:48 +0100
commit3fada6cef21c9b16467177d866df778203b51b4d (patch)
tree8fe8ed37b6ee9fe35a1e035ceba6c68808328415 /eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java
parent95b21a826e5d81fdeabcf4673a9e87047edaec9d (diff)
downloadEAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.tar.gz
EAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.tar.bz2
EAAF-Components-3fada6cef21c9b16467177d866df778203b51b4d.zip
some code code-style modifications
active code-quality checks!
Diffstat (limited to 'eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java')
-rw-r--r--eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java33
1 files changed, 17 insertions, 16 deletions
diff --git a/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java b/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java
index ec4009f0..5c9bb6be 100644
--- a/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java
+++ b/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/utils/AbstractCredentialProvider.java
@@ -23,10 +23,7 @@ import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.RSAPrivateKey;
-import at.gv.egiz.eaaf.core.exceptions.EaafException;
-import at.gv.egiz.eaaf.core.impl.utils.KeyStoreUtils;
-import at.gv.egiz.eaaf.modules.pvp2.exception.CredentialsNotAvailableException;
-import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.EaafKeyStoreX509CredentialAdapter;
+
import org.apache.commons.lang3.StringUtils;
import org.opensaml.xml.security.credential.Credential;
import org.opensaml.xml.security.credential.UsageType;
@@ -36,6 +33,11 @@ import org.opensaml.xml.signature.SignatureConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.gv.egiz.eaaf.core.exceptions.EaafException;
+import at.gv.egiz.eaaf.core.impl.utils.KeyStoreUtils;
+import at.gv.egiz.eaaf.modules.pvp2.exception.CredentialsNotAvailableException;
+import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.EaafKeyStoreX509CredentialAdapter;
+
public abstract class AbstractCredentialProvider {
private static final Logger log = LoggerFactory.getLogger(AbstractCredentialProvider.class);
@@ -43,7 +45,8 @@ public abstract class AbstractCredentialProvider {
private KeyStore keyStore = null;
/**
- * Get a friendlyName for this keyStore implementation This friendlyName is used for logging.
+ * Get a friendlyName for this keyStore implementation This friendlyName is used
+ * for logging.
*
* @return keyStore friendlyName
*/
@@ -106,7 +109,6 @@ public abstract class AbstractCredentialProvider {
*/
public abstract String getEncryptionKeyPassword();
-
/**
* Get Credentials to sign metadata.
*
@@ -128,15 +130,15 @@ public abstract class AbstractCredentialProvider {
log.error(getFriendlyName()
+ " Metadata Signing credentials is not found or contains no PrivateKey.");
throw new CredentialsNotAvailableException("config.27",
- new Object[] {getFriendlyName() + " Assertion Signing credentials (Alias: "
- + getMetadataKeyAlias() + ") is not found or contains no PrivateKey."});
+ new Object[] { getFriendlyName() + " Assertion Signing credentials (Alias: "
+ + getMetadataKeyAlias() + ") is not found or contains no PrivateKey." });
}
return credentials;
} catch (final Exception e) {
log.error("Failed to generate " + getFriendlyName() + " Metadata Signing credentials");
e.printStackTrace();
- throw new CredentialsNotAvailableException("config.27", new Object[] {e.getMessage()}, e);
+ throw new CredentialsNotAvailableException("config.27", new Object[] { e.getMessage() }, e);
}
}
@@ -160,8 +162,8 @@ public abstract class AbstractCredentialProvider {
log.error(getFriendlyName()
+ " Assertion Signing credentials is not found or contains no PrivateKey.");
throw new CredentialsNotAvailableException("config.27",
- new Object[] {getFriendlyName() + " Assertion Signing credentials (Alias: "
- + getSignatureKeyAlias() + ") is not found or contains no PrivateKey."});
+ new Object[] { getFriendlyName() + " Assertion Signing credentials (Alias: "
+ + getSignatureKeyAlias() + ") is not found or contains no PrivateKey." });
}
@@ -169,7 +171,7 @@ public abstract class AbstractCredentialProvider {
} catch (final Exception e) {
log.error("Failed to generate " + getFriendlyName() + " Assertion Signing credentials");
e.printStackTrace();
- throw new CredentialsNotAvailableException("config.27", new Object[] {e.getMessage()}, e);
+ throw new CredentialsNotAvailableException("config.27", new Object[] { e.getMessage() }, e);
}
}
@@ -200,8 +202,8 @@ public abstract class AbstractCredentialProvider {
log.error(getFriendlyName()
+ " Assertion Encryption credentials is not found or contains no PrivateKey.");
throw new CredentialsNotAvailableException("config.27",
- new Object[] {getFriendlyName() + " Assertion Encryption credentials (Alias: "
- + getEncryptionKeyAlias() + ") is not found or contains no PrivateKey."});
+ new Object[] { getFriendlyName() + " Assertion Encryption credentials (Alias: "
+ + getEncryptionKeyAlias() + ") is not found or contains no PrivateKey." });
}
@@ -210,7 +212,7 @@ public abstract class AbstractCredentialProvider {
} catch (final Exception e) {
log.error("Failed to generate " + getFriendlyName() + " Assertion Encryption credentials");
e.printStackTrace();
- throw new CredentialsNotAvailableException("config.27", new Object[] {e.getMessage()}, e);
+ throw new CredentialsNotAvailableException("config.27", new Object[] { e.getMessage() }, e);
}
}
@@ -234,7 +236,6 @@ public abstract class AbstractCredentialProvider {
log.warn("Could NOT evaluate the Private-Key type from " + credentials.getEntityId()
+ " credential.");
-
}
signer.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);