/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.xwiki.crypto.store;

import java.util.Collection;

import org.xwiki.component.annotation.Role;
import org.xwiki.crypto.pkix.CertificateProvider;
import org.xwiki.crypto.pkix.params.CertifiedPublicKey;
import org.xwiki.stability.Unstable;

/**
 * Store and retrieve certificates of entities and provide certificates for chain verification.
 *
 * @version $Id$
 * @since 6.1M2
 */
@Role
@Unstable
public interface CertificateStore
{
    /**
     * Store a certificate into a certificate store.
     *
     * @param store the reference of a document or a space where the certificate should be stored.
     * @param certificate the certificate to store.
     * @throws CertificateStoreException on error.
     */
    void store(StoreReference store, CertifiedPublicKey certificate) throws CertificateStoreException;

    /**
     * Return a certificate provider providing from the given certificate store.
     *
     * @param store the reference of a document or a space where the certificate are stored.
     * @return a certificate provider.
     * @throws CertificateStoreException on error.
     */
    CertificateProvider getCertificateProvider(StoreReference store) throws CertificateStoreException;

    /**
     * Return all the certificates available in a certificate store.
     *
     * @param store the reference of a document or a space where the certificate are stored.
     * @return a collection of certificates.
     * @throws CertificateStoreException on error.
     */
    Collection<CertifiedPublicKey> getAllCertificates(StoreReference store) throws CertificateStoreException;
}

@@ -1436,36 +1436,24 @@
 ence of 
-a document or a spac
+the stor
 e where 
@@ -1479,19 +1479,18 @@
 uld be s
-tor
+av
 ed.%0A    
@@ -1833,36 +1833,24 @@
 ence of 
-a document or a spac
+the stor
 e where 
@@ -1861,32 +1861,37 @@
 certificate 
-are stor
+should be sav
 ed.%0A     * @
@@ -2209,28 +2209,16 @@
  of 
-a document or a spac
+the stor
 e wh
@@ -2241,16 +2241,21 @@
 ate 
-are stor
+should be sav
 ed.%0A

Move the KeyStore and CertificateStore API from platform