Coverage Report - org.openpermis.cert.CertificateRepository
 
Classes in this File Line Coverage Branch Coverage Complexity
CertificateRepository
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport
 3  
  *                     (http://www.vbs.admin.ch)
 4  
  * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch)
 5  
  * All rights reserved.
 6  
  *
 7  
  * Licensed under the Open Permis License which accompanies this distribution,
 8  
  * and is available at http://www.openpermis.org/BSDlicenceKent.txt
 9  
  */
 10  
 package org.openpermis.cert;
 11  
 
 12  
 import java.security.cert.CRL;
 13  
 import java.security.cert.CRLSelector;
 14  
 import java.security.cert.CertSelector;
 15  
 import java.security.cert.CertStoreException;
 16  
 import java.security.cert.Certificate;
 17  
 import java.util.Collection;
 18  
 
 19  
 /**
 20  
  * A certificate repository is a class that can be asked certificates or CRLs (certificate 
 21  
  * revocation lists) given certain search criteria.
 22  
  * 
 23  
  * This interface offers the same functionality as the JCE class 
 24  
  * {@link java.security.cert.CertStore} but - unlike the latter - can be implemented by a class in
 25  
  * the case the used crypto provider does not offer the required functionality. 
 26  
  * 
 27  
  * @since 0.3.0
 28  
  */
 29  
 public interface CertificateRepository {
 30  
 
 31  
         /** 
 32  
          * Returns a collection of Certificates that match the specified selector. If no 
 33  
          * Certificates match the selector, an empty Collection is returned.
 34  
          * 
 35  
          * @param selector A {@link CertSelector}used to select which certificates should be returned.
 36  
          * @return A collection of certificates that match the specified selector.
 37  
          * @throws CertStoreException Thrown if an exception occurs.
 38  
          * @since 0.3.0
 39  
          */
 40  
         Collection<? extends Certificate> getCertificates (CertSelector selector) 
 41  
                 throws CertStoreException;
 42  
         
 43  
         /**
 44  
          * Returns a collection of CRLs that match the specified selector. If no CRLs match the 
 45  
          * selector, an empty Collection is returned.
 46  
          *  
 47  
          * @param selector A {@link CRLSelector} used to select which CRLs should be returned.
 48  
          * @return A collection of CRLs that match the specified selector.
 49  
          * @throws CertStoreException Thrown if an exception occurs.
 50  
          * @since 0.3.0
 51  
          */
 52  
         Collection<? extends CRL> getCrls (CRLSelector selector) throws CertStoreException;
 53  
         
 54  
 }