Package xades4j.utils

Class FileSystemDirectoryCertStore

java.lang.Object
xades4j.utils.FileSystemDirectoryCertStore

public class FileSystemDirectoryCertStore extends Object
Creates a CertStore from the contents of a file-system directory. The directories are recusively searched for X509 certificates or CRLs files that have one of the specified extensions. If the JCE provider is not supplied, the CertificateFactory is obtained without specifying a provider.
Author:
Luís
  • Constructor Details

    • FileSystemDirectoryCertStore

      public FileSystemDirectoryCertStore(String dirPath) throws CertificateException, CRLException
      Creates a new instance over a directory. The cer and crt extesions are considered for certificates and crl for CRLs.
      Parameters:
      dirPath - the path for the base directory
      Throws:
      CertificateException - if there's an error reading the certificates
      CRLException - if there's an error reading the CRLs
    • FileSystemDirectoryCertStore

      public FileSystemDirectoryCertStore(String dirPath, String[] certsFilesExts, String[] crlsFilesExts) throws CertificateException, CRLException
      Creates a new instance over a directory using the specified extensions
      Parameters:
      dirPath - the path for the base directory
      certsFilesExts - extensions for included certificate files
      crlsFilesExts - extensions for included CRL files
      Throws:
      CertificateException - if there's an error reading the certificates
      CRLException - if there's an error reading the CRLs
    • FileSystemDirectoryCertStore

      public FileSystemDirectoryCertStore(String dirPath, String certFactoryProvider) throws CertificateException, CRLException, NoSuchProviderException
      Creates a new instance over a directory using the specified JCE provider. The cer and crt extesions are considered for certificates and crl for CRLs.
      Parameters:
      dirPath - the path for the base directory
      certFactoryProvider - the JCE provider for the CertificateFactory used to generate certificates and CRLs
      Throws:
      CertificateException - if there's an error reading the certificates
      CRLException - if there's an error reading the CRLs
      NoSuchProviderException - if certFactoryProvider doesn't exist
    • FileSystemDirectoryCertStore

      public FileSystemDirectoryCertStore(String dirPath, String[] certsFilesExts, String[] crlsFilesExts, String certFactoryProvider) throws CertificateException, CRLException, NoSuchProviderException
      Creates a new instance over a directory using the specified extensions and JCE provider.
      Parameters:
      dirPath - the path for the base directory
      certsFilesExts - extensions for included certificate files
      crlsFilesExts - extensions for included CRL files
      certFactoryProvider - the JCE provider for the CertificateFactory used to generate certificates and CRLs
      Throws:
      CertificateException - if there's an error reading the certificates
      CRLException - if there's an error reading the CRLs
      NoSuchProviderException - if certFactoryProvider doesn't exist
    • FileSystemDirectoryCertStore

      protected FileSystemDirectoryCertStore(String dirPath, String[] certsFilesExts, String[] crlsFilesExts, CertificateFactory cf) throws CertificateException, CRLException
      Creates a new instance over a directory using the specified extensions
      Parameters:
      dirPath - the path for the base directory
      certsFilesExts - extensions for included certificate files
      crlsFilesExts - extensions for included CRL files
      Throws:
      CertificateException - if there's an error reading the certificates
      CRLException - if there's an error reading the CRLs
  • Method Details

    • getStore

      public CertStore getStore()
      Gets the CertStore resulting from this instance.
      Returns:
      the CertStore containing all the certificates and CRLs that were found