KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > internal > provisional > verifier > CertificateVerifier


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.osgi.internal.provisional.verifier;
12
13 import java.security.SignatureException JavaDoc;
14 import java.security.cert.*;
15
16 /**
17  * A certificate verifier is used to verify the authenticity of a signed
18  * repository. A certificate verifier is created using a
19  * {@link CertificateVerifierFactory}.
20  * <p>
21  * <strong>EXPERIMENTAL</strong>. This class or interface has been added as
22  * part of a work in progress. There is no guarantee that this API will
23  * work or that it will remain the same. Please do not use this API without
24  * consulting with the equinox team.
25  * </p>
26  */

27 public interface CertificateVerifier {
28     /**
29      * Verify the content of the repository.
30      *
31      * @throws CertificateException
32      * @throws CertificateExpiredException
33      * @throws CertificateParsingException
34      * @throws SignatureException
35      */

36     public void checkContent() throws CertificateException, CertificateExpiredException, SignatureException JavaDoc;
37
38     /**
39      * Verifies the content of the repository. An array is returned with the entry names
40      * which are corrupt. If no entries are corrupt then an empty array is returned.
41      * @return An array of entry names which are corrupt. An empty array is returned if the
42      * repository is not corrupt or if the repository is not signed.
43      */

44     public String JavaDoc[] verifyContent();
45
46     /**
47      * Returns true if the repository is signed
48      * @return true if the repository is signed
49      */

50     public boolean isSigned();
51
52     /**
53      * Returns all certificate chains of the repository. All certificate chains
54      * are returned whether they are trusted or not. If the repository is not signed
55      * then an empty array is returned.
56      * @return all certificate chains of the repository
57      */

58     public CertificateChain[] getChains();
59 }
60
Popular Tags