anon.crypto
Class MultiCertPath

java.lang.Object
  extended by anon.crypto.MultiCertPath
All Implemented Interfaces:
IXMLEncodable

public class MultiCertPath
extends java.lang.Object
implements IXMLEncodable

This class takes an array of CertPaths that is associated with a signed XML Document. A MultiCertPath is considered valid an verified if ONE CertPath in it is both.

Author:
zenoxx

Field Summary
private  CertPath[] m_certPaths
           
private  int m_documentType
           
private  X509DistinguishedName m_issuer
           
private  X509DistinguishedName m_subject
           
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 MultiCertPath(CertPath[] a_certPaths, int a_documentType)
           
 
Method Summary
 int countPaths()
          Returns the number of CertPaths in this MultCertPath
 int countVerifiedAndValidPaths()
          Returns the number of paths that are verified and timely valid.
 int countVerifiedPaths()
          Returns the number of verified CertPaths in this MultCertPath
 java.util.Vector getEndEntityKeys()
          Gets all successfully verified end entity Keys from this MultiCertPath.
 CertPath getFirstVerifiedPath()
          Gets the first verified CertPath of this MultiCertPath.
 X509DistinguishedName getIssuer()
          Returns this MultiCertPaths Issuer which is the same for all end-entity certs
 int getMaxLength()
           
 CertPath getPath()
          Tries to return the first verified CertPath.
 CertPathInfo[] getPathInfos()
           
 java.util.Vector getPaths()
          Returns all CertPath objects, no matter if verified or not.
 X509DistinguishedName getSubject()
          Returns this MultiCertPath's Subject which is the same for all end-entity certs
 boolean isValid(java.util.Date a_date)
          Returns true if one verifiable path is valid or in case there is no verifiable path, one unverifiable path is valid
 boolean isVerified()
          At the moment we try to find a single verifiable CertPath and return true if there is one, or if signature verification is disabled.
private  boolean needsVerification()
          Check if the documentType that is associated with this MultiCertPath needs signature verification.
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_ELEMENT_NAME

public static final java.lang.String XML_ELEMENT_NAME
See Also:
Constant Field Values

m_certPaths

private CertPath[] m_certPaths

m_subject

private X509DistinguishedName m_subject

m_issuer

private X509DistinguishedName m_issuer

m_documentType

private int m_documentType
Constructor Detail

MultiCertPath

protected MultiCertPath(CertPath[] a_certPaths,
                        int a_documentType)
Method Detail

isValid

public boolean isValid(java.util.Date a_date)
Returns true if one verifiable path is valid or in case there is no verifiable path, one unverifiable path is valid

Parameters:
a_date -
Returns:
if a MultiCertPath is valid for the time in question

needsVerification

private boolean needsVerification()
Check if the documentType that is associated with this MultiCertPath needs signature verification.

Returns:
true if the MultiCertPath has to be verified

isVerified

public boolean isVerified()
At the moment we try to find a single verifiable CertPath and return true if there is one, or if signature verification is disabled.

Returns:
if this MultiCertPath is verified

getPath

public CertPath getPath()
Tries to return the first verified CertPath. If there is none the first (unverified) Path is returned.

Returns:

getPaths

public java.util.Vector getPaths()
Returns all CertPath objects, no matter if verified or not.

Returns:

getFirstVerifiedPath

public CertPath getFirstVerifiedPath()
Gets the first verified CertPath of this MultiCertPath.

Returns:
the first verified CertPath or null if there is none

getEndEntityKeys

public java.util.Vector getEndEntityKeys()
Gets all successfully verified end entity Keys from this MultiCertPath. Used by the KeyExchangeManager to verifiy the signature of the symmetric Key

Returns:
all verified end-entity-keys
See Also:
KeyExchangeManager

getSubject

public X509DistinguishedName getSubject()
Returns this MultiCertPath's Subject which is the same for all end-entity certs

Returns:
this MultiCertPath's Subject

getIssuer

public X509DistinguishedName getIssuer()
Returns this MultiCertPaths Issuer which is the same for all end-entity certs

Returns:
this MultiCertPaths Issuer

countPaths

public int countPaths()
Returns the number of CertPaths in this MultCertPath

Returns:
the number of CertPaths in this MultCertPath

countVerifiedPaths

public int countVerifiedPaths()
Returns the number of verified CertPaths in this MultCertPath

Returns:
the number of verified CertPaths in this MultCertPath

countVerifiedAndValidPaths

public int countVerifiedAndValidPaths()
Returns the number of paths that are verified and timely valid. The return value is at least 1 if at least one verified path exists, no matter whether any of the paths is valid or not.

Returns:
the number of paths that are verified and timely valid

getMaxLength

public int getMaxLength()

getPathInfos

public CertPathInfo[] getPathInfos()

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Description copied from interface: IXMLEncodable
Return an element that can be appended to the document. This Method must not change the document in any way!

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element