0

我尝试在DSS Demo Webapp. 该演示默认使用虚拟时间戳源。我发现它是在 dss.properties 文件中定义的。

# TSA
tsp-source = classpath:config/tsp-config.xml

我检查了tsp-config.xml,但它只包含身份验证证书详细信息,而不是服务的 URL,应该替换它。我修改了xml文件如下:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">

    <bean id="passwordProtection" class="java.security.KeyStore.PasswordProtection">
        <constructor-arg name="password" value="ks-password" />
    </bean>

    <bean id="tsa-token" class="eu.europa.esig.dss.token.KeyStoreSignatureTokenConnection">
        <constructor-arg name="ksFile" type="java.io.File" value="classpath:myAuthCert.p12" />
        <constructor-arg name="ksType" value="PKCS12" />
        <constructor-arg name="ksPassword" ref="myAuthCertPass" />
    </bean>

    <bean id="tspSource" class="eu.europa.esig.dss.x509.tsp.MockTSPSource">
        <property name="dataLoader" ref="timestampDataLoader" />
        <property name="tspServer" value="myTSPSourceURL" />
        <property name="token" ref="tsa-token" />
        <property name="alias" value="self-signed-tsa" />
    </bean>

    <bean id="timestampDataLoader" class="eu.europa.esig.dss.client.http.commons.TimestampDataLoader">
        <property name="proxyConfig" ref="proxyConfig" />
    </bean>
</beans>

我也找到了一些关于OnlineTSPSource类的信息,但在源代码中找不到它,并且不确定如何进行身份验证。

4

0 回答 0