|
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 | +--java.security.cert.Certificate | +--PkgAgentSystem.Crypto.AgentIdentity
The identity of an agent. Contains information about the agent, its owner and the home system.
It is signed both by the owner and by the agent itself. In this
way it is impossible to change the public key of the agent without knowing the private key of the
owner. It is however possible to replace both the key of the agent and the owner.
The identity can be either cryptograpic secure (signed, owner certificate needed) or insecure (unsigned).
Inner classes inherited from class java.security.cert.Certificate |
Certificate.CertificateRep |
Field Summary | |
protected PublicKey |
agentPublicKey
The public key of the agent |
protected String |
agentPublicKeyName
Name of the public key of the agent |
protected URL |
home
URL of the home system of the agent. |
protected String |
id
ID if the agent; should be unique. |
protected String |
name
The name of the agent |
protected Certificate |
ownerCertificate
Certificate of the owner of the agent |
protected String |
ownerName
String representation of the name of the owner |
protected String |
signAlgorithmAgent
The signature of the agent |
protected String |
signAlgorithmOwner
The algorithm used for signing by the owner |
protected byte[] |
signatureAgent
The algorithm used for signing by the agent |
protected byte[] |
signatureOwner
The signature of the owner |
protected boolean |
signed
true if this is identity is signed |
protected int |
version
Version of identity. |
Fields inherited from interface PkgAgentSystem.Classification.AgentClassification |
ACCEPTED, CHECK_CURRENTLY_IMPOSSIBLE, CHECK_IMPOSSIBLE, IGNORE, REJECTED, REQUEST_CHECK, UNKNOWN_CLASSIFICATION |
Constructor Summary | |
(package private) |
AgentIdentity()
|
protected |
AgentIdentity(String type)
|
|
AgentIdentity(String name,
String id,
URL home,
String ownerName)
Creates a new AgentIdentity which does not include an owner certificate. |
|
AgentIdentity(String name,
String id,
URL home,
String agentPublicKeyName,
PublicKey agentPublicKey,
String ownerName,
Certificate ownerCertificate)
Creates a new AgentIdentity which does include an owner certificate and a public key of the agent. |
Method Summary | |
boolean |
codeDeployed()
Returns whether the manifest of the code package (including the digests of all the code files) was signed by the owner upon sending it on this job. |
AgentIdentity |
copy()
Returns a (shallow) copy of this identity. |
protected void |
decodeData(byte[] buffer)
Restores the content of an identity from a buffer. |
void |
deploy(byte[] agentState,
byte[] manifestBytes,
PrivateKey privateOwnerKey)
Deploys the agent by signing the current state (i. e. the initialization parameters) and the code used if applicable (digest over the code signatures) |
boolean |
equals(Object other)
Indicates whether some other object is "equal to" this one. |
String |
getAgentName()
Returns the name of the agent |
String |
getAgentPublicKeyName()
Returns the name of the public key of the agent |
byte[] |
getAgentSignature()
Returns the bytes of the signature by the agent (if manual checking is desired) |
String |
getAgentSignatureAlgorithm()
Returns the algorithm of the signature by the agent (if manual checking is desired) |
Certificate |
getCertificate()
Returns the certificate, which is associated with this classification (which is this object). |
int |
getClassificationStatus()
Returns the current status of the classification. |
byte[] |
getDeployCodeSignature()
Returns the bytes of the signature of the code signatures |
byte[] |
getDeployInitializationSignature()
Returns the bytes of the signature of the intialization state |
byte[] |
getEncoded()
Returns the identity in an encoded form in an byte array. |
protected byte[] |
getEncodedForSigning()
Returns the identity in an encoded form in an byte array. |
URL |
getHomeAddress()
Returns the URL of the home agent-system of the agent |
String |
getID()
Returns the unique id of the agent |
Certificate |
getOwnerCertificate()
Returns the certificate of the owner of the agent or null if not present |
String |
getOwnerName()
Returns the name of the owner of the agent. |
byte[] |
getOwnerSignature()
Returns the bytes of the signature by the owner (if manual checking is desired) |
String |
getOwnerSignatureAlgorithm()
Returns the algorithm of the signature by the owner (if manual checking is desired) |
PublicKey |
getPublicKey()
Returns the public key of the agent |
AgentIdentity |
getRegularCustomerIdentity()
Returns the identity of the agent. |
int |
hashCode()
Returns a hashcode value for the identity. |
boolean |
initialStateDeployed()
Returns whether this agent's state was signed by the owner upon sending them on this job. |
boolean |
isSigned()
Returns true if this identity is signed (NO verification!) |
void |
setClassificationStatus(int newStatus)
Sets the status of this classification. |
void |
setDeployCodeSignature(byte[] signature)
Sets the bytes of the signature of the code signatures |
void |
setDeployInitializationSignature(byte[] signature)
Sets the bytes of the signature of the intialization state |
void |
setSignatures(String ownerSignAlgo,
byte[] ownerSignature,
String agentSignAlgo,
byte[] agentSignature)
Sets the signatures and their algorithms. |
boolean |
sign(String signAlgoOwner,
PrivateKey privateOwnerKey,
String signAlgoAgent,
PrivateKey privateAgentKey)
Sign the identity with the private key of the agent and the private key of the owner |
String |
toString()
Returns a String representation of this identity. |
void |
verify()
This method allows to verify this identity. |
void |
verify(PublicKey ownerKey)
This method allows to verify this identity. |
void |
verify(PublicKey ownerKey,
String sigProvider)
This method allows to verify this identity. |
void |
verifyDeployCodeSignature(byte[] manifestBytes)
Verifys the signature on the code manifest |
Methods inherited from class java.security.cert.Certificate |
getType, writeReplace |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected int version
protected boolean signed
protected String signAlgorithmOwner
protected byte[] signatureOwner
protected byte[] signatureAgent
protected String signAlgorithmAgent
protected String ownerName
protected String name
protected String id
protected URL home
URL
of the home system of the agent. Protocol must be 'amp'protected String agentPublicKeyName
protected transient PublicKey agentPublicKey
protected transient Certificate ownerCertificate
Constructor Detail |
AgentIdentity()
protected AgentIdentity(String type)
public AgentIdentity(String name, String id, URL home, String ownerName)
name
- the name of the agentid
- the unique id of the agenthome
- the URL of the home agent-systemownerName
- the name of the owner of the agentpublic AgentIdentity(String name, String id, URL home, String agentPublicKeyName, PublicKey agentPublicKey, String ownerName, Certificate ownerCertificate)
name
- the name of the agentid
- the unique id of the agenthome
- the URL of the home agent-systemagentPublicKeyName
- the name of the public key of the agent. Must be identical to the name used for storing the private key in the key-store of the agent.agentPublicKey
- the public key of the agentownerName
- the name of the owner of the agent (may be null)ownerCertificate
- the certificate of the owner of the agentMethod Detail |
protected void decodeData(byte[] buffer) throws IOException, CertificateException, NoSuchAlgorithmException
getEncodedForSigning
.buffer
- the array of bytes from which to re-create the identitycl
- the classloader, which should be used to recreate all the objectsIOException
- if an error occured during deserialization of a fieldCertificateException
- if the key could not be decodedNoSuchAlgorithmException
- if the algorithm of the key is not availableAgentIdentityFactory
protected byte[] getEncodedForSigning() throws CertificateEncodingException
CertificateEncodingException
- if an error occured during encodingpublic final byte[] getEncoded() throws CertificateEncodingException
getEncoded
in class Certificate
CertificateEncodingException
- if an error occured during encodingpublic final boolean sign(String signAlgoOwner, PrivateKey privateOwnerKey, String signAlgoAgent, PrivateKey privateAgentKey) throws CertificateEncodingException, InvalidKeyException, NoSuchAlgorithmException, SignatureException
signAlgoOwner
- algorithm used for signing with the owners private key (if null
, the standard algorithm of the key is used)privateOwnerKey
- private key of the ownersignAlgoAgent
- algorithm used for signing with the agents private key (if null
, the standard algorithm of the key is used)privateAgentKey
- private key of the agentCertificateEncodingException
- if the identity could not be encodedInvalidKeyException
- if one of the private keys provided is invalidNoSuchAlgorithmException
- if one of the algorithms provided is unknownSignatureException
- if an error occured during signing or the identity is alread signedpublic final String getOwnerSignatureAlgorithm()
public final String getAgentSignatureAlgorithm()
public final byte[] getOwnerSignature()
public final byte[] getAgentSignature()
public final byte[] getDeployInitializationSignature()
public final byte[] getDeployCodeSignature()
public final void setSignatures(String ownerSignAlgo, byte[] ownerSignature, String agentSignAlgo, byte[] agentSignature) throws SignatureException, IllegalStateException
IllegalStateException
- if the identity is already signedSignatureException
- if the verification failedpublic final void setDeployInitializationSignature(byte[] signature)
signature
- array of bytes of the signature of the intialization stateIllegalStateException
- if the signature is already setpublic final void setDeployCodeSignature(byte[] signature)
array
- of bytes of the signature on the code signaturesIllegalStateException
- if the signature is already setpublic final void verify(PublicKey ownerKey, String sigProvider) throws CertificateEncodingException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
verify
in class Certificate
ownerKey
- public key of the owner used for verification of the signaturesigProvider
- name of the security provider which should be used for verification (take care that it is installed). If null, the default provider is usedCertificateEncodingException
- if the identity could not be encodedInvalidKeyException
- if one of the public keys is invalidNoSuchAlgorithmException
- if one of the algorithms used is unknownNoSuchProviderException
- if the requested provider could not be foundSignatureException
- if an error occured during verification or the verification failedpublic final void verify(PublicKey ownerKey) throws CertificateEncodingException, NoSuchAlgorithmException, InvalidKeyException, SignatureException
verify
in class Certificate
ownerKey
- public key of the owner used for verification of the signatureCertificateEncodingException
- if the identity could not be encodedInvalidKeyException
- if one of the public keys is invalidNoSuchAlgorithmException
- if one of the algorithms used is unknownSignatureException
- if an error occured during verification or the verification failedpublic final void verify() throws CertificateEncodingException, NoSuchAlgorithmException, SignatureException
CertificateEncodingException
- if the identity could not be encodedNoSuchAlgorithmException
- if one of the algorithms used is unknownSignatureException
- if an error occured during verification or the verification failedpublic final boolean isSigned()
public final String getOwnerName()
public final String getAgentName()
public final String getID()
public final URL getHomeAddress()
URL
of the home agent-system of the agentURL
of the agents home systempublic final String getAgentPublicKeyName()
public final PublicKey getPublicKey()
getPublicKey
in class Certificate
public final Certificate getOwnerCertificate()
public String toString()
String
representation of this identity. Included is the agents and the owners name, the
home location and the ID.toString
in class Certificate
String
representation of the identitypublic int hashCode()
hashCode
in class Certificate
Object.hashCode()
public boolean equals(Object other)
equals
in class Certificate
other
- the object to compare withObject.equals(Object)
public final int getClassificationStatus()
getClassificationStatus
in interface AgentClassification
AgentClassification
public final void setClassificationStatus(int newStatus)
setClassificationStatus
in interface AgentClassification
newStatus
- the new statusSecurityException
- if the caller may not modify the status of the classificationAgentClassification
public final AgentIdentity getRegularCustomerIdentity()
RegularCustomerClassification
getRegularCustomerIdentity
in interface RegularCustomerClassification
RegularCustomerClassification
public final Certificate getCertificate()
CertificateClassification
getCertificate
in interface CertificateClassification
this
)CertificateClassification
public void deploy(byte[] agentState, byte[] manifestBytes, PrivateKey privateOwnerKey) throws InvalidKeyException, NoSuchAlgorithmException, SignatureException
agentState
- the state of the agent (serialized)manifestBytes
- the manifest of the agent (including the code signatures, if any)privateOwnerKey
- private key of the ownerInvalidKeyException
- if one of the private keys provided is invalidNoSuchAlgorithmException
- if one of the algorithms provided is unknownSignatureException
- if an error occured during signing or the agent is alread deployedpublic void verifyDeployCodeSignature(byte[] manifestBytes) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException
manifestBytes
- the manifest of the agent (including the code signatures, if any)InvalidKeyException
- if one of the private keys provided is invalidNoSuchAlgorithmException
- if one of the algorithms provided is unknownSignatureException
- if an error occured during verification or the verification failedpublic boolean codeDeployed()
true
if the code was deployed by the ownerpublic boolean initialStateDeployed()
true
if the initialization state was deployed by the ownerpublic AgentIdentity copy()
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |