Ignore:
Timestamp:
01/30/20 13:03:50 (4 years ago)
Author:
bnemhaus
Message:

New Attributes (and repurposed old ones) to be used for encryption of frames:

  • FrameEncryptionLabel. Used to be EncryptionLabel, which is still the case for items. When applied to a frame, it determines the label used to encrypt the entire frame.
  • HomogeneousEncryptionLabel. Does not yet actually do anything. The future point of this attribute is to provide the label that must be used to encrypt items on the frame when the user has only homogeneous encryption permissions.
  • EncryptionFramePermission. Does not yet actually do anything. The future point of this attribute isto determine if a user is able to change the FrameEncryptionLabel on a frame. Level 0 (none), no they cannot. Level 1 (homogeneous), they can only change it to HomogeneousEncryptionLabel. Level 2 (Hetrogeneous Owner), they can change it to any label as long as the owner of the Frame has that label. Level 3 (Hetrogeneous), they can change it to anything.
  • EncryptionPermission. Does not yet actually do anything. The future point of this attribute is to determine what encryption labels can be applied to items on the frame. Level 0 (none), cannot apply an encryption label. Level 1 (homogeneous), they can only used the label specified in HomogeneousEncryptionLabel. Level 2 (Hetrogeneous Owner), they can only use encryption labels that the owner of the frame has. Level 3 (Hetrogeneous) they can use any labels to encrypt an item.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/Frame.java

    r1502 r1505  
    117117        private PermissionTriple _permissionTriple = null;
    118118       
    119         private EncryptionPermissionTriple _encPermissionTriple = null;
     119        private EncryptionPermissionTriple _frameEncryptionPermission = null;
     120       
     121        private EncryptionPermissionTriple _itemEncryptionPermission = null;
    120122
    121123        private String _owner = null;
     
    154156        private ItemsList _primaryItemsBody = new ItemsList();
    155157        private ItemsList _surrogateItemsBody = new ItemsList();
    156        
    157         //private List<Item> _body = new ArrayList<Item>();
    158         //private List<Item> _bodyHiddenDueToPermissions = new ArrayList<Item>();
    159         //private List<Item> _primaryItemsBody = new ArrayList<Item>();
    160         //private List<Item> _surrogateItemsBody = new ArrayList<Item>();
    161158
    162159        // for drawing purposes
     
    199196        private String _encryptionLabel;
    200197       
     198        private String _homogeneousEncryptionLabel;
     199       
    201200        private String _groupFrameName;
    202201        private Frame _groupFrame = null;
     
    217216       
    218217        public boolean isEncryptableFrame() {
    219                 boolean hasEncryptionLabel = this.getEncryptionLabel() != null;
     218                boolean hasEncryptionLabel = this.getFrameEncryptionLabel() != null;
    220219                boolean isProfileFrame = this.getPath().equals(FrameIO.PROFILE_PATH);
    221220                boolean isCredentialsFrame = isProfileFrame && this.getNumber() == AuthenticatorBrowser.CREDENTIALS_FRAME;
     
    580579        public Item getNameItem() {
    581580                //Text ret = _frameName;
    582                 if (this.getEncryptionLabel() != null && this.getEncryptionLabel().length() > 0) {
     581                if (this.getFrameEncryptionLabel() != null && this.getFrameEncryptionLabel().length() > 0) {
    583582                        _frameName.setText("\uD83D\uDD12" + getFramesetName() + _number);
    584583                        _frameName.resetFrameNamePosition();
     
    30013000                return _interactableItems;
    30023001        }
    3003        
    3004         public String getEncryptionLabel() {
     3002               
     3003        /** Encryption related functions start **/
     3004        public String getFrameEncryptionLabel() {
    30053005                return _encryptionLabel;
    30063006        }
    30073007       
    3008         public void setEncryptionLabel(String label) {
     3008        public void setFrameEncryptionLabel(String label) {
    30093009                LabelInfo labelResult = Label.getLabel(label);
    30103010                boolean isProfileOrNone = label.equals("Profile") || label.equals("None");
     
    30193019        }
    30203020       
     3021        public EncryptionPermissionTriple getFrameEncryptionPermission() {
     3022                return _frameEncryptionPermission;
     3023        }
     3024       
     3025        public void setFrameEncryptionPermission(EncryptionPermissionTriple p) {
     3026                _frameEncryptionPermission = p;
     3027        }
     3028       
     3029        public String getHomogeneousEncryptionLabel() {
     3030                return _homogeneousEncryptionLabel;
     3031        }
     3032       
     3033        public void setHomogeneousEncryptionLabel(String label) {
     3034                LabelInfo labelResult = Label.getLabel(label);
     3035                boolean isProfileOrNone = label.equals("Profile") || label.equals("None");
     3036                if (!isProfileOrNone && !labelResult.is(LabelResult.SuccessResolveLabelToKey)) {
     3037                        MessageBay.displayMessage(labelResult.toString());
     3038                        this._homogeneousEncryptionLabel = null;
     3039                        return;
     3040                }
     3041               
     3042                this.setChanged(true);
     3043                _homogeneousEncryptionLabel = label;
     3044        }
     3045       
    30213046        public EncryptionPermissionTriple getEncryptionPermission() {
    3022                 return _encPermissionTriple;
     3047                return _itemEncryptionPermission;
    30233048        }
    30243049       
    30253050        public void setEncryptionPermission(EncryptionPermissionTriple p) {
    3026                 _encPermissionTriple = p;
    3027         }
     3051                _itemEncryptionPermission = p;
     3052        }
     3053        /** Encryption related functions end **/
    30283054
    30293055        public String getGroup() {
Note: See TracChangeset for help on using the changeset viewer.