org.kuali.rice.kew.routeheader
Class DocumentContentEncryptionConverter

java.lang.Object
  extended by org.kuali.rice.kew.routeheader.DocumentContentEncryptionConverter
All Implemented Interfaces:
javax.persistence.AttributeConverter<String,String>

public class DocumentContentEncryptionConverter
extends Object
implements javax.persistence.AttributeConverter<String,String>

A JPA Converter which supports mixed encrypted and non-encrypted document content XML.

Leverages behavior from the standard EncryptionConverter but additionally when converting to the entity attribute value, it will detect whether or not the value is encrypted XML or plain text XML and decrypt if necessary. This allows for this situation where encryption is enabled at a later date. Using this mechanism, existing plain text docs can be loaded (but could potentially be saved back to the database encrypted if encryption is enabled).

Note that the mixed mode only works one way. If you have been using encryption and then disable it, this converter will not be able to decrypt your old doc content for you since it will no longer have the encryption key available to it.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
DocumentContentEncryptionConverter()
           
 
Method Summary
 String convertToDatabaseColumn(String attribute)
           
 String convertToEntityAttribute(String dataValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentContentEncryptionConverter

public DocumentContentEncryptionConverter()
Method Detail

convertToEntityAttribute

public String convertToEntityAttribute(String dataValue)
Specified by:
convertToEntityAttribute in interface javax.persistence.AttributeConverter<String,String>

convertToDatabaseColumn

public String convertToDatabaseColumn(String attribute)
Specified by:
convertToDatabaseColumn in interface javax.persistence.AttributeConverter<String,String>


Copyright © 2005–2015 The Kuali Foundation. All rights reserved.