public static String convertToPem(GSSCredential cred) {
if (! (cred instanceof ExtendedGSSCredential)) {
return null;
}
ExtendedGSSCredential extCred = (ExtendedGSSCredential)cred;
String pem = null;
try {
byte[] exportData =
extCred.export(ExtendedGSSCredential.IMPEXP_OPAQUE);
pem = new String(exportData);
} catch (GSSException e) {
log.error(e.getMessage(), e);
}