|
Agent System POND 1.0 (1.7.2000) | ||||||||
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).
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. |
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 | |
protected void |
decodeData(byte[] buffer)
Restores the content of an identity from a buffer. |
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) |
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[] |
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) |
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 |
isSigned()
Returns true if this identity is signed (NO verification!) |
void |
setClassificationStatus(int newStatus)
Sets the status of this classification. |
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. |
Methods inherited from class java.security.cert.Certificate |
getType |
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 objectsAgentIdentityFactory
protected byte[] getEncodedForSigning() throws CertificateEncodingException
public final byte[] getEncoded() throws CertificateEncodingException
public 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 keyprivateOwnerKey
- private key of the ownersignAlgoAgent
- algorithm used for signing with the agents private keyprivateAgentKey
- private key of the agentpublic final byte[] getOwnerSignature()
public final byte[] getAgentSignature()
public final void verify(PublicKey ownerKey, String sigProvider) throws CertificateEncodingException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException
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 usedpublic final void verify(PublicKey ownerKey) throws CertificateEncodingException, NoSuchAlgorithmException, InvalidKeyException, SignatureException
ownerKey
- public key of the owner used for verification of the signaturepublic final void verify() throws CertificateEncodingException, NoSuchAlgorithmException, SignatureException
public 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()
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.String
representation of the identitypublic int hashCode()
Object.hashCode()
public boolean equals(Object other)
other
- the object to compare withObject.equals(Object)
public final int getClassificationStatus()
AgentClassification
public final void setClassificationStatus(int newStatus)
newStatus
- the new statusSecurityException
- if the caller may not modify the status of the classificationAgentClassification
public final AgentIdentity getRegularCustomerIdentity()
RegularCustomerClassification
RegularCustomerClassification
public final Certificate getCertificate()
CertificateClassification
this
)CertificateClassification
|
Agent System POND 1.0 (1.7.2000) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |