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.servicemix.jbi.security.keystore;
018    
019    import java.security.KeyStoreException;
020    import java.security.NoSuchAlgorithmException;
021    import java.security.PrivateKey;
022    import java.security.UnrecoverableKeyException;
023    import java.security.cert.Certificate;
024    
025    import javax.net.ssl.KeyManager;
026    import javax.net.ssl.TrustManager;
027    
028    /**
029     * Based on http://svn.apache.org/repos/asf/geronimo/trunk/modules/management/
030     *              src/java/org/apache/geronimo/management/geronimo/KeystoreInstance.java
031     * 
032     * @version $Rev: $ $Date: $
033     */
034    public interface KeystoreInstance {
035    
036        String getName();
037    
038        String[] listPrivateKeys();
039    
040        String[] listTrustCertificates();
041    
042        Certificate getCertificate(String alias);
043    
044        String getCertificateAlias(Certificate cert);
045    
046        Certificate[] getCertificateChain(String alias);
047    
048        PrivateKey getPrivateKey(String alias);
049    
050        boolean isKeystoreLocked();
051    
052        boolean isKeyLocked(String keyAlias);
053    
054        KeyManager[] getKeyManager(String algorithm, String keyAlias) throws NoSuchAlgorithmException, 
055                                    UnrecoverableKeyException, KeyStoreException, KeystoreIsLocked, KeystoreIsLocked;
056    
057        TrustManager[] getTrustManager(String algorithm) throws KeyStoreException, NoSuchAlgorithmException, KeystoreIsLocked;
058    
059    }