001/*
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2013 ForgeRock AS. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * http://forgerock.org/license/CDDLv1.0.html
013 * See the License for the specific language governing
014 * permission and limitations under the License.
015 *
016 * When distributing Covered Code, include this CDDL
017 * Header Notice in each file and include the License file
018 * at http://forgerock.org/license/CDDLv1.0.html
019 * If applicable, add the following below the CDDL Header,
020 * with the fields enclosed by brackets [] replaced by
021 * your own identifying information:
022 * "Portions Copyrighted [year] [name of copyright owner]"
023 */
024
025package org.forgerock.audit.secure;
026
027import java.security.KeyStore;
028
029/**
030 * Handles the access to a KeyStore.
031 */
032public interface KeyStoreHandler {
033
034    /**
035     * Get the keystore.
036     *
037     * @return the keystore.
038     */
039    public KeyStore getStore();
040
041    /**
042     * Sets the keystore.
043     *
044     * @param keystore
045     *          The keystore to use
046     * @throws Exception
047     *          If an error occurs
048     */
049    public void setStore(KeyStore keystore) throws Exception;
050
051    /**
052     * Returns the password.
053     *
054     * @return the password used to access the keystore
055     */
056    public String getPassword();
057
058    /**
059     * Returns the path to the keystore.
060     *
061     * @return the path
062     */
063    public String getLocation();
064
065    /**
066     * Returns the type of the keystore.
067     *
068     * @return the keystore type
069     */
070    public String getType();
071
072    /**
073     * Saves the keystore.
074     *
075     * @throws Exception
076     *          If an error occurs.
077     */
078    public void store() throws Exception;
079}