MCPcopy Create free account
hub / github.com/cconlon/kerberos-java-gssapi / initializeGSS

Method initializeGSS

examples/gssClient.java:121–142  ·  view source on GitHub ↗

Set up GSS-API in preparation for context establishment. Creates GSSName and GSSCredential for client principal.

()

Source from the content-addressed store, hash-verified

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

Callers 1

mainMethod · 0.95

Calls 6

getMessageMethod · 0.80
toStringMethod · 0.65
getNameMethod · 0.65
getRemainingLifetimeMethod · 0.65
createNameMethod · 0.45
createCredentialMethod · 0.45

Tested by

no test coverage detected