001 /**
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements. See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018 package org.apache.geronimo.management.geronimo;
019
020 import java.math.BigInteger;
021
022 /**
023 * Management interface for dealing with a specific CertificateRequestStore
024 *
025 * @version $Rev: 706640 $ $Date: 2008-10-21 14:44:05 +0000 (Tue, 21 Oct 2008) $
026 */
027 public interface CertificateRequestStore {
028 /**
029 * This method returns the ids of all certificate requests in the store.
030 */
031 public String[] getAllRequestIds();
032
033 /**
034 * This method returns the ids of all certificate requests with verification due.
035 */
036 public String[] getVerificatonDueRequestIds();
037
038 /**
039 * This method returns the ids of all certificate requests that are verified.
040 */
041 public String[] getVerifiedRequestIds();
042
043 /**
044 * This method returns the certificate request text corresponding to a specified id.
045 * @param id Id of the certificate request.
046 */
047 public String getRequest(String id);
048
049 /**
050 * This method deletes a certificate request with the specified id.
051 * @param id Id of the certificate request to be deleted.
052 * @return True if the request is deleted succssfully
053 */
054 public boolean deleteRequest(String id);
055
056 /**
057 * This method stores the given certificate request under the given id. If a request with the id
058 * exists in the store, it will generate a new id and store the request under that id.
059 * @param id Id under which the certificate request is to be stored
060 * @param csrText Certificate Request text
061 * @return Id under which the certificate request is stored
062 */
063 public String storeRequest(String id, String csrText);
064
065 /**
066 * This method sets the status of the specifed certificate request as verified.
067 * @param id Id of the certificate request
068 * @return True if the status is set successfully.
069 */
070 public boolean setRequestVerified(String id);
071
072 /**
073 * This method sets the status of a certificate request as fulfilled.
074 * @param id Id of the certificate request
075 * @param sNo Serial number of the certificate issued against the certificate request.
076 * @return True if the operation is successfull.
077 */
078 public boolean setRequestFulfilled(String id, BigInteger sNo);
079
080 /**
081 * This method returns the Serial number of the certificate issued against the certificate request
082 * specified by the given id.
083 * @param id Id of the certificate request
084 * @return Serial number of the certificate issued.
085 * @return null if there is no such certificate request or the certificate request is not fulfilled.
086 */
087 public BigInteger getSerialNumberForRequest(String id);
088
089 /**
090 * This method removes the certificate request id from the status list.
091 * @param id Id of the certificate request to be removed.
092 * @param sNo Serial number of certificate issued against the certificate request whose Id is to be removed.
093 */
094 public void removeRequestStatus(String id, BigInteger sNo);
095 }