Package jadex.platform.service.security
Interface ICryptoSuite
-
public interface ICryptoSuite
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
decryptAndAuth(byte[] content)
Decrypt and authenticates the message from a sender.byte[]
decryptAndAuthLocal(byte[] content)
Decrypt and authenticates a locally encrypted message.byte[]
encryptAndSign(byte[] content)
Encrypts and signs the message for a receiver.long
getCreationTime()
Returns the creation time of the crypto suite.java.lang.String
getHandshakeId()
Gets the ID used to identify the handshake of the suite.JadexVersion
getRemoteVersion()
Gets the version of the remote Jadex platform.ISecurityInfo
getSecurityInfos()
Gets the security infos related to the authentication state.boolean
handleHandshake(SecurityAgent agent, BasicSecurityMessage incomingmessage)
Handles handshake messages.boolean
isExpiring()
Returns if the suite is expiring and should be replaced.void
setHandshakeId(java.lang.String id)
Sets the ID used to identify the handshake of the suite.void
setInitializer(boolean initializer)
Sets if the suite represents the protocol initializer.void
setRemoteVersion(JadexVersion jadexversion)
Sets the version of the remote Jadex platform.
-
-
-
Method Detail
-
encryptAndSign
byte[] encryptAndSign(byte[] content)
Encrypts and signs the message for a receiver.- Parameters:
content
- The content- Returns:
- Encrypted/signed message.
-
decryptAndAuth
byte[] decryptAndAuth(byte[] content)
Decrypt and authenticates the message from a sender.- Parameters:
content
- The content.- Returns:
- Decrypted/authenticated message or null on invalid message.
-
decryptAndAuthLocal
byte[] decryptAndAuthLocal(byte[] content)
Decrypt and authenticates a locally encrypted message.- Parameters:
content
- The content.- Returns:
- Decrypted/authenticated message or null on invalid message.
-
getSecurityInfos
ISecurityInfo getSecurityInfos()
Gets the security infos related to the authentication state.- Returns:
- The security infos for decrypted messages.
-
isExpiring
boolean isExpiring()
Returns if the suite is expiring and should be replaced.- Returns:
- True, if the suite is expiring and should be replaced.
-
getCreationTime
long getCreationTime()
Returns the creation time of the crypto suite.- Returns:
- The creation time.
-
handleHandshake
boolean handleHandshake(SecurityAgent agent, BasicSecurityMessage incomingmessage)
Handles handshake messages.- Parameters:
agent
- The security agent object.incomingmessage
- A message received from the other side of the handshake, set to null for initial message.- Returns:
- True, if handshake continues, false when finished.
- Throws:
java.lang.SecurityException
- if handshake failed.
-
getHandshakeId
java.lang.String getHandshakeId()
Gets the ID used to identify the handshake of the suite.- Returns:
- Handshake ID.
-
setHandshakeId
void setHandshakeId(java.lang.String id)
Sets the ID used to identify the handshake of the suite.- Parameters:
id
- Handshake ID.
-
getRemoteVersion
JadexVersion getRemoteVersion()
Gets the version of the remote Jadex platform.- Returns:
- The Jadex version.
-
setRemoteVersion
void setRemoteVersion(JadexVersion jadexversion)
Sets the version of the remote Jadex platform.- Parameters:
jadexversion
- The Jadex version.
-
setInitializer
void setInitializer(boolean initializer)
Sets if the suite represents the protocol initializer.- Parameters:
initializer
- True, if initializer.
-
-