Package net.handle.hdllib
Class SessionInfo
- java.lang.Object
-
- net.handle.hdllib.SessionInfo
-
- Direct Known Subclasses:
ClientSideSessionInfo
public class SessionInfo extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description boolean
authenticateMessage
boolean
encryptMessage
byte[]
identityKeyHandle
int
identityKeyIndex
int
sessionId
byte[]
sessionKey
int
timeOut
-
Constructor Summary
Constructors Constructor Description SessionInfo(int sessionid, byte[] sessionkey, byte[] idenHandle, int idenIndex, int majorProtocolVersion, int minorProtocolVersion)
Deprecated.SessionInfo(int sessionid, byte[] sessionkey, byte[] idenHandle, int idenIndex, int algorithmCode, int majorProtocolVersion, int minorProtocolVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSessionCounter(int sessionCounter, boolean enforceUniqueness)
byte[]
decryptBuffer(byte[] buf, int offset, int len)
Decrypt the given buffer using the session key and algorithm that should have already been set.byte[]
encryptBuffer(byte[] buf, int offset, int len)
Encrypt the given buffer using the session key and algorithm that should have already been set.boolean
equals(java.lang.Object obj)
boolean
getAuthenticateMessageFlag()
static int
getDefaultTimeout()
boolean
getEncryptedMesssageFlag()
int
getEncryptionAlgorithmCode()
Return the algorithm that is being used for encryption in this session.byte
getMajorProtocolVersion()
byte
getMinorProtocolVersion()
int
getNextSessionCounter()
int
getSessionID()
byte[]
getSessionKey()
int
getTimeOut()
boolean
hasExpired()
int
hashCode()
boolean
isSessionAnonymous()
void
setAuthenticateMessageFlag(boolean flag)
static void
setDefaultTimeout(int maxSessionTimeout)
void
setEncryptedMesssageFlag(boolean flag)
void
setEncryptionAlgorithmCode(int algCode)
Set the algorithm that is to be used for encryption in this session.void
setSessionKey(byte[] sessionkey)
void
setTimeOut(int newTimeout)
void
touch()
-
-
-
Field Detail
-
timeOut
public int timeOut
-
sessionId
public int sessionId
-
sessionKey
public byte[] sessionKey
-
encryptMessage
public boolean encryptMessage
-
authenticateMessage
public boolean authenticateMessage
-
identityKeyHandle
public byte[] identityKeyHandle
-
identityKeyIndex
public int identityKeyIndex
-
-
Constructor Detail
-
SessionInfo
@Deprecated public SessionInfo(int sessionid, byte[] sessionkey, byte[] idenHandle, int idenIndex, int majorProtocolVersion, int minorProtocolVersion)
Deprecated.
-
SessionInfo
public SessionInfo(int sessionid, byte[] sessionkey, byte[] idenHandle, int idenIndex, int algorithmCode, int majorProtocolVersion, int minorProtocolVersion)
-
-
Method Detail
-
getNextSessionCounter
public int getNextSessionCounter()
-
addSessionCounter
public void addSessionCounter(int sessionCounter, boolean enforceUniqueness) throws HandleException
- Throws:
HandleException
-
getEncryptionAlgorithmCode
public int getEncryptionAlgorithmCode()
Return the algorithm that is being used for encryption in this session. Codes include HdlSecurityProvider.ENCRYPT_ALG_DES (the default), HdlSecurityProvider.ENCRYPT_ALG_DESEDE and HdlSecurityProvider.ENCRYPT_ALG_AES
-
setEncryptionAlgorithmCode
public void setEncryptionAlgorithmCode(int algCode)
Set the algorithm that is to be used for encryption in this session. Codes include HdlSecurityProvider.ENCRYPT_ALG_DES (the default), HdlSecurityProvider.ENCRYPT_ALG_DESEDE and HdlSecurityProvider.ENCRYPT_ALG_AES
-
encryptBuffer
public byte[] encryptBuffer(byte[] buf, int offset, int len) throws HandleException
Encrypt the given buffer using the session key and algorithm that should have already been set.- Throws:
HandleException
-
decryptBuffer
public byte[] decryptBuffer(byte[] buf, int offset, int len) throws HandleException
Decrypt the given buffer using the session key and algorithm that should have already been set.- Throws:
HandleException
-
isSessionAnonymous
public boolean isSessionAnonymous()
-
setTimeOut
public void setTimeOut(int newTimeout)
-
getTimeOut
public int getTimeOut()
-
getSessionKey
public byte[] getSessionKey()
-
setSessionKey
public void setSessionKey(byte[] sessionkey)
-
getEncryptedMesssageFlag
public boolean getEncryptedMesssageFlag()
-
getAuthenticateMessageFlag
public boolean getAuthenticateMessageFlag()
-
setEncryptedMesssageFlag
public void setEncryptedMesssageFlag(boolean flag)
-
setAuthenticateMessageFlag
public void setAuthenticateMessageFlag(boolean flag)
-
getMajorProtocolVersion
public byte getMajorProtocolVersion()
-
getMinorProtocolVersion
public byte getMinorProtocolVersion()
-
touch
public void touch()
-
hasExpired
public final boolean hasExpired()
-
setDefaultTimeout
public static void setDefaultTimeout(int maxSessionTimeout)
-
getDefaultTimeout
public static int getDefaultTimeout()
-
getSessionID
public int getSessionID()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-