- Timestamp:
- 07/24/19 11:23:45 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/encryption/items/surrogates/EncryptionDetail.java
r1413 r1415 1 1 package org.expeditee.encryption.items.surrogates; 2 2 3 public enum EncryptionDetail { 4 // If the property needs to be unencrypted due to inheritance then do not try to encrypt it. 5 UnencryptedOnSave, 6 7 // If the property is not inherited by any surrogates then we can try to encrypt it. 8 // If we do not have key then default to UnencryptedOnSave. 9 ReencryptOnSave, 10 11 // If the property is no longer inherited by at least one surrogate then this value is present. 12 // If it turns out there is no longer any surrogates who inherit the value then this value can be replaced with ReencryptOnSave. 13 // Otherwise, this value must be replaced with UnencryptedOnSave. 14 InheritanceCheckOnSave, 15 16 // If we could not decrypt the value on load then EncryptionDetail.getUndecipheredValue() can be used to get the value for saving. 17 UseUndecipheredValueOnSave; 18 19 private String undecipheredValue = null; 3 public class EncryptionDetail { 4 private Type type; 5 private String undecipheredValue; 6 7 public EncryptionDetail(Type type) { 8 this.type = type; 9 } 20 10 21 11 public EncryptionDetail setUndecipheredValue(String undecipheredValue) { … … 25 15 26 16 public String getUndecipheredValue() { 27 return this.undecipheredValue; 17 return undecipheredValue; 18 } 19 20 public Type getEncryptionDetailType() { 21 return type; 22 } 23 24 @Override 25 public EncryptionDetail clone() { 26 EncryptionDetail copy = new EncryptionDetail(this.type); 27 copy.setUndecipheredValue(this.undecipheredValue); 28 return copy; 29 } 30 31 public enum Type { 32 // If the property needs to be unencrypted due to inheritance then do not try to encrypt it. 33 UnencryptedOnSave, 34 35 // If the property is not inherited by any surrogates then we can try to encrypt it. 36 // If we do not have key then default to UnencryptedOnSave. 37 ReencryptOnSave, 38 39 // If the property is no longer inherited by at least one surrogate then this value is present. 40 // If it turns out there is no longer any surrogates who inherit the value then this value can be replaced with ReencryptOnSave. 41 // Otherwise, this value must be replaced with UnencryptedOnSave. 42 InheritanceCheckOnSave, 43 44 // If we could not decrypt the value on load then EncryptionDetail.getUndecipheredValue() can be used to get the value for saving. 45 UseUndecipheredValueOnSave; 28 46 } 29 47 }
Note:
See TracChangeset
for help on using the changeset viewer.