aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2015-12-04 21:20:55 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2015-12-04 21:20:55 +0100
commit6e421407cbd61a63f0f65e27929f28125546cbc1 (patch)
treed461b241a8108d61b21d9338d00af86e0e4c36cb /id/server/idserverlib/src/main/java/at
parent34c964709547ef67085d29e4d4b9692551be5140 (diff)
downloadmoa-id-spss-6e421407cbd61a63f0f65e27929f28125546cbc1.tar.gz
moa-id-spss-6e421407cbd61a63f0f65e27929f28125546cbc1.tar.bz2
moa-id-spss-6e421407cbd61a63f0f65e27929f28125546cbc1.zip
add additional PVP credential checks
Diffstat (limited to 'id/server/idserverlib/src/main/java/at')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java
index 645eb9e53..d76e6c2f1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/signer/CredentialProvider.java
@@ -86,6 +86,13 @@ public class CredentialProvider {
.getIDPKeyPasswordAssertionSign().toCharArray());
credentials.setUsageType(UsageType.SIGNING);
+ if (credentials.getPrivateKey() == null && credentials.getSecretKey() == null) {
+ Logger.error("IDP Assertion Signing credentials is not found or contains no PrivateKey.");
+ throw new CredentialsNotAvailableException("IDP Assertion Signing credentials (Alias: "
+ + config.getIDPKeyAliasAssertionSign() + ") is not found or contains no PrivateKey.", null);
+
+ }
+
return (X509Credential) credentials;
} catch (Exception e) {
Logger.error("Failed to generate IDP Assertion Signing credentials");
@@ -111,6 +118,14 @@ public class CredentialProvider {
.getIDPKeyPasswordAssertionEncryption().toCharArray());
credentials.setUsageType(UsageType.ENCRYPTION);
+
+ if (credentials.getPrivateKey() == null && credentials.getSecretKey() == null) {
+ Logger.error("IDP Assertion Encryption credentials is not found or contains no PrivateKey.");
+ throw new CredentialsNotAvailableException("IDP Assertion Encryption credentials (Alias: "
+ + config.getIDPKeyAliasAssertionEncryption() + ") is not found or contains no PrivateKey.", null);
+
+ }
+
return (X509Credential) credentials;
} catch (Exception e) {
Logger.error("Failed to generate IDP Assertion Encryption credentials");