Coverage Report - org.openpermis.cert.CertificateVerifier
 
Classes in this File Line Coverage Branch Coverage Complexity
CertificateVerifier
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.InvalidKeyException;
 13  
 import java.security.NoSuchAlgorithmException;
 14  
 import java.security.NoSuchProviderException;
 15  
 import java.security.SignatureException;
 16  
 import java.security.cert.Certificate;
 17  
 import java.security.cert.CertificateException;
 18  
 
 19  
 /**
 20  
  * Verifies certificates (instances of {@link Certificate}, e.g. attribute 
 21  
  * certificates or user certificates).
 22  
  * 
 23  
  * How a certificate is verified depends on the implementation.
 24  
  * @since 0.3.0
 25  
  */
 26  
 public interface CertificateVerifier {
 27  
 
 28  
         //---- Methods
 29  
         /**
 30  
          * Verifies the specified certificate and returns without exception if the certificate
 31  
          * could successfully be verified.
 32  
          * 
 33  
          * @param certificate The certificate to be verified. Must not be <code>null</code>.
 34  
          * @throws CertificateException Thrown on certificate encoding errors.
 35  
          * @throws NoSuchAlgorithmException Thrown on unsupported signature algorithms.
 36  
          * @throws InvalidKeyException Thrown on incorrect keys.
 37  
          * @throws NoSuchProviderException Thrown on incorrect crypto provider usage.
 38  
          * @throws SignatureException Thrown on incorrect signatures.
 39  
          * @since 0.3.0
 40  
          */
 41  
         public void verifyCertificate (Certificate certificate) 
 42  
                 throws  
 43  
                         CertificateException,
 44  
                         NoSuchAlgorithmException,
 45  
                         InvalidKeyException,
 46  
                         NoSuchProviderException,
 47  
                         SignatureException;
 48  
 }