anon.crypto
Class CertificateStore
java.lang.Object
java.util.Observable
anon.crypto.CertificateStore
- All Implemented Interfaces:
- IXMLEncodable
public class CertificateStore
- extends java.util.Observable
- implements IXMLEncodable
Implementation remark: The locking order (to avoid deadlocks) in this class is:
1. this
2. m_trustedCertificates
DO NEVER EVER synchronize on m_trustedCertificates IF YOU DO NOT OWN A LOCK on this!
Method Summary |
private void |
activateAllDependentCertificates(JAPCertificate a_certificate)
|
int |
addCertificateWithoutVerification(CertPath a_certPath,
int a_certificateType,
boolean a_onlyHardRemovable,
boolean a_bNotRemovable)
|
int |
addCertificateWithoutVerification(JAPCertificate a_certificate,
int a_certificateType,
boolean a_onlyHardRemovable,
boolean a_bNotRemovable)
|
int |
addCertificateWithVerification(CertPath a_certificate,
int a_certificateType,
boolean a_onlyHardRemovable)
|
private void |
deactivateAllDependentCertificates(JAPCertificate a_certificate)
|
java.util.Vector |
getAllCertificates()
|
java.util.Vector |
getAvailableCertificatesByType(int a_certificateType)
|
private java.lang.String |
getCertificateId(JAPCertificate a_certificate,
int a_certificateType)
|
CertificateInfoStructure |
getCertificateInfoStructure(JAPCertificate a_certificate)
|
CertificateInfoStructure |
getCertificateInfoStructure(JAPCertificate a_certificate,
int a_certificateType)
|
private int |
getNextAvailableLockId()
|
java.util.Vector |
getUnavailableCertificatesByType(int a_certificateType)
|
static java.lang.String |
getXmlSettingsRootNodeName()
|
void |
loadSettingsFromXml(org.w3c.dom.Element a_trustedCertificatesNode)
|
void |
removeAllCertificates()
Removes all but the not removable certs from the store |
void |
removeCertificate(CertificateInfoStructure a_certificateStructure)
|
void |
removeCertificateLock(int a_lockId)
|
void |
reset()
|
void |
setEnabled(CertificateInfoStructure a_certificateStructure,
boolean a_enabled)
|
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.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XML_ELEMENT_NAME
public static final java.lang.String XML_ELEMENT_NAME
- Stores the name of the root node of the XML settings for this class.
- See Also:
- Constant Field Values
m_trustedCertificates
private java.util.Hashtable m_trustedCertificates
m_lockTable
private java.util.Hashtable m_lockTable
m_lockIdPointer
private int m_lockIdPointer
CertificateStore
public CertificateStore()
- Creates a new certificate store.
getXmlSettingsRootNodeName
public static java.lang.String getXmlSettingsRootNodeName()
getAllCertificates
public java.util.Vector getAllCertificates()
getUnavailableCertificatesByType
public java.util.Vector getUnavailableCertificatesByType(int a_certificateType)
getCertificateInfoStructure
public CertificateInfoStructure getCertificateInfoStructure(JAPCertificate a_certificate,
int a_certificateType)
getCertificateInfoStructure
public CertificateInfoStructure getCertificateInfoStructure(JAPCertificate a_certificate)
getAvailableCertificatesByType
public java.util.Vector getAvailableCertificatesByType(int a_certificateType)
addCertificateWithVerification
public int addCertificateWithVerification(CertPath a_certificate,
int a_certificateType,
boolean a_onlyHardRemovable)
addCertificateWithoutVerification
public int addCertificateWithoutVerification(JAPCertificate a_certificate,
int a_certificateType,
boolean a_onlyHardRemovable,
boolean a_bNotRemovable)
addCertificateWithoutVerification
public int addCertificateWithoutVerification(CertPath a_certPath,
int a_certificateType,
boolean a_onlyHardRemovable,
boolean a_bNotRemovable)
removeCertificateLock
public void removeCertificateLock(int a_lockId)
removeCertificate
public void removeCertificate(CertificateInfoStructure a_certificateStructure)
removeAllCertificates
public void removeAllCertificates()
- Removes all but the not removable certs from the store
reset
public void reset()
setEnabled
public void setEnabled(CertificateInfoStructure a_certificateStructure,
boolean a_enabled)
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
loadSettingsFromXml
public void loadSettingsFromXml(org.w3c.dom.Element a_trustedCertificatesNode)
activateAllDependentCertificates
private void activateAllDependentCertificates(JAPCertificate a_certificate)
deactivateAllDependentCertificates
private void deactivateAllDependentCertificates(JAPCertificate a_certificate)
getNextAvailableLockId
private int getNextAvailableLockId()
getCertificateId
private java.lang.String getCertificateId(JAPCertificate a_certificate,
int a_certificateType)