public class

Enveloped

extends Object
java.lang.Object
   ↳ xades4j.production.Enveloped

Class Overview

Utility class to create enveloped signature. Enveloped signatures are ones whose Signature element is child of the resource being signed. An appropriate transform has to be used in these scenarios to exclude the signature element from its own processing. This class is just an helper for those situations.

Summary

Public Constructors
Enveloped(XadesSigner signer)
Creates a new instance based on the given XadesSigner.
Public Methods
void sign(Element elementToSign)
Creates an enveloped signature over an element.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Enveloped (XadesSigner signer)

Creates a new instance based on the given XadesSigner.

Parameters
signer the signer to be used by the resulting instance

Public Methods

public void sign (Element elementToSign)

Creates an enveloped signature over an element. The element must have an Id or be the document root if it doesn't. In the last case an empty (URI="") reference is used.

Parameters
elementToSign the element that will be signed and will be the signature's parent
Throws
XAdES4jException see sign(xades4j.production.SignedDataObjects, org.w3c.dom.Node)
IllegalArgumentException if elementToSign doesn't have an Id and isn't the document root