public abstract class AbstractXmlSignatureService extends Object implements SignatureService
Constructor and Description |
---|
AbstractXmlSignatureService(DigestAlgo digestAlgo)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSignatureFacet(SignatureFacet signatureFacet)
Adds a signature facet to this XML signature service.
|
protected String |
getCanonicalizationMethod() |
protected Document |
getEnvelopingDocument()
Gives back the enveloping document.
|
protected String |
getSignatureDescription()
Gives back the human-readable description of what the citizen will be
signing.
|
protected DigestAlgo |
getSignatureDigestAlgorithm()
Gives back the signature digest algorithm.
|
protected abstract OutputStream |
getSignedDocumentOutputStream()
Gives back the output stream to which to write the signed XML document.
|
protected abstract TemporaryDataStorage |
getTemporaryDataStorage()
Gives back a temporary data storage component.
|
protected URIDereferencer |
getURIDereferencer()
Override this method to change the URI dereferener used by the signing
engine.
|
protected Document |
loadDocument(InputStream documentInputStream) |
protected Document |
loadDocumentNoClose(InputStream documentInputStream) |
void |
postSign(byte[] signatureValue,
List<X509Certificate> signingCertificateChain) |
DigestInfo |
preSign(List<DigestInfo> digestInfos,
List<X509Certificate> signingCertificateChain,
IdentityDTO identity,
AddressDTO address,
byte[] photo) |
protected void |
setSignatureId(String signatureId)
Sets the signature Id attribute value used to create the XML signature.
|
protected void |
setSignatureNamespacePrefix(String signatureNamespacePrefix)
Sets the XML Signature namespace prefix to be used for signature
creation.
|
protected void |
writeDocument(Document document,
OutputStream documentOutputStream) |
protected void |
writeDocumentNoClosing(Document document,
OutputStream documentOutputStream) |
protected void |
writeDocumentNoClosing(Document document,
OutputStream documentOutputStream,
boolean omitXmlDeclaration) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFilesDigestAlgorithm
public AbstractXmlSignatureService(DigestAlgo digestAlgo)
protected void setSignatureId(String signatureId)
null
value will trigger an automatically generated signature
Id.signatureId
- protected void setSignatureNamespacePrefix(String signatureNamespacePrefix)
null
value will omit the prefixing.signatureNamespacePrefix
- protected void addSignatureFacet(SignatureFacet signatureFacet)
signatureFacet
- protected DigestAlgo getSignatureDigestAlgorithm()
protected Document getEnvelopingDocument() throws ParserConfigurationException, IOException, SAXException
null
in case
ds:Signature should be the top-level element. Implementations can
override this method to provide a custom enveloping document.SAXException
IOException
ParserConfigurationException
protected URIDereferencer getURIDereferencer()
protected String getSignatureDescription()
protected abstract TemporaryDataStorage getTemporaryDataStorage()
protected abstract OutputStream getSignedDocumentOutputStream()
public DigestInfo preSign(List<DigestInfo> digestInfos, List<X509Certificate> signingCertificateChain, IdentityDTO identity, AddressDTO address, byte[] photo) throws NoSuchAlgorithmException
preSign
in interface SignatureService
NoSuchAlgorithmException
public void postSign(byte[] signatureValue, List<X509Certificate> signingCertificateChain)
postSign
in interface SignatureService
protected String getCanonicalizationMethod()
protected void writeDocument(Document document, OutputStream documentOutputStream) throws TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException, IOException
protected void writeDocumentNoClosing(Document document, OutputStream documentOutputStream) throws TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException, IOException
protected void writeDocumentNoClosing(Document document, OutputStream documentOutputStream, boolean omitXmlDeclaration) throws TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException, IOException
protected Document loadDocument(InputStream documentInputStream) throws ParserConfigurationException, SAXException, IOException
protected Document loadDocumentNoClose(InputStream documentInputStream) throws ParserConfigurationException, SAXException, IOException
Copyright © 2008-2018 FedICT. All Rights Reserved.