be.cardon.cryptoapi
Class CAPIStore

java.lang.Object
  extended by be.cardon.cryptoapi.CAPIStore
All Implemented Interfaces:
java.lang.Iterable<CAPICertificate>

public class CAPIStore
extends java.lang.Object
implements java.lang.Iterable<CAPICertificate>

High level class for the CryptoAPI HCERTSTORE certificate store handle.


Constructor Summary
CAPIStore(int address)
          Creates a new instance of CAPIStore, with the given CryptoAPI HCERTSTORE store handle.
 
Method Summary
 java.util.Iterator<CAPICertificate> iterator()
          Iterates all the certificates in this store.
 java.util.Iterator<CAPICertificate> iteratorWithPrivateKey()
           
static CAPIStore openCAStore()
          Opens the 'CA' store.
static CAPIStore openMyStore()
          Opens the 'My' store.
static CAPIStore openRootStore()
          Opens the 'Root' store.
static CAPIStore openStore(int lpszStoreProvider, int dwMsgAndCertEncodingType, int hCryptProv, int dwFlags, int pvPara)
          Open a store with the given parameters (see CryptoAPI documentation in MSDN).
static CAPIStore openStore(java.lang.String storeName)
          Opens a store with the given name (CERT_STORE_PROV_SYSTEM and CERT_SYSTEM_STORE_CURRENT_USER.
static CAPIStore openTrustStore()
          Opens the 'Trust' store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CAPIStore

public CAPIStore(int address)
Creates a new instance of CAPIStore, with the given CryptoAPI HCERTSTORE store handle.

Method Detail

iterator

public java.util.Iterator<CAPICertificate> iterator()
Iterates all the certificates in this store.

Specified by:
iterator in interface java.lang.Iterable<CAPICertificate>

iteratorWithPrivateKey

public java.util.Iterator<CAPICertificate> iteratorWithPrivateKey()

openStore

public static CAPIStore openStore(int lpszStoreProvider,
                                  int dwMsgAndCertEncodingType,
                                  int hCryptProv,
                                  int dwFlags,
                                  int pvPara)
                           throws CryptoAPIException
Open a store with the given parameters (see CryptoAPI documentation in MSDN). TO DO: check that the store exist (now : create an new empty store).

Throws:
CryptoAPIException

openStore

public static CAPIStore openStore(java.lang.String storeName)
                           throws CryptoAPIException
Opens a store with the given name (CERT_STORE_PROV_SYSTEM and CERT_SYSTEM_STORE_CURRENT_USER. case insensitive (ROOT = root = Root...)

Throws:
CryptoAPIException

openMyStore

public static CAPIStore openMyStore()
                             throws CryptoAPIException
Opens the 'My' store.

Throws:
CryptoAPIException

openRootStore

public static CAPIStore openRootStore()
                               throws CryptoAPIException
Opens the 'Root' store.

Throws:
CryptoAPIException

openCAStore

public static CAPIStore openCAStore()
                             throws CryptoAPIException
Opens the 'CA' store.

Throws:
CryptoAPIException

openTrustStore

public static CAPIStore openTrustStore()
                                throws CryptoAPIException
Opens the 'Trust' store.

Throws:
CryptoAPIException