Class semper.certificate.DummyCertificate
All Packages Class Hierarchy This Package Previous Next Index
Class semper.certificate.DummyCertificate
java.lang.Object
|
+----semper.certificate.DummyCertificate
- public class DummyCertificate
- extends Object
- implements Certificate
-
DummyCertificate()
- Create an empty certificate
-
DummyCertificate(DummyCertificate)
- Create a Certificate containing the same info that
the parameter-Certificate has
-
DummyCertificate(String, String, long, CryptoKeyInfo, int, int, Date, Date, int, int, byte[], int, int)
- Create a certificate.
-
changeCASign(String)
-
Set signature for this certificate, signed by the CA whose
Distinguished Name is stored in the Certificate.
-
getCADN()
- retrieve CA's name
Certificate static structure means I can retrieve it myself.
-
getCAkey(String)
-
Get the secret key of the CA generated by generateCAkeys() in
DummyRCModule.java.
-
getCASign()
- retrieve CA's signature
Certificate static structure means I can retrieve it myself.
-
getHashID()
-
Get the Algorithm ID (HASH_MD4, HASH_RIPEMD etc) of the function used by
the CA to hash the signatuer of this certificate.
-
getNotValidAfter()
- retrieve end of validity time
Certificate static structure means I can retrieve it myself.
-
getNotValidBefore()
- retrieve start of validity time
Certificate static structure means I can retrieve it myself.
-
getPublicKey()
- retrieve Public Key
Certificate static structure means I can retrieve it myself.
-
getScope()
- retrieve certificate scope
Certificate static structure means I can retrieve it myself.
-
getSerialNr()
- retrieve Serial number
Certificate static structure means I can retrieve it myself.
-
getSignatureID()
-
Get the Algorithm ID (SIG_RSA, SIG_DSS etc) of the function used by the
CA to sign this certificate.
-
getStatus()
- retrieve status
Certificate static structure means I can retrieve it myself.
-
getType()
- retrieve certificate type
Certificate static structure means I can retrieve it myself.
-
getUserDN()
- retrieve users name
Certificate static structure means I can retrieve it myself.
-
getWhyRevoked()
- retrieve revokation reason
Certificate static structure means I can retrieve it myself.
-
myStreamSize()
- Finds the expected number of bytes needed to externalize the object to s.
-
readObject(StreamInputInterface)
- Reads the object from an io stream (TargetStream).
-
setCADN(String)
-
Set the CA's name that issued this certificate.
-
setHashID(int)
-
Set the algorithm ID of the algorithm used to hash
this Certificate with.
-
setNotValidAfter(Date)
-
Set the Date after which this certificate isn't valid.
-
setNotValidBefore(Date)
-
Set the Date before which this certificate isn't valid.
-
setPublicKey(CryptoKeyInfo)
-
Set the Public Key certified with this certificate.
-
setScope(int)
-
Set the scope for this Certificate.
-
setSerialNr(long)
-
Set this Certificates SerialNr, with which it is identified
by the CA that issued this certificate.
-
setSignatureID(int)
-
Set the algorithm ID of the algorithm used to sign
this Certificate with.
-
setStatus(int)
-
Set the status of the Certificate.
-
setType(int)
-
Set the type of Certificate.
-
setUserDN(String)
-
Set certificate owners name.
-
setWhyRevoked(int)
-
Set reason why this Certificate was revoked.
-
verifyCertificate()
- Verify Certificates correctness.
-
writeObject(StreamOutputInterface)
- Writes the object to an io stream (TargetStream).
DummyCertificate
public DummyCertificate(String ca,
String user,
long nr,
CryptoKeyInfo pubKey,
int scope,
int type,
Date validStart,
Date validEnd,
int state,
int reason,
byte signature[],
int signatureID,
int 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
DummyCertificate
public DummyCertificate()
- Create an empty certificate
DummyCertificate
public DummyCertificate(DummyCertificate cert)
- Create a Certificate containing the same info that
the parameter-Certificate has
- Parameters:
- Certificate - cert is the certificate which shoiuld be copied.
getCADN
public String getCADN()
- retrieve CA's name
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getUserDN
public String getUserDN()
- retrieve users name
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getSerialNr
public long getSerialNr()
- retrieve Serial number
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getPublicKey
public CryptoKeyInfo getPublicKey()
- retrieve Public Key
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getScope
public int getScope()
- retrieve certificate scope
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getType
public int getType()
- retrieve certificate type
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getNotValidBefore
public Date getNotValidBefore()
- retrieve start of validity time
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getNotValidAfter
public Date getNotValidAfter()
- retrieve end of validity time
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getStatus
public int getStatus()
- retrieve status
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getCASign
public byte[] getCASign()
- retrieve CA's signature
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getWhyRevoked
public int getWhyRevoked()
- retrieve revokation reason
Certificate static structure means I can retrieve it myself.
If Certificate gets non-static has to call a function in the
rc-module instead.
getSignatureID
public int getSignatureID()
- Get the Algorithm ID (SIG_RSA, SIG_DSS etc) of the function used by the
CA to sign this certificate.
getHashID
public int getHashID()
- Get the Algorithm ID (HASH_MD4, HASH_RIPEMD etc) of the function used by
the CA to hash the signatuer of this certificate.
setCADN
public void setCADN(String name)
- Set the CA's name that issued this certificate. This name
is stored in the certificate.
- Parameters:
- : - CA's name.
setUserDN
public void setUserDN(String name)
- Set certificate owners name. This name
is stored in the certificate.
- Parameters:
- : - users name.
setSerialNr
public void setSerialNr(long serialNr)
- Set this Certificates SerialNr, with which it is identified
by the CA that issued this certificate. This SerialNr
is stored in the certificate.
- Parameters:
- : - Certificate, new serialNr.
setPublicKey
public void setPublicKey(CryptoKeyInfo newKey)
- Set the Public Key certified with this certificate.
- Parameters:
- : - Certificate, new Key.
setScope
public void setScope(int scope)
- Set the scope for this Certificate. This might (for instance
by SecuDEs X.509 v2 certificates) be an empty method.
- Parameters:
- : - Certificate, scope for the certificate.
setType
public void setType(int type)
- Set the type of Certificate. This might (for instance
by SecuDEs X.509 v2 certificates) be an empty method.
- Parameters:
- : - Certificate, type of certificate.
setNotValidBefore
public void setNotValidBefore(Date notValidBefore)
- Set the Date before which this certificate isn't valid.
- Parameters:
- : - Certificate, start date of certificates validity period.
setNotValidAfter
public void setNotValidAfter(Date notValidAfter)
- Set the Date after which this certificate isn't valid.
- Parameters:
- : - Certificate, end date of certificates validity period.
setStatus
public void setStatus(int status)
- Set the status of the Certificate. If status isn't implemented,
(like in SecuDE) might be an empty method. For future implementations
of certificate-modules should definitely be implemented, as the
current solution is born out of need, not desire.
- Parameters:
- : - Certificate, status of certificate.
changeCASign
public void changeCASign(String myName) throws CertificateException
- Set signature for this certificate, signed by the CA whose
Distinguished Name is stored in the Certificate.
- Parameters:
- : - Certificate, CA's secret key with which to sign.
getCAkey
public CryptoKeyInfo getCAkey(String myName) throws CertificateException
- Get the secret key of the CA generated by generateCAkeys() in
DummyRCModule.java.
- Parameters:
- myName - is CA's (my) name.
- Returns:
- s the generated keys for this CA.
- Throws: CertificateException
- if the keys couldn't be retrieved.
setWhyRevoked
public void setWhyRevoked(int whyRevoked)
- Set reason why this Certificate was revoked. Might
change to a string later on.
- Parameters:
- : - Certificate, reason.
setSignatureID
public void setSignatureID(int 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:
- : - Certificate, signature algorithm ID.
setHashID
public void setHashID(int 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.
verifyCertificate
public boolean verifyCertificate() 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:
- : - Certificate cert that is to be checked.
- : - TrustedPK is the trusted public key of the CA against
which the signature has to be checked.
- Returns:
- s: true if Certificate is signed correctly
false if Signature doesn't match input.
writeObject
public void writeObject(StreamOutputInterface s) throws StreamIOException
- Writes the object to an io stream (TargetStream).
- Parameters:
- s - is the stream the object is written to
- Returns:
- void
- Throws: StreamIOException
- if write failed.
- See Also:
- readObject
readObject
public void readObject(StreamInputInterface s) throws StreamIOException
- Reads the object from an io stream (TargetStream).
- Parameters:
- s - is the stream the object is read from
- Returns:
- void
- Throws: StreamIOException
- if read failed.
- See Also:
- writeObject
myStreamSize
public int myStreamSize() throws StreamIOException
- Finds the expected number of bytes needed to externalize the object to s.
- Parameters:
- s - is the stream the key information is written to
- Returns:
- number of bytes required
- Throws: StreamIOException
- if TargetStream threw an ecxeption.
- See Also:
- writeObject
All Packages Class Hierarchy This Package Previous Next Index