Package pt.gov.cartaodecidadao
Class PTEID_Certificate
java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_Certificate
Class that represents one certificate.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final longstatic final long -
Method Summary
Modifier and TypeMethodDescriptionlongReturn the number of children for this certificate.voiddelete()Return the content of the certificategetChildren(long ulIndex) Return the children certificate (certificate that has been issued by this one).
voidReturn the content of the certificate without padding zeroslonggetID()Return the id of the certificateReturn the issuer certificate.
if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrownReturn the name of the issuer of the certificatelongReturn the length of public/private key on the certificategetLabel()Return the label of the certificateReturn the name of the owner of the certificateReturn the serial number of the certificateReturn OCSP/CRL validation statusgetStatus(boolean useCache, boolean validateChain) OCSP/CRL validation status
Return the serial number of the subject of the certificategetType()Return the type of the certificateReturn the validity begin date of the certificateReturn the validity end date of the certificatebooleanThis certificate comes from the card.booleanReturn true if the certificate chain end by the one of pteid root.booleanisRoot()Return true if this is a root certificate.booleanisTest()Return the test status.
booleanReturn true if the current time is between the certificate's notBefore and notAfter
-
Field Details
-
CITIZEN_AUTH
public static final long CITIZEN_AUTH -
CITIZEN_SIGN
public static final long CITIZEN_SIGN -
SUB_CA_SIGN
public static final long SUB_CA_SIGN -
SUB_CA_AUTH
public static final long SUB_CA_AUTH
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classPTEID_Object
-
getLabel
Return the label of the certificate- Throws:
PTEID_Exception
-
getID
Return the id of the certificate- Throws:
PTEID_Exception
-
getType
Return the type of the certificate- Throws:
PTEID_Exception
-
getCertData
Return the content of the certificate- Throws:
PTEID_Exception
-
getFormattedData
Return the content of the certificate without padding zeros -
getSerialNumber
Return the serial number of the certificate- Throws:
PTEID_Exception
-
getOwnerName
Return the name of the owner of the certificate- Throws:
PTEID_Exception
-
getSubjectSerialNumber
Return the serial number of the subject of the certificate -
getIssuerName
Return the name of the issuer of the certificate- Throws:
PTEID_Exception
-
getValidityBegin
Return the validity begin date of the certificate- Throws:
PTEID_Exception
-
getValidityEnd
Return the validity end date of the certificate- Throws:
PTEID_Exception
-
getKeyLength
Return the length of public/private key on the certificate- Throws:
PTEID_Exception
-
getStatus
Return OCSP/CRL validation status -
getStatus
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
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
Return true if the certificate chain end by the one of pteid root.- Throws:
PTEID_Exception
-
isFromCard
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
Return the issuer certificate.
if there is no issuer (root), PTEID_ExCertNoIssuer exception is thrown- Throws:
PTEID_Exception
-
countChildren
Return the number of children for this certificate.- Throws:
PTEID_Exception
-
getChildren
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
-