public class SignatureConfig extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SignatureConfig.CRLEntry |
| Modifier and Type | Field and Description |
|---|---|
static String |
SIGNATURE_TIME_FORMAT |
| Constructor and Description |
|---|
SignatureConfig() |
public static final String SIGNATURE_TIME_FORMAT
public void addSignatureFacet(SignatureFacet signatureFacet)
signatureFacet - the signature facet is appended to facet listpublic List<SignatureFacet> getSignatureFacets()
public void setSignatureFacets(List<SignatureFacet> signatureFacets)
signatureFacets - the new list of facetspublic HashAlgorithm getDigestAlgo()
public void setDigestAlgo(HashAlgorithm digestAlgo)
digestAlgo - the main digest algorithmpublic PrivateKey getKey()
public void setKey(PrivateKey key)
key - the private keypublic List<X509Certificate> getSigningCertificateChain()
public void setSigningCertificateChain(List<X509Certificate> signingCertificateChain)
signingCertificateChain - the certificate chain, index 0 should be
the certificate matching the private keypublic Date getExecutionTime()
public void setExecutionTime(Date executionTime)
executionTime - sets the time at which the document ought to be signedpublic String formatExecutionTime()
SIGNATURE_TIME_FORMAT)public void setExecutionTime(String executionTime)
SIGNATURE_TIME_FORMAT)executionTime - the execution timepublic SignaturePolicyService getSignaturePolicyService()
public void setSignaturePolicyService(SignaturePolicyService signaturePolicyService)
signaturePolicyService - the service to be used for XAdES-EPES properties@Deprecated @Removal(version="5.0.0") public URIDereferencer getUriDereferencer()
SignatureInfo.getUriDereferencer() insteadOOXMLURIDereferencer@Deprecated @Removal(version="5.0.0") public void setUriDereferencer(URIDereferencer uriDereferencer)
SignatureInfo.setUriDereferencer(URIDereferencer) insteaduriDereferencer - the dereferencer used for Reference/@URI attributespublic String getSignatureDescription()
public void setSignatureDescription(String signatureDescription)
signatureDescription - the human-readable description of
what the citizen will be signing.public byte[] getSignatureImage()
public byte[] getSignatureImageValid()
public byte[] getSignatureImageInvalid()
public ClassID getSignatureImageSetupId()
public void setSignatureImageSetupId(ClassID signatureImageSetupId)
public void setSignatureImage(byte[] signatureImage)
public void setSignatureImageValid(byte[] signatureImageValid)
public void setSignatureImageInvalid(byte[] signatureImageInvalid)
public String getCanonicalizationMethod()
public void setCanonicalizationMethod(String canonicalizationMethod)
canonicalizationMethod - the default canonicalization methodpublic String getPackageSignatureId()
public void setPackageSignatureId(String packageSignatureId)
packageSignatureId - The signature Id attribute value used to create the XML signature.
A null value will trigger an automatically generated signature Id.public String getTspUrl()
public void setTspUrl(String tspUrl)
tspUrl - the url of the timestamp provider (TSP)public boolean isTspOldProtocol()
public void setTspOldProtocol(boolean tspOldProtocol)
tspOldProtocol - defines the timestamp-protocol mimetypeisTspOldProtocol()public HashAlgorithm getTspDigestAlgo()
public void setTspDigestAlgo(HashAlgorithm tspDigestAlgo)
tspDigestAlgo - the algorithm to be used for the timestamp entry.
if null, the hash algorithm of the main entrypublic String getProxyUrl()
public void setProxyUrl(String proxyUrl)
proxyUrl - the proxy url to be used for all communications.
Currently this affects the timestamp servicepublic TimeStampService getTspService()
TSPTimeStampServicepublic void setTspService(TimeStampService tspService)
tspService - the timestamp servicepublic TimeStampHttpClient getTspHttpClient()
public void setTspHttpClient(TimeStampHttpClient tspHttpClient)
tspHttpClient - the http client used for timestamp server connectionspublic String getTspUser()
public void setTspUser(String tspUser)
tspUser - the user id for the timestamp service - currently only basic authorization is supportedpublic String getTspPass()
public void setTspPass(String tspPass)
tspPass - the password for the timestamp servicepublic TimeStampServiceValidator getTspValidator()
public void setTspValidator(TimeStampServiceValidator tspValidator)
tspValidator - the validator for the timestamp service (certificate)public RevocationDataService getRevocationDataService()
null the signature will be limited to XAdES-T only.public void setRevocationDataService(RevocationDataService revocationDataService)
revocationDataService - the optional revocation data service used for XAdES-C and XAdES-X-L.
When null the signature will be limited to XAdES-T only.public HashAlgorithm getXadesDigestAlgo()
getDigestAlgo()public void setXadesDigestAlgo(HashAlgorithm xadesDigestAlgo)
xadesDigestAlgo - hash algorithm used for XAdES.
When null, defaults to getDigestAlgo()public void setXadesDigestAlgo(String xadesDigestAlgo)
xadesDigestAlgo - hash algorithm used for XAdES.
When null, defaults to getDigestAlgo()public String getUserAgent()
public void setUserAgent(String userAgent)
userAgent - the user agent used for http communication (e.g. to the TSP)public String getTspRequestPolicy()
1.3.6.1.4.1.13762.3public void setTspRequestPolicy(String tspRequestPolicy)
tspRequestPolicy - the asn.1 object id for the tsp request policy.public boolean isIncludeEntireCertificateChain()
public void setIncludeEntireCertificateChain(boolean includeEntireCertificateChain)
includeEntireCertificateChain - if true, include the whole certificate chain.
If false, only include the signer certpublic boolean isIncludeIssuerSerial()
public void setIncludeIssuerSerial(boolean includeIssuerSerial)
includeIssuerSerial - if true, issuer serial number is includedpublic boolean isIncludeKeyValue()
public void setIncludeKeyValue(boolean includeKeyValue)
includeKeyValue - if true, the key value of the public key (certificate) is includedpublic String getXadesRole()
null the claimed role element is omitted.
Defaults to nullpublic void setXadesRole(String xadesRole)
xadesRole - the xades role element. If null the claimed role element is omitted.public String getXadesSignatureId()
idSignedPropertiespublic void setXadesSignatureId(String xadesSignatureId)
xadesSignatureId - the Id for the XAdES SignedProperties element.
When null defaults to idSignedPropertiespublic boolean isXadesSignaturePolicyImplied()
truepublic void setXadesSignaturePolicyImplied(boolean xadesSignaturePolicyImplied)
xadesSignaturePolicyImplied - when true, include the policy-implied blockpublic boolean isXadesIssuerNameNoReverseOrder()
public void setXadesIssuerNameNoReverseOrder(boolean xadesIssuerNameNoReverseOrder)
xadesIssuerNameNoReverseOrder - when true, the issuer DN instead of the issuer X500 principal is usedpublic SignatureMarshalListener getSignatureMarshalListener()
SignatureMarshalListenerpublic void setSignatureMarshalListener(SignatureMarshalListener signatureMarshalListener)
signatureMarshalListener - the event listener watching the xml structure
generation for the signaturepublic Map<String,String> getNamespacePrefixes()
public void setNamespacePrefixes(Map<String,String> namespacePrefixes)
namespacePrefixes - the map of namespace uri (key) to prefix (value)public String getSignatureMethodUri()
public String getDigestMethodUri()
public static String getDigestMethodUri(HashAlgorithm digestAlgo)
digestAlgo - the digest algorithmpublic void setSignatureMethodFromUri(String signatureMethodUri)
signatureMethodUri - the method uripublic static String[] getProviderNames()
public String getXadesCanonicalizationMethod()
EXCLUSIVEpublic void setXadesCanonicalizationMethod(String xadesCanonicalizationMethod)
xadesCanonicalizationMethod - the canonicalization method for XAdES-XL signingpublic boolean isUpdateConfigOnValidate()
public void setUpdateConfigOnValidate(boolean updateConfigOnValidate)
falseupdateConfigOnValidate - if true, update config on validatepublic boolean isAllowMultipleSignatures()
public void setAllowMultipleSignatures(boolean allowMultipleSignatures)
allowMultipleSignatures - if true, the signature will be added,
otherwise all existing signatures will be replaced by the currentpublic boolean isSecureValidation()
public void setSecureValidation(boolean secureValidation)
Starting with xmlsec 2.3.0 larger documents with a lot of document parts started to fail, because a maximum of 30 references were hard-coded allowed for secure validation to succeed.
Secure validation has the following features:
public String getCommitmentType()
public void setCommitmentType(String commitmentType)
public SignatureConfig.CRLEntry addCRL(String crlURL, String certCN, byte[] crlBytes)
public List<SignatureConfig.CRLEntry> getCrlEntries()
public boolean isAllowCRLDownload()
public void setAllowCRLDownload(boolean allowCRLDownload)
public KeyStore getKeyStore()
public void addCachedCertificate(String alias, X509Certificate x509) throws KeyStoreException
alias - the alias, or null if alias is taken from common name attribute of certificatex509 - the x509 certificateKeyStoreExceptionpublic void addCachedCertificate(String alias, byte[] x509Bytes) throws KeyStoreException, CertificateException
public X509Certificate getCachedCertificateByPrinicipal(String principalName)