Skip to content

Commit

Permalink
Merge pull request #1051 from ivassile/ELY-1460
Browse files Browse the repository at this point in the history
[ELY-1460] External CS, PKCS11 can't be configured with externalPath
  • Loading branch information
dmlloyd committed Jan 24, 2018
2 parents 69bf930 + 250e196 commit 936739b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -1867,6 +1867,9 @@ public interface ElytronMessages extends BasicLogger {
@Message(id = 9527, value = "Invalid credential store reference")
ConfigXMLParseException xmlInvalidCredentialStoreRef(@Param Location location);

@Message(id = 9528, value = "The externalPath attribute for key store type %s is missing.")
CredentialStoreException externalPathMissing(String keyStoreType);


/* X.500 exceptions */

Expand Down
Expand Up @@ -142,7 +142,7 @@
* <li>{@code keyStoreType}: specifies the key store type to use (defaults to {@link KeyStore#getDefaultType()})</li>
* <li>{@code keyAlias}: specifies the secret key alias within the key store to use for encrypt/decrypt of data in external storage (defaults to {@code cs_key})</li>
* <li>{@code external}: specifies whether to store data to external storage and encrypted by {@code keyAlias} key (defaults to {@code false})</li>
* <li>{@code externalPath}: specifies path to the external storage. It has to be used in conjunction with {@code external=true} and it defaults to value of {@code location} when {@code keyStoreType} is PKCS11.</li>
* <li>{@code externalPath}: specifies path to the external storage. It has to be used in conjunction with {@code external=true}</li>
* <li>{@code cryptoAlg}: cryptographic algorithm name to be used to encrypt decrypt entries at external storage ({@code external} has to be set to {@code true})</li>
* </ul>
*/
Expand Down Expand Up @@ -200,8 +200,7 @@ public void initialize(final Map<String, String> attributes, final CredentialSto
if (useExternalStorage) {
final String externalPathName = attributes.get(EXTERNALPATH);
if (externalPathName == null) {
externalPath = location;
location = null;
throw log.externalPathMissing(keyStoreType);
} else {
externalPath = Paths.get(externalPathName);
if (externalPath.equals(location)) {
Expand Down

0 comments on commit 936739b

Please sign in to comment.