SpConfiguration.java
1.82 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.granite.auth.saml.configuration;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
public class SpConfiguration {
private String entityId;
private boolean useEncryption;
private String spPrivateKeyAlias;
private char[] keyStorePassword;
public void setEntityId(String entityId) {
this.entityId = entityId;
}
public String getEntityId() {
return this.entityId;
}
public Key getDecryptionKey(KeyStore keyStore) {
if (keyStore != null) {
try {
return keyStore.getKey(this.spPrivateKeyAlias, this.keyStorePassword);
}
catch (KeyStoreException e) {
throw new RuntimeException("Could not retrieve SP's private key from KeyStore.", e);
}
catch (NoSuchAlgorithmException e) {
throw new RuntimeException("Could not retrieve SP's private key from KeyStore.", e);
}
catch (UnrecoverableKeyException e) {
throw new RuntimeException("Could not retrieve SP's private key from KeyStore.", e);
}
}
throw new RuntimeException("Could not access KeyStore to receive SP's private key.");
}
public boolean getUseEncryption() {
return this.useEncryption;
}
public void setUseEncryption(boolean useEncryption) {
this.useEncryption = useEncryption;
}
public void setSpPrivateKeyAlias(String spPrivateKeyAlias) {
this.spPrivateKeyAlias = spPrivateKeyAlias;
}
public void setKeyStorePassword(String keyStorePassword) {
this.keyStorePassword = keyStorePassword.toCharArray();
}
}