|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.crypto.CertPath
public class CertPath
Stores a certification path with all included certificates.
| Field Summary | |
|---|---|
static int |
ERROR_BASIC_CONSTRAINTS_IS_CA
|
static int |
ERROR_BASIC_CONSTRAINTS_IS_NO_CA
|
static int |
ERROR_BASIC_CONSTRAINTS_PATH_TOO_LONG
|
static int |
ERROR_KEY_USAGE
|
static int |
ERROR_REVOCATION
|
static int |
ERROR_UNKNOWN_CRITICAL_EXTENSION
|
static int |
ERROR_VALIDITY
|
static int |
ERROR_VALIDITY_SEVERE
|
static int |
ERROR_VERIFICATION
|
private static long |
GRACE_PERIOD
|
private java.util.Vector |
m_certificates
the included certificates |
private int |
m_documentType
the certificate class of the certs that may verify this CertPath |
private int |
m_errorPosition
|
private int |
m_pathError
|
private boolean |
m_rootFound
true if the last cert is a root cert |
private boolean |
m_valid
true if the CertPath has valid format (not timely valid!!) |
private long |
m_verificationTime
time when the CertPath was verified for the last time |
private boolean |
m_verified
inicates if the CertPath was verified within the last VERIFICATION_INTERVAL |
static int |
NO_ERRORS
|
private static int |
VERIFICATION_INTERVAL
|
static java.lang.String |
XML_ATTR_CLASS
|
static java.lang.String |
XML_ATTR_TYPE
|
static java.lang.String |
XML_ELEMENT_NAME
|
| Fields inherited from interface anon.util.IXMLEncodable |
|---|
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION |
| Constructor Summary | |
|---|---|
protected |
CertPath(org.w3c.dom.Element a_elemCertPath)
|
private |
CertPath(JAPCertificate a_firstCert,
int a_documentType)
Creates a new CertPath Object from a given Certificate |
| Method Summary | |
|---|---|
private void |
appendCertificate(JAPCertificate a_certificate)
Adds a certificate to next higher level of this CertPath, if the cert is not already included |
private void |
build(java.util.Vector a_pathCertificates)
|
private boolean |
buildAndValidate(java.util.Vector a_pathCertificates)
|
boolean |
checkValidity(java.util.Date a_date)
Checks the validity of all certificates in the path. |
private static JAPCertificate |
doNameAndKeyChaining(JAPCertificate a_cert,
java.util.Vector a_possibleIssuers,
boolean a_bAllowSelfSigned)
Tries to find a possible verifier for the given cert from the given Vector of certs by comparing the cert's subject with the issuer of the possible verifiers. |
private void |
findVerifier()
|
protected java.util.Vector |
getCertificates()
|
private static int |
getCertType(int a_documentClass)
|
private static int |
getDocumentTypeFromRootCertType(int a_rootCertType)
Only for backwards compatibility. |
int |
getErrorCode()
|
int |
getErrorPosition()
|
JAPCertificate |
getFirstCertificate()
Returns the certificate from the lowest Level of this CertPath (the one that was added at first). |
static CertPath |
getInstance(JAPCertificate a_firstCert,
int a_documentType,
java.util.Vector a_pathCertificates)
|
JAPCertificate |
getLastCertificate()
Returns the top level certificate (it is the one that was last added) |
CertPathInfo |
getPathInfo()
|
private static int |
getRootCertType(int a_documentClass)
Sets the certificate class for the root certificates that can verify this Cert Path. |
static CertPath |
getRootInstance(JAPCertificate a_rootCert)
|
JAPCertificate |
getSecondCertificate()
Returns the certificate from the second lowest Level of this CertPath (the one that was added at Second). |
private static boolean |
isPossiblyValid(JAPCertificate a_firstCert,
java.util.Vector a_pathCertificates)
Checks if it may be possible to build a (timely) valid CertPath from the given certificates. |
boolean |
isValidPath()
|
protected boolean |
isVerifier(JAPCertificate a_certificate)
|
int |
length()
Returns the number of certificates in this CertPath |
private void |
removeLastCertificate()
|
protected void |
resetVerification()
Creates an Enumeration of CertificateInfoStructures of the included certs. |
java.lang.String |
toString()
Creates a human readable List in String-Format using the CommonNames of the included certs. |
org.w3c.dom.Element |
toXmlElement(org.w3c.dom.Document a_doc)
Return an element that can be appended to the document. |
private int |
validate(JAPCertificate a_cert,
int a_position,
JAPCertificate a_issuer)
|
boolean |
verify()
Tries to verify the top level certificate in this CertPath against the root certificates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String XML_ELEMENT_NAME
public static final java.lang.String XML_ATTR_CLASS
public static final java.lang.String XML_ATTR_TYPE
public static final int NO_ERRORS
public static final int ERROR_VERIFICATION
public static final int ERROR_VALIDITY
public static final int ERROR_REVOCATION
public static final int ERROR_UNKNOWN_CRITICAL_EXTENSION
public static final int ERROR_BASIC_CONSTRAINTS_IS_CA
public static final int ERROR_BASIC_CONSTRAINTS_IS_NO_CA
public static final int ERROR_BASIC_CONSTRAINTS_PATH_TOO_LONG
public static final int ERROR_KEY_USAGE
public static final int ERROR_VALIDITY_SEVERE
private static final int VERIFICATION_INTERVAL
private static final long GRACE_PERIOD
private int m_documentType
private java.util.Vector m_certificates
private boolean m_rootFound
private boolean m_valid
private boolean m_verified
private long m_verificationTime
private int m_pathError
private int m_errorPosition
| Constructor Detail |
|---|
private CertPath(JAPCertificate a_firstCert,
int a_documentType)
firstCert - The first certificate of the path
(it will be on the lowest level of the cert hierarchy)
protected CertPath(org.w3c.dom.Element a_elemCertPath)
throws XMLParseException
XMLParseException| Method Detail |
|---|
public static CertPath getRootInstance(JAPCertificate a_rootCert)
public static CertPath getInstance(JAPCertificate a_firstCert,
int a_documentType,
java.util.Vector a_pathCertificates)
a_firstCert - a_documentType - a_pathCertificates -
private static boolean isPossiblyValid(JAPCertificate a_firstCert,
java.util.Vector a_pathCertificates)
true the first cert has to be
valid an at least one of the path certs, too.
a_firstCert - the certificate to verifya_pathCertificates - the possible path certificates
true if it is generally possible to build a (timely)
valid CertPathprivate boolean buildAndValidate(java.util.Vector a_pathCertificates)
private void build(java.util.Vector a_pathCertificates)
private void findVerifier()
private static JAPCertificate doNameAndKeyChaining(JAPCertificate a_cert,
java.util.Vector a_possibleIssuers,
boolean a_bAllowSelfSigned)
a_cert - the cert to find the issuer fora_possibleIssuers - a vector of certs to search fot the issuera_AllowSelfSigned - true if a verification with a self-signed certificate is allowed; false otherwise
Warning: may lead to an endless loop if not explicitly used in a self signed context!
null if there was none
private int validate(JAPCertificate a_cert,
int a_position,
JAPCertificate a_issuer)
public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
IXMLEncodable
toXmlElement in interface IXMLEncodablea_doc - a document
private void appendCertificate(JAPCertificate a_certificate)
a_certificate - the certificate to addprivate void removeLastCertificate()
public JAPCertificate getLastCertificate()
public JAPCertificate getFirstCertificate()
public JAPCertificate getSecondCertificate()
private static int getRootCertType(int a_documentClass)
a_documentClass - a document class from the SignatureVerifieranon.crypto.SignatureVerifier.getVerifiedXml()private static int getDocumentTypeFromRootCertType(int a_rootCertType)
a_rootCertType -
private static int getCertType(int a_documentClass)
public boolean checkValidity(java.util.Date a_date)
a_date - the date for which the validity of the path is tested
protected boolean isVerifier(JAPCertificate a_certificate)
public boolean verify()
public int length()
protected void resetVerification()
public java.lang.String toString()
toString in class java.lang.Objectpublic CertPathInfo getPathInfo()
public boolean isValidPath()
protected java.util.Vector getCertificates()
public int getErrorCode()
public int getErrorPosition()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||