All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.digidoc4j.ddoc.factory.TrustServiceFactory Maven / Gradle / Ivy

Go to download

DDoc4J is Java Library for validating DDOC documents. It's not recommended to use it directly but rather through DigiDoc4J's API.

The newest version!
package org.digidoc4j.ddoc.factory;

import org.digidoc4j.ddoc.DigiDocException;

import java.security.cert.X509Certificate;
import java.util.Date;

/**
 * Interface for TSL
 * @author  Veiko Sinivee
 * @version 1.0
 */
public interface TrustServiceFactory {

    /**
     * initializes the implementation class
     */
    void init()
            throws DigiDocException;

    /**
     * Finds direct CA cert for given user cert
     * @param cert user cert
     * @param bUseLocal use also ca certs registered in local config file
     * @return CA cert or null if not found
     * @deprecated use findCaForCert(X509Certificate cert, boolean bUseLocal, Date dtSigning)
     */
    X509Certificate findCaForCert(X509Certificate cert, boolean bUseLocal);

    /**
     * Finds direct CA cert for given user cert
     * @param cert user cert
     * @param bUseLocal use also ca certs registered in local config file
     * @param dtSigning signing timestamp. Used to pick correct ca if many of them apply
     * @return CA cert or null if not found
     */
    X509Certificate findCaForCert(X509Certificate cert, boolean bUseLocal, Date dtSigning);

    /**
     * Finds direct OCSP cert for given ocsp responder id
     * @param cn OCSP responder-id
     * @param bUseLocal use also ca certs registered in local config file
     * @param serialNr serial number or NULL
     * @return OCSP cert or null if not found
     */
    X509Certificate[] findOcspsByCNAndNr(String cn, boolean bUseLocal, String serialNr);

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy