Package eu.europa.esig.dss.validation
Class AbstractSignatureIdentifierBuilder
java.lang.Object
eu.europa.esig.dss.validation.AbstractSignatureIdentifierBuilder
- All Implemented Interfaces:
SignatureIdentifierBuilder
- Direct Known Subclasses:
CAdESSignatureIdentifierBuilder
,JAdESSignatureIdentifierBuilder
,PAdESSignatureIdentifierBuilder
,XAdESSignatureIdentifierBuilder
public abstract class AbstractSignatureIdentifierBuilder
extends Object
implements SignatureIdentifierBuilder
The abstract SignatureIdentifier builder
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AdvancedSignature
The signature to build identifier for -
Constructor Summary
ModifierConstructorDescriptionprotected
The default constructor -
Method Summary
Modifier and TypeMethodDescriptionbuild()
BuildsSignatureIdentifier
for the providedAdvancedSignature
protected byte[]
Builds unique binary data describing the signature objectprotected abstract Object
getCounterSignaturePosition
(AdvancedSignature masterSignature) Returns a current counter signature position in its master signatureprotected String
Returns Id representing a current signature position in a file, considering its pre-siblings, master signatures when presentprotected Object
This method returns a position of a signature file NOTE: this method returns a signature filename for ASiC containers, empty string for othersprotected abstract Object
Returns a position of a signature in the provided fileprotected void
Writes the current signature position between other signature entries on the same levelprotected void
Write signed properties of a signature to the givenByteArrayOutputStream
protected void
writeString
(ByteArrayOutputStream baos, String str) The method used to write astr
intobaos
-
Field Details
-
signature
The signature to build identifier for
-
-
Constructor Details
-
AbstractSignatureIdentifierBuilder
The default constructor- Parameters:
signature
-AdvancedSignature
-
-
Method Details
-
build
BuildsSignatureIdentifier
for the providedAdvancedSignature
- Specified by:
build
in interfaceSignatureIdentifierBuilder
- Returns:
SignatureIdentifier
-
buildBinaries
protected byte[] buildBinaries()Builds unique binary data describing the signature object- Returns:
- a byte array
-
writeSignedProperties
Write signed properties of a signature to the givenByteArrayOutputStream
- Parameters:
baos
-ByteArrayOutputStream
to enrich with the basic signature parameters- Throws:
IOException
- if in exception has been thrown
-
writeString
The method used to write astr
intobaos
- Parameters:
baos
-ByteArrayOutputStream
to write String intostr
-String
- Throws:
IOException
- if in exception occurs
-
writeSignaturePosition
Writes the current signature position between other signature entries on the same level- Parameters:
baos
-ByteArrayOutputStream
to add data to- Throws:
IOException
- if an exception occurs
-
getPositionId
Returns Id representing a current signature position in a file, considering its pre-siblings, master signatures when present- Returns:
String
position id
-
getCounterSignaturePosition
Returns a current counter signature position in its master signature- Parameters:
masterSignature
-AdvancedSignature
to analyze- Returns:
- counter signature position
-
getSignaturePosition
Returns a position of a signature in the provided file- Returns:
- signature position in a file
-
getSignatureFilePosition
This method returns a position of a signature file NOTE: this method returns a signature filename for ASiC containers, empty string for others- Returns:
- signature file position
-