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 AdvancedSignaturesignatureThe signature to build identifier for -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSignatureIdentifierBuilder(AdvancedSignature signature)The default constructor -
Method Summary
Modifier and Type Method Description SignatureIdentifierbuild()BuildsSignatureIdentifierfor the providedAdvancedSignatureprotected byte[]buildBinaries()Builds unique binary data describing the signature objectprotected abstract ObjectgetCounterSignaturePosition(AdvancedSignature masterSignature)Returns a current counter signature position in its master signatureprotected StringgetPositionId()Returns Id repesenting a current signature position in a file, considering its pre-siblings, master signatures when presentprotected abstract ObjectgetSignatureFilePosition()Returns a position of a signature in the provided fileprotected voidwriteSignaturePosition(ByteArrayOutputStream baos)Writes the current signature position between other signature entries on the same levelprotected voidwriteSignedProperties(ByteArrayOutputStream baos)Write signed properties of a signature to the givenByteArrayOutputStreamprotected voidwriteString(ByteArrayOutputStream baos, String str)The method used to write astrintobaos
-
Field Details
-
signature
The signature to build identifier for
-
-
Constructor Details
-
AbstractSignatureIdentifierBuilder
The default constructor- Parameters:
signature-AdvancedSignature
-
-
Method Details
-
build
BuildsSignatureIdentifierfor the providedAdvancedSignature- Specified by:
buildin 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-ByteArrayOutputStreamto enrich with the basic signature parameters- Throws:
IOException- if in exception has been thrown
-
writeString
The method used to write astrintobaos- Parameters:
baos-ByteArrayOutputStreamto 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-ByteArrayOutputStreamto 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:
Stringposition id
-
getCounterSignaturePosition
Returns a current counter signature position in its master signature- Parameters:
masterSignature-AdvancedSignatureto analyze- Returns:
- counter signature position
-
getSignatureFilePosition
Returns a position of a signature in the provided file- Returns:
- signature position in a file
-