public class DetachedXadesSignatureBuilder extends Object
Constructor and Description |
---|
DetachedXadesSignatureBuilder() |
Modifier and Type | Method and Description |
---|---|
DataToSign |
buildDataToSign()
Creates data to be signed externally.
|
Signature |
finalizeSignature(byte[] signatureValue) |
Signature |
invokeSigning()
Invokes a signing process on the container with a signature token (See
SignatureToken ). |
Signature |
openAdESSignature(byte[] signatureDocument)
Creates signature object from XadES signature xml.
|
DetachedXadesSignatureBuilder |
withCity(String cityName)
Set a city to the signature production place.
|
static DetachedXadesSignatureBuilder |
withConfiguration(Configuration configuration)
Specify configuration for the builder.
|
DetachedXadesSignatureBuilder |
withCountry(String country)
Set a country name to the signature production place.
|
DetachedXadesSignatureBuilder |
withDataFile(DataFile dataFile)
Add a data file to builder.
|
DetachedXadesSignatureBuilder |
withDataFileDigestAlgorithm(DigestAlgorithm digestAlgorithm)
Set signature digest algorithm used to generate a signature.
|
DetachedXadesSignatureBuilder |
withEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm)
Set encryption algorithm to be used in the signing process.
|
DetachedXadesSignatureBuilder |
withOwnSignaturePolicy(eu.europa.esig.dss.model.Policy signaturePolicy)
Set signature policy parameters.
|
DetachedXadesSignatureBuilder |
withPostalCode(String postalCode)
Set a postal code to the signature production place.
|
DetachedXadesSignatureBuilder |
withRoles(String... roles)
Set roles to the signer.
|
DetachedXadesSignatureBuilder |
withSignatureDigestAlgorithm(DigestAlgorithm digestAlgorithm)
Set signature digest algorithm used to generate a signature.
|
DetachedXadesSignatureBuilder |
withSignatureId(String signatureId)
Set signature ID.
|
DetachedXadesSignatureBuilder |
withSignatureProfile(SignatureProfile signatureProfile)
Set a signature profile: Time Stamp, Archive Time Stamp or no profile.
|
DetachedXadesSignatureBuilder |
withSignatureToken(SignatureToken signatureToken)
Set signature token to be used in the signing process.
|
DetachedXadesSignatureBuilder |
withSigningCertificate(X509Certificate certificate)
Set a signing certificate to be used when creating data to be signed.
|
DetachedXadesSignatureBuilder |
withStateOrProvince(String stateOrProvince)
Set a state or province to the signature production place.
|
public static DetachedXadesSignatureBuilder withConfiguration(Configuration configuration)
configuration
- configuration to be used for creating the signature.public DetachedXadesSignatureBuilder withDataFile(DataFile dataFile)
dataFile
- data file to be added to the builder.public DetachedXadesSignatureBuilder withSigningCertificate(X509Certificate certificate)
certificate
- X509 signer's certificate.public DetachedXadesSignatureBuilder withSignatureDigestAlgorithm(DigestAlgorithm digestAlgorithm)
digestAlgorithm
- signature digest algorithm.public DetachedXadesSignatureBuilder withDataFileDigestAlgorithm(DigestAlgorithm digestAlgorithm)
digestAlgorithm
- signature digest algorithm.public DetachedXadesSignatureBuilder withCity(String cityName)
cityName
- city to use on the signature production place.public DetachedXadesSignatureBuilder withStateOrProvince(String stateOrProvince)
stateOrProvince
- name of the state or province on the signature production place.public DetachedXadesSignatureBuilder withPostalCode(String postalCode)
postalCode
- postal code on the signature production place.public DetachedXadesSignatureBuilder withCountry(String country)
country
- name of the country on the signature production place.public DetachedXadesSignatureBuilder withRoles(String... roles)
roles
- list of roles of a signer.public DetachedXadesSignatureBuilder withSignatureId(String signatureId)
signatureId
- signature id.public DetachedXadesSignatureBuilder withEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm)
encryptionAlgorithm
- encryption algorithm.public DetachedXadesSignatureBuilder withSignatureProfile(SignatureProfile signatureProfile)
signatureProfile
- signature profile.public DetachedXadesSignatureBuilder withOwnSignaturePolicy(eu.europa.esig.dss.model.Policy signaturePolicy)
The default implementation throws NotSupportedException
.
signaturePolicy
- with defined parameters.public DetachedXadesSignatureBuilder withSignatureToken(SignatureToken signatureToken)
signatureToken
- signature token.public DataToSign buildDataToSign() throws SignerCertificateRequiredException, DataFileMissingException
If the signing process involves signing the container externally (e.g. signing in the Web by a browser plugin),
then DataToSign
provides necessary data for creating a signature externally.
SignerCertificateRequiredException
- signer certificate must be provided using
withSigningCertificate(X509Certificate)
DataFileMissingException
- builder must have at least one data file to be signed.public Signature finalizeSignature(byte[] signatureValue)
public Signature invokeSigning() throws SignatureTokenMissingException
SignatureToken
).
Signature token must be provided with withSignatureToken(SignatureToken)
.SignatureTokenMissingException
- if signature token is not provided with
withSignatureToken(SignatureToken)
SignatureToken
public Signature openAdESSignature(byte[] signatureDocument)
signatureDocument
- XadES signature xml bytes.Copyright © 2024. All rights reserved.