Fix for ALF-10189:

o Alfresco key store manages keys and backup keys internally
  o moved key registration and checking into AlfrescoKeyStoreImpl
  o encryptor thread cache fix resulting from reload of key stores at runtime
  o more encryption and key store tests
  o tidy up + more comments
  o moved hard-coded values to properties file

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30405 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2011-09-11 12:09:24 +00:00
parent 195ea9c810
commit 69d5e091e0
18 changed files with 1011 additions and 341 deletions

View File

@@ -9,7 +9,7 @@ import java.util.Set;
import javax.crypto.SealedObject;
import org.alfresco.encryption.Encryptor;
import org.alfresco.encryption.FallbackEncryptor;
import org.alfresco.encryption.KeyProvider;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.security.authentication.AuthenticationException;
@@ -35,7 +35,7 @@ import org.alfresco.service.namespace.QName;
public class MetadataEncryptor
{
private DictionaryService dictionaryService;
private Encryptor encryptor;
private FallbackEncryptor encryptor;
/**
* @param dictionaryService service to check if properties need encrypting
@@ -48,7 +48,7 @@ public class MetadataEncryptor
/**
* @param encryptor the class that does the encryption/decryption
*/
public void setEncryptor(Encryptor encryptor)
public void setEncryptor(FallbackEncryptor encryptor)
{
this.encryptor = encryptor;
}
@@ -221,4 +221,14 @@ public class MetadataEncryptor
// Done
return outbound;
}
public boolean keyAvailable(String keyAlias)
{
return encryptor.keyAvailable(keyAlias);
}
public boolean backupKeyAvailable(String keyAlias)
{
return encryptor.backupKeyAvailable(keyAlias);
}
}