x509_USER_PROXY = CoGProperties.getDefault().getProxyFile();
if (x509_USER_PROXY == null)
throw new SecurityException("could not get credential; no location defined");
ExtendedGSSManager manager = (ExtendedGSSManager) ExtendedGSSManager.getInstance();
// file...load file into a buffer
try {
File f = new File(x509_USER_PROXY);
byte[] data = new byte[(int) f.length()];
FileInputStream in = new FileInputStream(f);
// read in the credential data
in.read(data);
in.close();
return manager.createCredential(data, ExtendedGSSCredential.IMPEXP_OPAQUE, credentialLifetime, null, // use
// default
// mechanism
// -
// GSI
GSSCredential.INITIATE_AND_ACCEPT);