Package pt.gov.cartaodecidadao
Class PTEID_Certificate
- java.lang.Object
-
- pt.gov.cartaodecidadao.PTEID_Object
-
- pt.gov.cartaodecidadao.PTEID_Certificate
-
public class PTEID_Certificate extends PTEID_Object
Class that represents one certificate.
-
-
Field Summary
Fields Modifier and Type Field Description static long
CITIZEN_AUTH
static long
CITIZEN_SIGN
static long
SUB_CA_AUTH
static long
SUB_CA_SIGN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
countChildren()
Return the number of children for this certificate.void
delete()
PTEID_ByteArray
getCertData()
Return the content of the certificatePTEID_Certificate
getChildren(long ulIndex)
Return the children certificate (certificate that has been issued by this one).
void
getFormattedData(PTEID_ByteArray data)
Return the content of the certificate without ending zerolong
getID()
Return the id of the certificatePTEID_Certificate
getIssuer()
Return the issuer certificate.
if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrownjava.lang.String
getIssuerName()
Return the name of the issuer of the certificatelong
getKeyLength()
Return the length of public/private key on the certificatejava.lang.String
getLabel()
Return the label of the certificatejava.lang.String
getOwnerName()
Return the name of the owner of the certificatejava.lang.String
getSerialNumber()
Return the serial number of the certificatePTEID_CertifStatus
getStatus()
Return OCSP/CRL validation statusPTEID_CertifStatus
getStatus(boolean useCache, boolean validateChain)
OCSP/CRL validation status
java.lang.String
getSubjectSerialNumber()
Return the serial number of the subject of the certificatePTEID_CertifType
getType()
Return the type of the certificatejava.lang.String
getValidityBegin()
Return the validity begin date of the certificatejava.lang.String
getValidityEnd()
Return the validity end date of the certificateboolean
isFromCard()
This certificate comes from the card.boolean
isFromPteidValidChain()
Return true if the certificate chain end by the one of pteid root.boolean
isRoot()
Return true if this is a root certificate.boolean
isTest()
Return the test status.
boolean
verifyDateValidity()
Return true if the current time is between the certificate's notBefore and notAfter
-
-
-
Method Detail
-
delete
public void delete()
- Overrides:
delete
in classPTEID_Object
-
getLabel
public java.lang.String getLabel() throws PTEID_Exception
Return the label of the certificate- Throws:
PTEID_Exception
-
getID
public long getID() throws PTEID_Exception
Return the id of the certificate- Throws:
PTEID_Exception
-
getType
public PTEID_CertifType getType() throws PTEID_Exception
Return the type of the certificate- Throws:
PTEID_Exception
-
getCertData
public PTEID_ByteArray getCertData() throws PTEID_Exception
Return the content of the certificate- Throws:
PTEID_Exception
-
getFormattedData
public void getFormattedData(PTEID_ByteArray data)
Return the content of the certificate without ending zero
-
getSerialNumber
public java.lang.String getSerialNumber() throws PTEID_Exception
Return the serial number of the certificate- Throws:
PTEID_Exception
-
getOwnerName
public java.lang.String getOwnerName() throws PTEID_Exception
Return the name of the owner of the certificate- Throws:
PTEID_Exception
-
getSubjectSerialNumber
public java.lang.String getSubjectSerialNumber()
Return the serial number of the subject of the certificate
-
getIssuerName
public java.lang.String getIssuerName() throws PTEID_Exception
Return the name of the issuer of the certificate- Throws:
PTEID_Exception
-
getValidityBegin
public java.lang.String getValidityBegin() throws PTEID_Exception
Return the validity begin date of the certificate- Throws:
PTEID_Exception
-
getValidityEnd
public java.lang.String getValidityEnd() throws PTEID_Exception
Return the validity end date of the certificate- Throws:
PTEID_Exception
-
getKeyLength
public long getKeyLength() throws PTEID_Exception
Return the length of public/private key on the certificate- Throws:
PTEID_Exception
-
getStatus
public PTEID_CertifStatus getStatus()
Return OCSP/CRL validation status
-
getStatus
public PTEID_CertifStatus getStatus(boolean useCache, boolean validateChain)
OCSP/CRL validation status
- Parameters:
useCache
- boolean that specifies if cached certificates can be utilized for the validation (default true)validateChain
- boolean that specifies if the entire certificate chain is to be validated or not (default true)
-
isRoot
public boolean isRoot() throws PTEID_Exception
Return true if this is a root certificate.- Throws:
PTEID_Exception
-
isTest
public boolean isTest()
Return the test status.
- Returns:
- true if test certificate
-
isFromPteidValidChain
public boolean isFromPteidValidChain() throws PTEID_Exception
Return true if the certificate chain end by the one of pteid root.- Throws:
PTEID_Exception
-
isFromCard
public boolean isFromCard() throws PTEID_Exception
This certificate comes from the card.- Throws:
PTEID_Exception
-
verifyDateValidity
public boolean verifyDateValidity()
Return true if the current time is between the certificate's notBefore and notAfter
-
getIssuer
public PTEID_Certificate getIssuer() throws PTEID_Exception
Return the issuer certificate.
if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrown- Throws:
PTEID_Exception
-
countChildren
public long countChildren() throws PTEID_Exception
Return the number of children for this certificate.- Throws:
PTEID_Exception
-
getChildren
public PTEID_Certificate getChildren(long ulIndex) throws PTEID_Exception
Return the children certificate (certificate that has been issued by this one).
- Parameters:
ulIndex
- is the children index (the index for the first child is 0)
Throw PTEID_ExParamRange exception if the index is out of range- Throws:
PTEID_Exception
-
-