|
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.PublicKeyCertificate
Stores a public key with its name in a certificate.
Inner classes inherited from class java.security.cert.Certificate |
Certificate.CertificateRep |
Field Summary | |
protected String |
name
The name of the public key |
protected PublicKey |
publicKey
The public key |
Constructor Summary | |
(package private) |
PublicKeyCertificate()
Empty constructor necessary for the factory. |
|
PublicKeyCertificate(String name,
PublicKey publicKey)
Creates a new certificate with a name and a public key |
Method Summary | |
boolean |
equals(Object other)
Indicates whether some other object is "equal to" this one. |
byte[] |
getEncoded()
Returns the certificate in an encoded form in an byte array. |
String |
getName()
Returns the name of the public key |
PublicKey |
getPublicKey()
Returns the public key |
int |
hashCode()
Returns a hashcode value for this certificate. |
boolean |
sign(String signAlgoOwner,
PrivateKey privateOwnerKey,
String signAlgoAgent,
PrivateKey privateAgentKey)
Does nothing (always unsigned). |
String |
toString()
Returns a String representation of this public key.
|
void |
verify(PublicKey ownerKey)
Does nothing (always ok). |
void |
verify(PublicKey ownerKey,
String sigProvider)
Does nothing (always ok). |
Methods inherited from class java.security.cert.Certificate |
getType, writeReplace |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected String name
protected transient PublicKey publicKey
Constructor Detail |
PublicKeyCertificate()
public PublicKeyCertificate(String name, PublicKey publicKey)
name
- the name of the public keypublicKey
- the public keyMethod Detail |
public 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 keyprivateOwnerKey
- private key of the ownersignAlgoAgent
- algorithm used for signing with the agents private keyprivateAgentKey
- private key of the agentpublic 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 usedpublic 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 signaturepublic final PublicKey getPublicKey()
getPublicKey
in class Certificate
public final String getName()
public String toString()
String
representation of this public key.
Prints just the name.toString
in class Certificate
public 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)
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |