Question: Given the following class, which statement is correct? A. The class does not contain any security issues. B. The class contains exactly one security issue.
Given the following class, which statement is correct?

A. The class does not contain any security issues.
B. The class contains exactly one security issue.
C. The class contains exactly two security issues.
D. The class contains exactly three security issues.
E. None of the above.
1: import java.security.*; 2: import java.util.*; 3: 4: public class SecretFile { private String secret; 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: // Constructors/Getters Omitted private static class Folder { private final SecretFile value; private final Permission permission; } // Constructors/Getters Omitted public static Permission getPermission (String check) { // Implementation Omitted } private static Map c= new HashMap (); public static SecretFile getSecret (String t) { var securityRecord = c.get (t); if (securityRecord != null) { return securityRecord.getValue(); } var p= getPermission (t); Access Controller.checkPermission (p); var pc = p.newPermission Collection(); pc.add(p); var secret = Access Controller.doPrivileged ( new PrivilegedAction () { public SecretFile run() { return new SecretFile(System.getProperty(t)); }} }}, new Access ControlContext(new ProtectionDomain[] { new ProtectionDomain (null, pc) })); c.put(t, new Folder (secret, p)); return secret;
Step by Step Solution
3.47 Rating (150 Votes )
There are 3 Steps involved in it
The provided code snippet is from a Java class that seems to be dealing with a securityrelated feature managing access to SecretFile objects with perm... View full answer
Get step-by-step solutions from verified subject matter experts
