PrincipalName princ = new PrincipalName( principal, PrincipalNameType.KRB_NT_PRINCIPAL );
princ.setRealm( tgt.getRealm() );
credCache.setPrimaryPrincipalName( princ );
Credentials cred = new Credentials( tgt );
credCache.addCredentials( cred );
CredentialsCache.store( credCacheFile, credCache );
}