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
Fields Modifier and Type Field Description protected AdvancedSignature
signature
The signature to build identifier for -
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSignatureIdentifierBuilder(AdvancedSignature signature)
The default constructor -
Method Summary
Modifier and Type Method Description SignatureIdentifier
build()
BuildsSignatureIdentifier
for the providedAdvancedSignature
protected byte[]
buildBinaries()
Builds unique binary data describing the signature objectprotected abstract Object
getCounterSignaturePosition(AdvancedSignature masterSignature)
Returns a current counter signature position in its master signatureprotected String
getPositionId()
Returns Id repesenting a current signature position in a file, considering its pre-siblings, master signatures when presentprotected abstract Object
getSignatureFilePosition()
Returns a position of a signature in the provided fileprotected void
writeSignaturePosition(ByteArrayOutputStream baos)
Writes the current signature position between other signature entries on the same levelprotected void
writeSignedProperties(ByteArrayOutputStream baos)
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 repesenting 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
-
getSignatureFilePosition
Returns a position of a signature in the provided file- Returns:
- signature position in a file
-