Question: Question 1 0 . Is the following Java code security - compliant? In case it is not compliant, please change it to make security -
Question Is the following Java code securitycompliant? In case it is not compliant, please change it to make securitycompliant.
class Password
public static void main String args throws IOException
Console c System.console;
if c null
System.err.printlnNo console.";
System.exit;
String username creadLineEnter your user name: ;
String password creadLineEnter your password: ;
if verifyusername password
throw new SecurityExceptionInvalid Credentials";
Dummy verify method, always returns true
private static final boolean verifyString username, String password
return true;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
