APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.krb5.internal.rcache

public Class DflCache

extends ReplayCache
Class Inheritance
Imports
java.io.*, java.nio.BufferUnderflowException, .ByteBuffer, .ByteOrder, java.nio.channels.SeekableByteChannel, java.nio.file.Files, .Path, .StandardCopyOption, .StandardOpenOption, java.nio.file.attribute.PosixFilePermission, java.util.*, sun.security.krb5.internal.KerberosTime, .Krb5, .KrbApErrException, .ReplayCache

A dfl file is used to sustores AuthTime entries when the system property sun.security.krb5.rcache is set to dfl(|:path/|:path/name|:name) The file will be path/name. If path is not given, it will be System.getProperty("java.io.tmpdir") If name is not given, it will be service_euid in which euid is available as jdk.internal.misc.VM.geteuid(). The file has a header: i16 0x0501 (KRB5_RC_VNO) in network order i32 number of seconds for lifespan (in native order, same below) followed by cache entries concatenated, which can be encoded in 2 styles: The traditional style is: LC of client principal LC of server principal i32 cusec of Authenticator i32 ctime of Authenticator The new style has a hash: LC of "" LC of "HASH:%s %lu:%s %lu:%s" of (hash, clientlen, client, serverlen, server) where msghash is 32 char (lower case) text mode md5sum of the ciphertext of authenticator. i32 cusec of Authenticator i32 ctime of Authenticator where LC of a string means i32 strlen(string) + 1 octets of string, with the \0x00 ending The old style block is always created by MIT krb5 used even if a new style is available, which means there can be 2 entries for a single Authenticator. Java also does this way. See src/lib/krb5/rcache/rc_io.c and src/lib/krb5/rcache/rc_dfl.c. Update: New version can use other hash algorithms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private final String
private static long

Constructor Summary

AccessConstructor and Description
public
DflCache(String source)

Method Summary

Modifier and TypeMethod and Description
public void
checkAndStore(KerberosTime currTime, AuthTimeWithHash time)

Implements abstract sun.security.krb5.internal.ReplayCache.checkAndStore.

Accepts or rejects an AuthTime.

private synchronized void
private static String
private static String
private static Path
getFileName(String source, String server)

Inherited from sun.security.krb5.internal.ReplayCache:
getInstancegetInstance

Field Detail

EXCESSREPSback to summary
private static final int EXCESSREPS
KRB5_RV_VNOback to summary
private static final int KRB5_RV_VNO
sourceback to summary
private final String source
uidback to summary
private static long uid

Constructor Detail

DflCacheback to summary
public DflCache(String source)

Method Detail

checkAndStoreback to summary
public void checkAndStore(KerberosTime currTime, AuthTimeWithHash time) throws KrbApErrException

Implements abstract sun.security.krb5.internal.ReplayCache.checkAndStore.

Doc from sun.security.krb5.internal.ReplayCache.checkAndStore.

Accepts or rejects an AuthTime.

Annotations
@Override
Exceptions
KrbApErrException:
if the authenticator is a replay
checkAndStore0back to summary
private synchronized void checkAndStore0(KerberosTime currTime, AuthTimeWithHash time) throws IOException, KrbApErrException
defaultFileback to summary
private static String defaultFile(String server)
defaultPathback to summary
private static String defaultPath()
getFileNameback to summary
private static Path getFileName(String source, String server)
sun.security.krb5.internal.rcache back to summary

private Class DflCache.Storage

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable

Field Summary

Modifier and TypeField and Description
pack-priv SeekableByteChannel

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

private static void
private static SeekableByteChannel
private static void
expunge(Path p, KerberosTime currTime)

private int
private static void
private static int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chanback to summary
pack-priv SeekableByteChannel chan

Constructor Detail

Storageback to summary
private Storage()

Method Detail

appendback to summary
private void append(AuthTimeWithHash at) throws IOException
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
createback to summary
private static void create(Path p) throws IOException
Annotations
@SuppressWarnings:try
createNoCloseback to summary
private static SeekableByteChannel createNoClose(Path p) throws IOException
expungeback to summary
private static void expunge(Path p, KerberosTime currTime) throws IOException
loadAndCheckback to summary
private int loadAndCheck(Path p, AuthTimeWithHash time, KerberosTime currTime) throws IOException, KrbApErrException
makeMineback to summary
private static void makeMine(Path p) throws IOException
readHeaderback to summary
private static int readHeader(SeekableByteChannel chan) throws IOException