KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > management > geronimo > CertificateStore


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.geronimo.management.geronimo;
19
20 import java.math.BigInteger JavaDoc;
21 import java.security.cert.Certificate JavaDoc;
22
23 /**
24  * Management interface for dealing with a specific Certificate Store
25  *
26  * @version $Rev: 476291 $ $Date: 2006-11-17 15:05:24 -0500 (Fri, 17 Nov 2006) $
27  */

28 public interface CertificateStore {
29     /**
30      * This method stores a given certificate.
31      *
32      * @param cert Certificate to be stored
33      */

34     public void storeCertificate(Certificate JavaDoc cert) throws CertificateStoreException;
35
36     /**
37      * This method returns a Certificate with a given serial number (if it exists in the store)
38      *
39      * @param sNo Serial Number of the certificate to be retrieved.
40      */

41     public Certificate JavaDoc getCertificate(BigInteger JavaDoc sNo) throws CertificateStoreException;
42
43     /**
44      * This method returns base64 encoded certificate with a given serial number (if it exists in the store)
45      *
46      * @param sNo Serial Number of the certificate to be retrieved.
47      */

48     public String JavaDoc getCertificateBase64Text(BigInteger JavaDoc sNo) throws CertificateStoreException;
49
50     /**
51      * This method returns the highest certificate serial number in the store.
52      */

53     public BigInteger JavaDoc getHighestSerialNumber() throws CertificateStoreException;
54
55     /**
56      * This method returns the 'highest certificate serial number plus ONE' and increments the highest
57      * serial number in the store.
58      */

59     public BigInteger JavaDoc getNextSerialNumber() throws CertificateStoreException;
60
61     /**
62      * This method checks if a certificate with a given serial number exists in the store.
63      *
64      * @param sNo Serial number of the certificate to be checked
65      */

66     public boolean containsCertificate(BigInteger JavaDoc sNo);
67
68     /**
69      * This method stores the CA's certificate in the store.
70      * @param cert CA's certificate
71      */

72     public boolean storeCACertificate(Certificate JavaDoc cert) throws CertificateStoreException;
73
74     /**
75      * This method returns the CA's certificate stored in the store.
76      */

77     public Certificate JavaDoc getCACertificate() throws CertificateStoreException;
78
79     /**
80      * This method stores the challenge phrase against the specified certificate serial number
81      * @param sNo Serial number of the certificate
82      * @param challenge Challenge phrase
83      */

84     public boolean setCertificateChallenge(BigInteger JavaDoc sNo, String JavaDoc challenge) throws CertificateStoreException;
85 }
86
Popular Tags