|
IAIK TSP version 2.32 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object demo.tsp.config.TspServerConfiguration
public class TspServerConfiguration
This demo class provides the configuration of a TspServer.
The server configuration is read from file ServerConfiguration.properties
that has to reside somewhere in the classpath.
The following configuration settings may be specified:
Accuracy
field in the TimeStampResp
should be set or not (default)
Accuracy
field shall be set)
Accuracy
field shall be set)
Accuracy
field shall be set)
PKCS12URL
or PKCS12FILE
options may be used when the
TSA key/cert shall be read from a PKCS#12 file. e.g.:
PKCS12URL=timeStampCert.p12 PKCS12PWD=topSecretor
PKCS12FILE=D:/TSA/key/timeStampCert.p12 PKCS12PWD=topSecretThe
KS_URL
and KS_FILE
options also can be used to read TSA key/cert
from a PKCS#12 file but also allow to use alternative Java KeyStore formats (e.g. "IAIKKeyStore",
"JKS", "IAIKKeyStore", "PKCS11KeyStore",... .
For instance:
KS_FILE=D:/TSA/key/timeStampCert.p12 KS_PWD=topSecret KS_ALIAS=demo-tsa KS_TYPE=PKCS12 KS_PROVIDER=IAIKor (for accessing a HSM key by using the IAIK PKCS11Provider)
KS_FILE=eTPkcs11.dll KS_PWD=112233 KS_ALIAS=demo-tsa KS_TYPE=PKCS11KeyStoreIf
KS_ALIAS
is not specified the KeyStore is searched for a key/certificate that
is appropriate to be used for TimeStamp signing (contains a critical ExtendedKeyUsagae
extension with key purpose id timeStamping
as required by RFC 3161). If the certificate
contains a KeyUsage
extension this method also checks if the KeyUsage
extension makes the certificate eligible for signing, i.e. if the digitalSignature
or
nonRepudiation
key usage bits are set.
Field Summary | |
---|---|
static java.lang.String |
ConfigurationURL
Default Configuration URL. |
protected static org.apache.commons.logging.Log |
log
The logger for this class. |
Constructor Summary | |
---|---|
TspServerConfiguration()
Default constructor |
Method Summary | |
---|---|
Accuracy |
getAccuracy()
Returns the Accuracy . |
boolean |
getAddSha1CertID()
Returns whether to also include SHA-1 ESSCertID if ESSCertIDv2 is used with another hash algorithm. |
AlgorithmID |
getHashAlgorithm()
Returns the hash algorithm to be used for signing. |
int |
getMaxTimeOut()
Returns the time out of the socket. |
ObjectID |
getObjectID()
Returns the ObjectID . |
java.security.PrivateKey |
getPrivateKey()
Returns the PrivateKey . |
int |
getServerPort()
Returns the port. |
AlgorithmID |
getSignatureAlgorithm()
Returns the signature algorithm to be used for signing. |
X509Certificate[] |
getTSACertChain()
Returns the certificate chain of the TSA containing the TSA cert at index 0. |
void |
loadConfiguration(java.lang.String url)
Loads the configuration from the specified URL . |
boolean |
setAccuracy()
Returns whether the Accuracy in the TimeStampResp should be set or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ConfigurationURL
protected static org.apache.commons.logging.Log log
Constructor Detail |
---|
public TspServerConfiguration()
Method Detail |
---|
public void loadConfiguration(java.lang.String url) throws java.io.IOException, TspServerConfigurationException
URL
.
url
- The URL
of the property file. If this parameter is
null
the default location (ServerConfiguration.properties) will be used.
java.io.IOException
- Thrown if the specified property is not in the classpath.
TspServerConfigurationException
- Thrown if the PKCS#12 file could not be found or decrypted.public java.security.PrivateKey getPrivateKey()
PrivateKey
.
PrivateKey
.public ObjectID getObjectID()
ObjectID
.
ObjectID
.public X509Certificate[] getTSACertChain()
public int getServerPort()
public boolean setAccuracy()
Accuracy
in the TimeStampResp
should be set or not.
Accuracy
should be set otherwise false.public Accuracy getAccuracy()
Accuracy
.
Accuracy
.public AlgorithmID getHashAlgorithm()
AlgorithmID
.public AlgorithmID getSignatureAlgorithm()
AlgorithmID
. Maybe null
(in this case
the signature algorithm is calculated from the hash algorithm and the key algorithm).public boolean getAddSha1CertID()
true
to add SHA-2 ESSCertID if ESSCertIDv2
is used with another hash algorithm,
false
to not add SHA-1 ESSCertIDpublic int getMaxTimeOut()
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |