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