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