Package jadex.ipc.impl.security
Interface ICryptoSuite
public interface ICryptoSuite
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
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
Returns the creation time of the crypto suite.Gets the ID used to identify the handshake of the suite.jadex.messaging.ISecurityInfo
Gets the security infos related to the authentication state.boolean
handleHandshake
(Security security, BasicSecurityMessage incomingmessage) Handles handshake messages.boolean
Returns if the suite is expiring and should be replaced.void
setHandshakeId
(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.
-
Method Details
-
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
jadex.messaging.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
Handles handshake messages.- Parameters:
security
- The security 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:
SecurityException
- if handshake failed.
-
getHandshakeId
String getHandshakeId()Gets the ID used to identify the handshake of the suite.- Returns:
- Handshake ID.
-
setHandshakeId
Sets the ID used to identify the handshake of the suite.- Parameters:
id
- Handshake ID.
-
setInitializer
void setInitializer(boolean initializer) Sets if the suite represents the protocol initializer.- Parameters:
initializer
- True, if initializer.
-