All Packages Class Hierarchy This Package Previous Next Index
Interface semper.certificate.Certificate
- public interface Certificate
- extends Serializable, Browseable
Certificate is an interface defining the services on a certificates that
must be provided by an implementation of certificates that are to be used
in SEMPER. For an example of a simple implementation, see
DummyCertificate.
Note that the interface defined in the following can be expected to change
in the future.
-
getCAName()
- Retrieve the name of the CA.
-
getCASign()
- Retrieve signature for this certificate signed by the CA whose
Distinguished Name is stored in the Certificate.
-
getExtensions()
- get the certificate extensions
-
getHashID()
- Retrieve the algorithm ID of the algorithm used to hash
this Certificate with.
-
getIdLevel()
- Retrieve the identification level of this certificate as a String
-
getModuleName()
- Retrieve name of module
-
getNotValidAfter()
- Retrieve the Date after which this certificate isn't valid.
-
getNotValidBefore()
- Retrieve the Date before which this certificate isn't valid.
-
getPublicKey()
- Retrieve the Public Key certified by this certificate.
-
getRegLevel()
- Retrieve the registration level of this certificate as a String
-
getScope()
- Retrieve the scope for this Certificate.
-
getSerialNo()
- Retrieve this Certificates SerialNr, with which it is identified
by the CA that issued this certificate.
-
getSignatureID()
- Retrieve the algorithm ID of the algorithm used to sign
this Certificate with.
-
getStatus()
- Retrieve the status of the Certificate.
-
getType()
- Retrieve the type of Certificate.
-
getUserDN()
- Retrieve certificate designated name.
-
getWhyRevoked()
- Retrieve reason why this Certificate was revoked.
-
sameCertificate(Certificate)
- Desides whether two certificates should be considered equal.
-
setCAName(String)
- Set the CA's name that issued this certificate.
-
setExtensions(CertificateExtensions)
- Set the extensions of the certificate
-
setHashID(HashingAlgorithm)
- 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(Scope)
- Set the scope for this Certificate.
-
setSerialNo(long)
- Set this Certificates SerialNr, with which it is identified
by the CA that issued this certificate.
-
setSignatureID(SignAlgorithm)
- Set the algorithm ID of the algorithm used to sign
this Certificate with.
-
setStatus(Status)
- Set the status of the Certificate.
-
setType(CertificateType)
- Set the type of Certificate.
-
setUserDN(String)
- Set certificate owners name.
-
setWhyRevoked(Revocation)
- Set reason why this Certificate was revoked.
-
verifyCertificate(CryptoKeyInfo)
- verify certificates correctness (ie whether signature matches its
contents).
getModuleName
public abstract String getModuleName()
- Retrieve name of module
- Returns:
- name of module
getCAName
public abstract String getCAName()
- Retrieve the name of the CA.
- Returns:
- name of CA
getUserDN
public abstract String getUserDN()
- Retrieve certificate designated name.
- Returns:
- distinguished name of subject
getRegLevel
public abstract String getRegLevel()
- Retrieve the registration level of this certificate as a String
- Returns:
- registration level
getIdLevel
public abstract String getIdLevel()
- Retrieve the identification level of this certificate as a String
- Returns:
- identification level
getSerialNo
public abstract long getSerialNo()
- Retrieve this Certificates SerialNr, with which it is identified
by the CA that issued this certificate.
- Returns:
- serial number of certificate
getPublicKey
public abstract CryptoKeyInfo getPublicKey()
- Retrieve the Public Key certified by this certificate.
- Returns:
- certified public key
getScope
public abstract Scope getScope()
- Retrieve the scope for this Certificate. The scope is encoded by
an integer and tells what the certificed key can be used for (e.g.,
signing or encryption). This service may return SCOPE_NYI meaning that the
certificate contains no information about the scope.
- Returns:
- scope of certificate (possibly SCOPE_NYI)
getType
public abstract CertificateType getType()
- Retrieve the type of Certificate. E.g., a certificate may certify
a key or be an attribute certificate certifyin that a particular
person has a particular right. Again this service may return TYPE_NYI
- Returns:
- type of certificate (possibly TYPE_NYI)
getNotValidBefore
public abstract Date getNotValidBefore()
- Retrieve the Date before which this certificate isn't valid.
- Returns:
- Date before which this certificate isn't valid.
getNotValidAfter
public abstract Date getNotValidAfter()
- Retrieve the Date after which this certificate isn't valid.
- Returns:
- Date after which this certificate isn't valid.
getStatus
public abstract Status getStatus()
- Retrieve the status of the Certificate. If status isn't implemented,
(like in SecuDE) Certificates are assumed to be valid if they exist.
The status may tell, e.g., if the certificate has been revoked. It is
encoded by an integer.
- Returns:
- status of certificate (may be STATUS_NYI)
getCASign
public abstract 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
getWhyRevoked
public abstract Revocation getWhyRevoked()
- Retrieve reason why this Certificate was revoked. Might
change to a string later on. RCModules, that can't implement it
yet can instead return REVOC_REASON_NYI.
- Returns:
- the reason why a certificate has been revoked (possibly
REVOC_REASON_NYI)
getSignatureID
public abstract SignAlgorithm getSignatureID()
- Retrieve 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.)
- Returns:
- an integer encoding the algorithm used for making the signature
getHashID
public abstract HashingAlgorithm getHashID()
- Retrieve 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.)
- Returns:
- an integer encoding the algorithm used for hashing the certificate
before signing.
setCAName
public abstract void setCAName(String name)
- Set the CA's name that issued this certificate.
- Parameters:
- : - CA's name.
setUserDN
public abstract void setUserDN(String name)
- Set certificate owners name.
- Parameters:
- : - users name.
setSerialNo
public abstract void setSerialNo(long serialNr)
- Set this Certificates SerialNr, with which it is identified
by the CA that issued this certificate.
- Parameters:
- new - serial number.
setPublicKey
public abstract void setPublicKey(CryptoKeyInfo newKey)
- Set the Public Key certified with this certificate.
- Parameters:
- : - new Key.
setScope
public abstract void setScope(Scope scope)
- Set the scope for this Certificate. This might be an empty method.
- Parameters:
- scope - for the certificate.
setType
public abstract void setType(CertificateType type)
- Set the type of Certificate. This might be an empty method.
- Parameters:
- type - of certificate.
setNotValidBefore
public abstract void setNotValidBefore(Date notValidBefore)
- Set the Date before which this certificate isn't valid.
- Parameters:
- start - date of certificates validity period.
setNotValidAfter
public abstract void setNotValidAfter(Date notValidAfter)
- Set the Date after which this certificate isn't valid.
- Parameters:
- end - date of certificates validity period.
setStatus
public abstract void setStatus(Status status)
- Set the status of the Certificate. If status isn't implemented,
this might be an empty method. For future implementations
of certificate-modules it should definitely be implemented.
- Parameters:
- status - of certificate.
setWhyRevoked
public abstract void setWhyRevoked(Revocation whyRevoked)
- Set reason why this Certificate was revoked. Might
change to a string later on.
setSignatureID
public abstract 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
setHashID
public abstract 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:
- hashing - ID.
- See Also:
- CryptoConstants
verifyCertificate
public abstract boolean verifyCertificate(CryptoKeyInfo trustedPK) throws CertificateException
- verify certificates correctness (ie whether signature matches its
contents).
- Parameters:
- s - trustedPK is the the public key which the signature is verified against.
- Throws: CertificateException
- if some error occurred while verifying.
sameCertificate
public abstract boolean sameCertificate(Certificate cert)
- Desides whether two certificates should be considered equal.
- Parameters:
- The - certificate to be compared against.
- Returns:
- true if the given certificate equals this certificate
setExtensions
public abstract void setExtensions(CertificateExtensions ext)
- Set the extensions of the certificate
- Parameters:
- cettificate - extensions
getExtensions
public abstract CertificateExtensions getExtensions()
- get the certificate extensions
- Returns:
- the extensions
All Packages Class Hierarchy This Package Previous Next Index