Set up GSS-API in preparation for context establishment. Creates GSSName and GSSCredential for client principal.
()
| 119 | * GSSName and GSSCredential for client principal. |
| 120 | **/ |
| 121 | public static void initializeGSS() { |
| 122 | |
| 123 | try { |
| 124 | GSSName clientName = mgr.createName(clientPrincipal, |
| 125 | GSSName.NT_USER_NAME); |
| 126 | |
| 127 | /* create cred with max lifetime */ |
| 128 | clientCred = mgr.createCredential(clientName, |
| 129 | GSSCredential.INDEFINITE_LIFETIME, mech, |
| 130 | GSSCredential.INITIATE_ONLY); |
| 131 | |
| 132 | System.out.println("GSSCredential created for " |
| 133 | + clientCred.getName().toString()); |
| 134 | System.out.println("Credential lifetime (sec) = " |
| 135 | + clientCred.getRemainingLifetime() + "\n"); |
| 136 | |
| 137 | } catch (GSSException e) { |
| 138 | System.out.println("GSS-API error in credential acquisition: " |
| 139 | + e.getMessage()); |
| 140 | System.exit(1); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Establish a GSS-API context with example server, calling |
no test coverage detected