/*
 * Copyright 2014
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.digitalpetri.opcua.stack.core.application;

import java.security.KeyPair;
import java.security.cert.X509Certificate;
import java.util.Optional;
import java.util.Set;

import com.digitalpetri.opcua.stack.core.types.builtin.ByteString;

public interface CertificateManager {

    Optional<KeyPair> getKeyPair(ByteString thumbprint);

    Optional<X509Certificate> getCertificate(ByteString thumbprint);

    Set<KeyPair> getKeyPairs();

    Set<X509Certificate> getCertificates();

    Set<X509Certificate> getTrustList();

    Set<X509Certificate> getAuthorityList();

    void certificateRejected(X509Certificate certificate);

}

@@ -871,297 +871,1512 @@
     
-Optional%3CKeyPair%3E getKeyPair(ByteString thumbprint);%0A%0A    Optional%3CX509Certificate%3E getCertificate(ByteString thumbprint);%0A%0A    Set%3CKeyPair%3E getKeyPairs();%0A%0A    Set%3CX509Certificate%3E getCertificates();%0A%0A    Set%3CX509Certificate%3E getTrustList();%0A%0A    Set%3CX509Certificate%3E getAuthorityList();%0A
+/**%0A     * Get the %7B@link KeyPair%7D belonging to the certificate identified by %7B@code thumbprint%7D.%0A     * %3Cp%3E%0A     * %7B@code thumbprint%7D is a SHA1 hash of the encoded certificate.%0A     *%0A     * @param thumbprint the thumbprint of the certificate.%0A     * @return the %7B@link KeyPair%7D belonging to the certificate identified by %7B@code thumbprint%7D.%0A     */%0A    Optional%3CKeyPair%3E getKeyPair(ByteString thumbprint);%0A%0A    /**%0A     * Get the %7B@link X509Certificate%7D identified by %7B@code thumbprint%7D.%0A     * %3Cp%3E%0A     * %7B@code thumbprint%7D is a SHA1 hash of the encoded certificate.%0A     *%0A     * @param thumbprint the thumbprint of the certificate.%0A     * @return the %7B@link X509Certificate%7D identified by %7B@code thumbprint%7D.%0A     */%0A    Optional%3CX509Certificate%3E getCertificate(ByteString thumbprint);%0A%0A    /**%0A     * @return the Set of all managed %7B@link KeyPair%7Ds.%0A     */%0A    Set%3CKeyPair%3E getKeyPairs();%0A%0A    /**%0A     * @return the Set of all managed %7B@link X509Certificate%7Ds.%0A     */%0A    Set%3CX509Certificate%3E getCertificates();%0A%0A    /**%0A     * @return the Set of trusted %7B@link X509Certificate%7Ds.%0A     */%0A    Set%3CX509Certificate%3E getTrustList();%0A%0A    /**%0A     * @return the Set of trusted authority %7B@link X509Certificate%7Ds.%0A     */%0A    Set%3CX509Certificate%3E getAuthorityList();%0A%0A    /**%0A     * Handle a rejected certificate.%0A     * %3Cp%3E%0A     * One course of action is to quarantine it so a user can later move it to the trusted list.%0A     *%0A     * @param certificate the rejected %7B@link X509Certificate%7D.%0A     */
 %0A   

Add Javadoc to CertificateManager