ajanta.agent
Class ReadOnlyContainer
java.lang.Object
|
+--ajanta.agent.ReadOnlyContainer
- public class ReadOnlyContainer
- extends java.lang.Object
A container for read-only data (constants) to be carried along by an
agent. It is initialized by the agent's owner before the agent is
launched, and cannot be subsequently modified without detection.
- See Also:
AppendOnlyContainer,
TargetedContainer
|
Field Summary |
java.util.Vector |
objs
the read-only objects being carried along with the agent |
|
Constructor Summary |
ReadOnlyContainer(java.util.Vector objs,
java.security.interfaces.DSAPrivateKey key)
Constructor requires the agent's creator to supply the private
key which will be used to sign the read-only objects. |
|
Method Summary |
boolean |
verify(java.security.interfaces.DSAPublicKey key)
Checks whether this ReadOnlyContainer has been tampered with |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
objs
public java.util.Vector objs
- the read-only objects being carried along with the agent
ReadOnlyContainer
public ReadOnlyContainer(java.util.Vector objs,
java.security.interfaces.DSAPrivateKey key)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.SignatureException,
java.io.IOException
- Constructor requires the agent's creator to supply the private
key which will be used to sign the read-only objects. This key is
not carried along by the agent, however.
- Parameters:
objs - a vector of objects to be protectedkey - the DSA private key to be used for signing
- Throws:
java.security.NoSuchAlgorithmException - If the current host does not support the DSA algorithm (with SHA as hash function)
java.security.InvalidKeyException - If an invalid key is supplied during object construction
java.security.SignatureException - If an error occurred during the signing process
java.io.IOException - If an IO error occurred while serializing the vector of objects being signed
verify
public boolean verify(java.security.interfaces.DSAPublicKey key)
throws java.security.NoSuchAlgorithmException,
java.security.InvalidKeyException,
java.security.SignatureException,
java.io.IOException
- Checks whether this ReadOnlyContainer has been tampered with
- Parameters:
key - The DSA public key for the agent
- Throws:
java.security.NoSuchAlgorithmException - If the current host does not support the DSA algorithm (with SHA as hash function)
java.security.InvalidKeyException - If an invalid key is supplied
java.security.SignatureException - If an error occurred during the verification process
java.io.IOException - If an IO error occurred while serializing the vector of objects to be verified