mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Refactoring to support ALF-9510, ALF-8702
ALF-8702: Solr-Repository SSL Communications (see solr/source/solr/instance/HowToSetUpSolr.txt ALF-9510: Initial checkin git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.alfresco.repo.node.encryption;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.KeyException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -10,6 +11,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;
|
||||
@@ -221,4 +223,23 @@ public class MetadataEncryptor
|
||||
// Done
|
||||
return outbound;
|
||||
}
|
||||
}
|
||||
|
||||
public Serializable reencrypt(QName propertyQName, Serializable sealed) throws InvalidKeyException
|
||||
{
|
||||
// metadataEncryptor uses a fallback encryptor; decryption will try the
|
||||
// default (new) keys first (which will fail for properties created before the
|
||||
// change in keys), followed by the backup keys.
|
||||
Serializable decrypted = decrypt(propertyQName, sealed);
|
||||
|
||||
// Re-encrypt. The new keys will be used.
|
||||
Serializable resealed = encrypt(propertyQName, decrypted);
|
||||
|
||||
return resealed;
|
||||
}
|
||||
|
||||
public boolean isFallbackAvailable()
|
||||
{
|
||||
return false;
|
||||
// return encryptor.isFallbackAvailable();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user