use of sun.security.krb5.internal.ccache.CCacheInputStream in project jdk8u_jdk by JetBrains.
the class TimeInCCache method main.
public static void main(String[] args) throws Exception {
// test code changes in DEBUG
System.setProperty("sun.security.krb5.debug", "true");
CCacheInputStream cis = new CCacheInputStream(new ByteArrayInputStream(ccache));
cis.readVersion();
cis.readTag();
cis.readPrincipal(0x504);
Method m = CCacheInputStream.class.getDeclaredMethod("readCred", Integer.TYPE);
m.setAccessible(true);
Credentials c = (Credentials) m.invoke(cis, new Integer(0x504));
sun.security.krb5.Credentials cc = c.setKrbCreds();
// 1. Make sure starttime is still null
if (cc.getStartTime() != null) {
throw new Exception("Fail, starttime should be zero here");
}
// 2. Make sure renewTill is still null
if (cc.getRenewTill() != null) {
throw new Exception("Fail, renewTill should be zero here");
}
// 3. Make sure isValid works
c.isValid();
}
Aggregations