PkgAgentSystem.Messaging
Class ChallengeIdentityMessage
java.lang.Object
|
+--PkgAgentSystem.Messaging.Message
|
+--PkgAgentSystem.Messaging.ChallengeIdentityMessage
- All Implemented Interfaces:
- Cloneable, MessageType, Serializable
- Direct Known Subclasses:
- AcceptAndReplyChallengeMessage, ProveIdentityMessage
- public class ChallengeIdentityMessage
- extends Message
A message to initiate a mutual authentication.
The length of the challenges is restricted to 16 bytes. Otherwise it would be possible to submit certain data
and let the computer sign it without knowing its content. To avoid this, also some bytes are inserted
(which hopefully destroy any normal meaning!). The bytes must be matching in the method
replyToChallenge
of AgentBase
.
- Version:
- 1.0, 1.7.2000
- Author:
- Michael Sonntag
- See Also:
URL
,
URLStreamHandler
,
AgentBase
,
Message
,
AcceptAndReplyChallengeMessage
,
ProveIdentityMessage
, Serialized Form
Field Summary |
protected byte[] |
challenge
Our own challenge to the other host |
protected byte[] |
signed_challenge
Our own signature on the challenge from the other host |
Method Summary |
boolean |
checkChallenge(PublicKey pubKey,
byte[] original_challenge)
Verify the signed challenge returned from the other agent. |
byte[] |
createChallenge()
Create a new challenge of the 16 bytes. |
Methods inherited from class PkgAgentSystem.Messaging.Message |
copy, fromInitiator, getAddressee, getConversationTypeID, getDestConversationID, getSender, getSrcConversationID, setAddressee, setConversationTypeID, setDestConversationID, setFromInitiator, setSender, setSrcConversationID, toString |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
challenge
protected byte[] challenge
- Our own challenge to the other host
signed_challenge
protected byte[] signed_challenge
- Our own signature on the challenge from the other host
ChallengeIdentityMessage
public ChallengeIdentityMessage(MessageType msg,
AgentIdentity ownID,
long convID)
- Create a new
ChallengeIdentityMessage
to start mutual authentication.
Is sent in reply to the message provided as parameter.
- Parameters:
msg
- the msg to create a reply toownID
- identity of the local agent (if null, addressee of the message used)convID
- conversation ID (if 0, ID of the message used)- See Also:
ChallengeIdentityMessage
createChallenge
public byte[] createChallenge()
- Create a new challenge of the 16 bytes.
- Returns:
- the challenge created (for storing the original challenge for verifying the returned signature)
checkChallenge
public boolean checkChallenge(PublicKey pubKey,
byte[] original_challenge)
- Verify the signed challenge returned from the other agent. This is successful, if the
signature can be verified with the provided public key and the original challenge.
- Parameters:
pubKey
- the public key used to verify the signatureoriginal_challenge
- the original challenge- Returns:
- true if the challenge was answered successfully
Submit a bug
Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.