Changeset 1505


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.
Location:
trunk/src/org/expeditee
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/account/Create.java

    r1504 r1505  
    255255                        if (f.getNumber() != AuthenticatorBrowser.CREDENTIALS_FRAME &&
    256256                                        f.getNumber() != AuthenticatorBrowser.PASSWORD_RECOVERY_FRAME) {
    257                                 f.setEncryptionLabel(AuthenticatorBrowser.PROFILEENCRYPTIONLABEL);
     257                                f.setFrameEncryptionLabel(AuthenticatorBrowser.PROFILEENCRYPTIONLABEL);
    258258                        }
    259259                        Collection<Item> secretsLink = Actions.getByContent(f, "Secrets");
  • trunk/src/org/expeditee/encryption/items/UserAppliedEncryptionPermission.java

    r1374 r1505  
    22
    33public enum UserAppliedEncryptionPermission {
    4         none(0), homogeneous(1), hetrogeneous_limited(2), hetrogeneous(3), full(4);
     4        none(0), homogeneous(1), hetrogeneous_owner(2), hetrogeneous(3);
    55       
    66        private final int val;
  • trunk/src/org/expeditee/gui/AttributeUtils.java

    r1477 r1505  
    185185                         */
    186186                       
    187                         // Frames
     187                        // Standard Frame attributes
    188188                        _FrameAttrib.put("Permission",      Frame.class.getMethod("getPermission"),
    189189                                                            Frame.class.getMethod("setPermission", pPermission));
     
    200200                        _FrameAttrib.put("BackgroundColor", Frame.class.getMethod("getBackgroundColor"),
    201201                                                            Frame.class.getMethod("setBackgroundColor", pColor));
    202                         _FrameAttrib.put("EncryptionLabel", Frame.class.getMethod("getEncryptionLabel"),
    203                                                                                                 Frame.class.getMethod("setEncryptionLabel", pString));
    204                         _FrameAttrib.put("EncPermission",       Frame.class.getMethod("getEncryptionPermission"),
    205                                                                                                 Frame.class.getMethod("setEncryptionPermission", pEncPermission));
    206202                        _FrameAttrib.put("Group",                       Frame.class.getMethod("getGroup"),
    207203                                                                                                Frame.class.getMethod("setGroup", pString));
    208204                       
    209                        
    210                         // aliases for attribute setting
     205                        // Encryption Frame attributes
     206                        _FrameAttrib.put("FrameEncryptionLabel",                Frame.class.getMethod("getFrameEncryptionLabel"),
     207                                                                                                                        Frame.class.getMethod("setFrameEncryptionLabel", pString));
     208                        _FrameAttrib.put("EncryptionFramePermission",   Frame.class.getMethod("getFrameEncryptionPermission"),
     209                                                                                                                        Frame.class.getMethod("setFrameEncryptionPermission", pEncPermission));
     210                        _FrameAttrib.put("HomogeneousEncryptionLabel",  Frame.class.getMethod("getHomogeneousEncryptionLabel"),
     211                                                                                                                        Frame.class.getMethod("setHomogeneousEncryptionLabel", pString));
     212                        _FrameAttrib.put("EncryptionPermission",                Frame.class.getMethod("getEncryptionPermission"),
     213                                                                                                                        Frame.class.getMethod("setEncryptionPermission", pEncPermission));
     214                       
     215                        // aliases for Standard frame attribute settings
    211216                        _FrameAttrib.alias("fgc",       "foregroundcolor");
    212217                        _FrameAttrib.alias("bgc",       "backgroundcolor");
    213218                        _FrameAttrib.alias("p",         "permission");
    214                         _FrameAttrib.alias("enc",               "encryptionlabel");
    215                         _FrameAttrib.alias("encp",              "encpermission");
    216                         _FrameAttrib.alias("EncryptionPermission", "encpermission");
    217                        
     219                       
     220                        // aliases for Encryption frame attribute settings
     221                        _FrameAttrib.alias("encframelabel",     "FrameEncryptionLabel");
     222                        _FrameAttrib.alias("encframeperm",      "EncryptionFramePermission");
     223                        _FrameAttrib.alias("homoenclabel",      "HomogeneousEncryptionLabel");
     224                        _FrameAttrib.alias("encperm",           "EncryptionPermission");
    218225                       
    219226                        // Generic Items
  • 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() {
  • trunk/src/org/expeditee/gui/FrameCreator.java

    r1415 r1505  
    173173                       
    174174                        if (encryptionLabel != null && encryptionLabel.length() > 0) {
    175                                 toUse.setEncryptionLabel(encryptionLabel);
     175                                toUse.setFrameEncryptionLabel(encryptionLabel);
    176176                        }
    177177               
     
    252252                       
    253253                        if (encryptionLabel != null && encryptionLabel.length() > 0) {
    254                                 newFrame.setEncryptionLabel(encryptionLabel);
     254                                newFrame.setFrameEncryptionLabel(encryptionLabel);
    255255                        }
    256256
  • trunk/src/org/expeditee/gui/FrameIO.java

    r1504 r1505  
    11461146                                                               
    11471147                                if (toSave.isEncryptableFrame()) {
    1148                                         String encryptionLabel = toSave.getEncryptionLabel();
     1148                                        String encryptionLabel = toSave.getFrameEncryptionLabel();
    11491149                                        writer = new EncryptedExpWriter(encryptionLabel);
    11501150                                } else {
  • trunk/src/org/expeditee/io/Conversion.java

    r1415 r1505  
    522522                value = value.trim();
    523523
    524                 if ((method.getParameterTypes()[0].isEnum()) || (name.matches("setPermission")) || (name.matches("setEncryptionPermission"))) {
     524                if ((method.getParameterTypes()[0].isEnum()) || (name.matches("setPermission")) || (name.matches("setFrameEncryptionPermission"))) {
    525525                        Method convertString;
    526526                        Object[] objects = new Object[1];
  • trunk/src/org/expeditee/io/DefaultFrameReader.java

    r1415 r1505  
    8383
    8484                try {
     85                        ///     C         H I J   L   N   P Q R S       W X Y Z
     86                        /// a b c     f g h i j   l m n o   q r s t u v w x y z
     87                        // Standard frame tags
    8588                        _FrameTags.put('A', Frame.class.getMethod("setName", pString));
    8689                        _FrameTags.put('V', Frame.class.getMethod("setVersion", pInt));
     
    9396                        _FrameTags.put('O', Frame.class.getMethod("setForegroundColor", pColor));
    9497                        _FrameTags.put('B', Frame.class.getMethod("setBackgroundColor", pColor));
    95                         _FrameTags.put('K', Frame.class.getMethod("setEncryptionLabel", pString));
    9698                        _FrameTags.put('T', Frame.class.getMethod("addToData", pString));
    97                         _FrameTags.put('E', Frame.class.getMethod("setEncryptionPermission", pEncPermission));
    9899                        _FrameTags.put('G', Frame.class.getMethod("setGroup", pString));
     100                       
     101                        // Encryption frame tags
     102                        _FrameTags.put('K', Frame.class.getMethod("setFrameEncryptionLabel", pString));
     103                        _FrameTags.put('E', Frame.class.getMethod("setFrameEncryptionPermission", pEncPermission));
     104                        _FrameTags.put('k', Frame.class.getMethod("setHomogeneousEncryptionLabel", pString));
     105                        _FrameTags.put('e', Frame.class.getMethod("setEncryptionPermission", pEncPermission));
    99106
    100107                        // Note: As of 26/11/18 there are no unused letter item tags.  Use other characters.
  • trunk/src/org/expeditee/io/DefaultFrameWriter.java

    r1418 r1505  
    178178        {
    179179                try {
     180                        ///     C         H I J   L   N   P Q R S       W X Y Z
     181                        /// a b c     f g h i j   l m n o   q r s t u v w x y z
     182                        // Standard frame tags
    180183                        _FrameTags.put('V', Frame.class.getMethod("getVersion"));
    181184                        _FrameTags.put('p', Frame.class.getMethod("getPermission"));
     
    187190                        _FrameTags.put('O', Frame.class.getMethod("getForegroundColor"));
    188191                        _FrameTags.put('B', Frame.class.getMethod("getBackgroundColor"));
    189                         _FrameTags.put('K', Frame.class.getMethod("getEncryptionLabel"));
    190192                        _FrameTags.put('T', Frame.class.getMethod("getData"));
    191                         _FrameTags.put('E', Frame.class.getMethod("getEncryptionPermission"));
    192193                        _FrameTags.put('G', Frame.class.getMethod("getGroup"));
     194                       
     195                        // Encryption frame tags
     196                        _FrameTags.put('K', Frame.class.getMethod("getFrameEncryptionLabel"));
     197                        _FrameTags.put('E', Frame.class.getMethod("getFrameEncryptionPermission"));
     198                        _FrameTags.put('k', Frame.class.getMethod("getHomogeneousEncryptionLabel"));
     199                        _FrameTags.put('e', Frame.class.getMethod("getEncryptionPermission"));
    193200                       
    194201                        // Note: As of 26/11/18 there are no unused letter item tags.  Use other characters.
  • trunk/src/org/expeditee/items/Item.java

    r1477 r1505  
    41024102                this._encryptionLabel = label;
    41034103               
    4104                 if (this.getParent().getEncryptionLabel() == null) {
     4104                if (this.getParent().getFrameEncryptionLabel() == null) {
    41054105                        MessageBay.displayMessage("Items can only be entrypted if the frame they are on is.");
    41064106                        return;
Note: See TracChangeset for help on using the changeset viewer.