|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--PkgAgentSystem.Messaging.Message | +--PkgAgentSystem.Messaging.SignedMessage
A message signed by the sender.
Based on SignedObject Ver. 1.34, 10/27/98 (Author: Li Gong)
Constructor Summary | |
protected |
SignedMessage()
Create a new and empty signed message. |
|
SignedMessage(MessageType msg,
Certificate[] signerCerts,
PrivateKey signingKey,
Signature signingEngine)
Constructs a SignedMessage from a Message .
|
Method Summary | |
String |
getAlgorithm()
Retrieves the name of the signature algorithm used for signing. |
Certificate[] |
getCertificateChain()
Retrieves the certificate chain of the signer. |
MessageType |
getMessage()
Retrieves the encapsulated message. |
byte[] |
getSignature()
Rerieves the signature on the signed object, in the form of a byte array. |
String |
toString()
Retrieves a string representation of the signed message |
boolean |
verify(KeyStore ks)
Verifies that the signature in this SignedMessage is the valid signature for the message stored inside, with the given key store. |
boolean |
verify(PublicKey verificationKey)
Verifies that the signature in this SignedMessage is the valid signature for the message stored inside, with the given verification key. |
boolean |
verify(PublicKey verificationKey,
Signature verificationEngine)
Verifies that the signature in this SignedMessage is the valid signature for the message stored inside, with the given verification key, using the designated verification engine. |
Methods inherited from class PkgAgentSystem.Messaging.Message |
copy, fromInitiator, getAddressee, getConversationTypeID, getDestConversationID, getSender, getSrcConversationID, setAddressee, setConversationTypeID, setDestConversationID, setFromInitiator, setSender, setSrcConversationID |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
protected SignedMessage()
public SignedMessage(MessageType msg, Certificate[] signerCerts, PrivateKey signingKey, Signature signingEngine) throws IOException, InvalidKeyException, SignatureException
SignedMessage
from a Message
.
The given message is signed with the given signing key, using the
designated signature engine. The message is stored for future access,
but later changes will not be reflected, as it is stored in binary form
and signed now.msg
- the message to be signed.signerCerts
- the certificate chain of the signersigningKey
- the private key for signing.signingEngine
- the signature signing engine.IOException
- if an error occurs during serializationInvalidKeyException
- if the key is invalid.SignatureException
- if signing fails.Method Detail |
public MessageType getMessage()
public Certificate[] getCertificateChain()
public byte[] getSignature()
public String getAlgorithm()
public String toString()
toString
in class Message
public boolean verify(PublicKey verificationKey) throws InvalidKeyException, SignatureException, NoSuchAlgorithmException
verificationKey
- the public key for verificationSignatureException
- if signature verification failedInvalidKeyException
- if the verification key is invalidNoSuchAlgorithmException
- if the algorihtm used for signing is not availablepublic boolean verify(PublicKey verificationKey, Signature verificationEngine) throws InvalidKeyException, SignatureException
verificationKey
- the public key for verificationverificationEngine
- the signature verification engineSignatureException
- if signature verification failedInvalidKeyException
- if the verification key is invalidpublic boolean verify(KeyStore ks) throws InvalidKeyException, SignatureException, NoSuchAlgorithmException
ks
- the key store used for verificationSignatureException
- if signature verification failedInvalidKeyException
- if the verification key is invalidNoSuchAlgorithmException
- if the algorihtm used for signing is not available
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |