All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class semper.certificate.dummy.DummyCertificate

java.lang.Object
   |
   +----semper.certificate.dummy.DummyCertificate

public class DummyCertificate
extends Object
implements Certificate
This is an implementation of the Certificate interface allowing the initial SEMPER trials to use certificates. The certificate stores the following information: distinguished name of CA and user, a unique serial number, the public key, scope of the key, type of the certificate (for the moment this is always key-certificate), validity period, status of certificate, reason for revocation in case the certificated has been revoked, the signature, algorithm identifiers for signing and hashing. Services for registration is provided by a simple implementation of RCModuleInterface.

See Also:
RCModuleInterface

Constructor Index

 o DummyCertificate()
Create an empty certificate
 o DummyCertificate(DummyCertificate)
Create a new Certificate containing the same info as the input certificate.
 o DummyCertificate(String, String, long, CryptoKeyInfo, Scope, CertificateType, Date, Date, Status, Revocation, byte[], SignAlgorithm, HashingAlgorithm)
Create a certificate.
 o DummyCertificate(String, String, long, CryptoKeyInfo, Scope, CertificateType, Date, Date, Status, Revocation, byte[], SignAlgorithm, HashingAlgorithm, DummyExtensions)
Create a certificate.

Method Index

 o compareTo(Browseable, int, boolean)
Compare with given object.
 o copyCertificate(DummyCertificate)
Method for copying the content of one certificate into another
 o equals(Object)
Overrides the equals method.
 o exportToLineOfASCII()
One line of ASCII.
 o exportToLineOfHTML()
One line of HTML.
 o exportToLinesOfHTML()
Several lines of HTML.
 o getActions()
Sets the names of the actions that should be displayed on the TINGUIN.This method is dynamically invoked by the method interact2 of the Browser class.
 o getCAkey(String)
Get the secret key of the CA generated by generateCAkeys() in DummyRCModule.java.
 o getCAName()
Retrieve CA's name.
 o getCASign()
Retrieve signature for this certificate signed by the CA whose Distinguished Name is stored in the Certificate.
 o getExtensions()
 o getHashID()
Get the Algorithm ID (HASH_MD4, HASH_RIPEMD etc) of the function used by the CA to hash the signatuer of this certificate.
 o getIdLevel()
Retrieve the identification level of this certificate as a String
 o getKeys()
Obtain the names of the keys which can be used to sort.
 o getMethodName(int)
Obtain the name of the method that should be called for a browseable.
 o getModuleName()
Retrieve name of module
 o getName()
Return the formal name of the Browseable which is Certificate.
 o getNotValidAfter()
Retrieve the Date after which this certificate isn't valid.
 o getNotValidBefore()
Retrieve the Date before which this certificate isn't valid.
 o getPublicKey()
Retrieve certified Public Key.
 o getRegLevel()
Retrieve the registration level of this certificate as a String
 o getRevokationReason()
Finds the reason for which the certificate was revoked
 o getScope()
Retrieve certificate scope.
 o getSerialNo()
Retrieve Serial number Certificate static structure means I can retrieve it myself.
 o getSignatureID()
Get the Algorithm ID (SIG_RSA, SIG_DSS etc) of the function used by the CA to sign this certificate.
 o getStatus()
Retrieve status
 o getType()
retrieve certificate type
 o getUserDN()
Retrieve users name.
 o getWhyRevoked()
Retrieve revocation reason
 o isEqual(Certificate)
Decides whether two certificates should be considered equal.
 o sameCertificate(Certificate)
The same as isEqual method.
 o setCAName(String)
Set the CA's name that issued this certificate.
 o setCASign(byte[])
Set signature for this certificate, signed by the CA whose Distinguished Name is stored in the Certificate.
 o setExtensions(CertificateExtensions)
 o setHashID(HashingAlgorithm)
Set the algorithm ID of the algorithm used to hash this Certificate with.
 o setNotValidAfter(Date)
Set the Date after which this certificate isn't valid.
 o setNotValidBefore(Date)
Set the Date before which this certificate isn't valid.
 o setPublicKey(CryptoKeyInfo)
Set the Public Key certified with this certificate.
 o setScope(Scope)
Set the scope for this Certificate.
 o setSerialNo(long)
Set this Certificates SerialNo with which it is identified by the CA that issued this certificate.
 o setSignatureID(SignAlgorithm)
Set the algorithm ID of the algorithm used to sign this Certificate with.
 o setStatus(Status)
Set the status of the Certificate.
 o setType(CertificateType)
Set the type of Certificate.
 o setUserDN(String)
Set certificate owners name.
 o setWhyRevoked(Revocation)
Set reason why this Certificate was revoked.
 o toByteArray()
Encodes the parts of a certificate to be signed as an array of bytes
 o toString()
 o verifyCertificate(CryptoKeyInfo)
Verify Certificates correctness.

Constructors

 o DummyCertificate
 public DummyCertificate(String ca,
                         String user,
                         long nr,
                         CryptoKeyInfo pubKey,
                         Scope scope,
                         CertificateType type,
                         Date validStart,
                         Date validEnd,
                         Status state,
                         Revocation reason,
                         byte signature[],
                         SignAlgorithm signatureID,
                         HashingAlgorithm hashID)
Create a certificate.

Parameters:
ca - = Distinguished name of Certification Authority issuing this certificate
user - = Distinguished name of User to which certificate belongs.
nr - = Serial number for certificate within CA
pubKey - = The public key certified for this User by certificate.
scope - = Public keys scope (or application)
type - = Certificate Type
validStart - = Start of validity period
validEnd - = End of validity period
state - = _status of the certificate
reason - = Reason for revocation
signature - = CA's signature
signatureID - = The algorithm ID of the algorithm which is used to sign this Certificate. The type of hash algorithm should correspond to the possible algorithm types defined in the CryptoConstants.
hashID - = The algorithm ID of the algorithm used to hash this Certificate. The type of hash algorithm should correspond to the possible algorithm types defined in the CryptoConstants.
 o DummyCertificate
 public DummyCertificate(String ca,
                         String user,
                         long nr,
                         CryptoKeyInfo pubKey,
                         Scope scope,
                         CertificateType type,
                         Date validStart,
                         Date validEnd,
                         Status state,
                         Revocation reason,
                         byte signature[],
                         SignAlgorithm signatureID,
                         HashingAlgorithm hashID,
                         DummyExtensions extensions)
Create a certificate.

Parameters:
ca - = Distinguished name of Certification Authority issuing this certificate
user - = Distinguished name of User to which certificate belongs.
nr - = Serial number for certificate within CA
pubKey - = The public key certified for this User by certificate.
scope - = Public keys scope (or application)
type - = Certificate Type
validStart - = Start of validity period
validEnd - = End of validity period
state - = _status of the certificate
reason - = Reason for revocation
signature - = CA's signature
signatureID - = The algorithm ID of the algorithm which is used to sign this Certificate. The type of hash algorithm should correspond to the possible algorithm types defined in the CryptoConstants.
hashID - = The algorithm ID of the algorithm used to hash this Certificate. The type of hash algorithm should correspond to the possible algorithm types defined in the CryptoConstants.
extensions - =
 o DummyCertificate
 public DummyCertificate()
Create an empty certificate

 o DummyCertificate
 public DummyCertificate(DummyCertificate cert)
Create a new Certificate containing the same info as the input certificate.

Parameters:
cert - is the certificate which shoiuld be copied.

Methods

 o getModuleName
 public String getModuleName()
Retrieve name of module

Returns:
name of module
 o getCAName
 public String getCAName()
Retrieve CA's name. Certificate static structure means I can retrieve it myself.

Returns:
distinguished name of CA
 o getUserDN
 public String getUserDN()
Retrieve users name. Certificate static structure means I can retrieve it myself.

Returns:
distinguished name of CA
 o getRegLevel
 public String getRegLevel()
Retrieve the registration level of this certificate as a String

Returns:
registration level
 o getIdLevel
 public String getIdLevel()
Retrieve the identification level of this certificate as a String

Returns:
identification level
 o getSerialNo
 public long getSerialNo()
Retrieve Serial number Certificate static structure means I can retrieve it myself.

Returns:
serial number of certificate
 o getPublicKey
 public CryptoKeyInfo getPublicKey()
Retrieve certified Public Key.

Returns:
certified public key
 o getScope
 public Scope getScope()
Retrieve certificate scope.

Returns:
scope of certificate
 o getType
 public CertificateType getType()
retrieve certificate type

Returns:
type of certificate
 o getNotValidBefore
 public Date getNotValidBefore()
Retrieve the Date before which this certificate isn't valid.

Returns:
Date before which this certificate isn't valid.
 o getNotValidAfter
 public Date getNotValidAfter()
Retrieve the Date after which this certificate isn't valid.

Returns:
Date after which this certificate isn't valid.
 o getStatus
 public Status getStatus()
Retrieve status

Returns:
status of certificate (may be STATUS_NYI)
 o getCASign
 public byte[] getCASign()
Retrieve signature for this certificate signed by the CA whose Distinguished Name is stored in the Certificate.

Returns:
the signature as a byte array
 o getWhyRevoked
 public Revocation getWhyRevoked()
Retrieve revocation reason

Returns:
the reason why a certificate has been revoked
 o getSignatureID
 public SignAlgorithm getSignatureID()
Get the Algorithm ID (SIG_RSA, SIG_DSS etc) of the function used by the CA to sign this certificate.

Returns:
an integer encoding the algorithm used for making the signature
See Also:
CryptoConstants
 o getHashID
 public HashingAlgorithm getHashID()
Get the Algorithm ID (HASH_MD4, HASH_RIPEMD etc) of the function used by the CA to hash the signatuer of this certificate.

Returns:
an integer encoding the algorithm used for hashing the certificate before signing.
See Also:
CryptoConstants
 o setCAName
 public void setCAName(String name)
Set the CA's name that issued this certificate. This name is stored in the certificate.

Parameters:
: - CA's name.
 o setUserDN
 public void setUserDN(String name)
Set certificate owners name. This name is stored in the certificate.

Parameters:
: - users name.
 o setSerialNo
 public void setSerialNo(long serialNr)
Set this Certificates SerialNo with which it is identified by the CA that issued this certificate. This SerialNo is stored in the certificate.

Parameters:
new - serial number
 o setPublicKey
 public void setPublicKey(CryptoKeyInfo newKey)
Set the Public Key certified with this certificate.

Parameters:
the - new public key in the certificate.
 o setScope
 public void setScope(Scope scope)
Set the scope for this Certificate.

Parameters:
: - scope for the certificate.
 o setType
 public void setType(CertificateType type)
Set the type of Certificate.

Parameters:
type - of certificate.
 o setNotValidBefore
 public void setNotValidBefore(Date notValidBefore)
Set the Date before which this certificate isn't valid.

Parameters:
start - date of certificates validity period.
 o setNotValidAfter
 public void setNotValidAfter(Date notValidAfter)
Set the Date after which this certificate isn't valid.

Parameters:
ending - date of certificates validity period.
 o setStatus
 public void setStatus(Status status)
Set the status of the Certificate.

Parameters:
new - status of certificate.
 o setCASign
 public void setCASign(byte signature[]) throws CertificateException
Set signature for this certificate, signed by the CA whose Distinguished Name is stored in the Certificate. This function is only needed for testing.

Parameters:
The - string to be assigned to the signature attribute of the certificate.
Throws: CertificateException
is thrown, if the CA's signature couldn't be set.
 o getCAkey
 public CryptoKeyInfo getCAkey(String myName) throws CertificateException
Get the secret key of the CA generated by generateCAkeys() in DummyRCModule.java. this function will be removed later.

Parameters:
myName - is CA's (my) name.
Returns:
s the generated keys for this CA.
Throws: CertificateException
if the keys couldn't be retrieved.
 o setWhyRevoked
 public void setWhyRevoked(Revocation whyRevoked)
Set reason why this Certificate was revoked. Might change to a string later on.

Parameters:
reason - for revocation
 o setSignatureID
 public void setSignatureID(SignAlgorithm signatureID)
Set the algorithm ID of the algorithm used to sign this Certificate with. The types should correspond to the possible types defined in the CryptoConstants class (RSA, DSA etc.)

Parameters:
signature - algorithm ID.
See Also:
CryptoConstants
 o setHashID
 public void setHashID(HashingAlgorithm hashID)
Set the algorithm ID of the algorithm used to hash this Certificate with. The types should correspond to the possible types defined in the CryptoConstants class (MD2C, MD4, RIPE_MD, SHA etc.)

Parameters:
Certificate - which contains hashing ID.
See Also:
CryptoConstants
 o verifyCertificate
 public boolean verifyCertificate(CryptoKeyInfo trustedPK) throws CertificateException
Verify Certificates correctness. Should verify, whether Certificates Signature is correct. The Certificate Manager will check whether Certificate is of correct type, not outdated, etc.

Parameters:
trustedPK - is the public key against which the certificate is verified
Returns:
s: true if Certificate is signed correctly false if Signature doesn't match input.
Throws: CertificateException
if some error occurred while verifying.
 o sameCertificate
 public boolean sameCertificate(Certificate cert)
The same as isEqual method. See below!

 o isEqual
 public boolean isEqual(Certificate cert)
Decides whether two certificates should be considered equal. This module linearises the two certificates and compares the two byte arrays.

Parameters:
The - certificate to be compared against.
Returns:
true if the given certificate equals this certificate
 o setExtensions
 public void setExtensions(CertificateExtensions ext)
 o getExtensions
 public CertificateExtensions getExtensions()
 o copyCertificate
 public void copyCertificate(DummyCertificate cert)
Method for copying the content of one certificate into another

Parameters:
the - certificate whose attributes should be copied.
 o toByteArray
 public byte[] toByteArray()
Encodes the parts of a certificate to be signed as an array of bytes

Returns:
array of bytes encoding the Certificate
 o toString
 public String toString()
Overrides:
toString in class Object
 o getName
 public String getName()
Return the formal name of the Browseable which is Certificate.

Returns:
the formal name.
See Also:
Browseable
 o exportToLineOfHTML
 public String exportToLineOfHTML()
One line of HTML.

Returns:
major information about a certificate in HTML mode
See Also:
Browseable
 o exportToLinesOfHTML
 public String exportToLinesOfHTML()
Several lines of HTML.

Returns:
detailed information about a certificate in HTML mode
See Also:
Browseable
 o getRevokationReason
 public String getRevokationReason()
Finds the reason for which the certificate was revoked

Returns:
the revokation reason
 o exportToLineOfASCII
 public String exportToLineOfASCII()
One line of ASCII.

Returns:
the certificate in ASCII mode
See Also:
Browseable
 o compareTo
 public int compareTo(Browseable other,
                      int keyno,
                      boolean reverse)
Compare with given object.

Returns:
an integer that shows which should be displayed first
See Also:
compareTo
 o getKeys
 public String[] getKeys()
Obtain the names of the keys which can be used to sort.

Returns:
the names of the keys
See Also:
getKeys
 o getActions
 public String[] getActions()
Sets the names of the actions that should be displayed on the TINGUIN.This method is dynamically invoked by the method interact2 of the Browser class.

Returns:
a table containing the names of the actions.
 o getMethodName
 public String getMethodName(int n)
Obtain the name of the method that should be called for a browseable.

Parameters:
n - specifies the method chosen.
Returns:
the name of the method.
 o equals
 public boolean equals(Object obj)
Overrides the equals method.

Overrides:
equals in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index