Class AbstractSignatureIdentifierBuilder
java.lang.Object
eu.europa.esig.dss.spi.signature.identifier.AbstractSignatureIdentifierBuilder
- All Implemented Interfaces:
IdentifierBuilder,SignatureIdentifierBuilder,Serializable
- Direct Known Subclasses:
CAdESSignatureIdentifierBuilder,JAdESSignatureIdentifierBuilder,PAdESSignatureIdentifierBuilder,XAdESSignatureIdentifierBuilder
public abstract class AbstractSignatureIdentifierBuilder
extends Object
implements SignatureIdentifierBuilder
The abstract SignatureIdentifier builder
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AdvancedSignatureThe signature to build identifier for -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedThe default constructor -
Method Summary
Modifier and TypeMethodDescriptionbuild()BuildsSignatureIdentifierfor the providedAdvancedSignatureprotected byte[]Builds unique binary data describing the signature objectprotected abstract ObjectgetCounterSignaturePosition(AdvancedSignature masterSignature) Returns a current counter signature position in its master signatureprotected StringReturns Id representing a current signature position in a file, considering its pre-siblings, master signatures when presentprotected ObjectThis method returns a position of a signature file NOTE: this method returns a signature filename for ASiC containers, empty string for othersprotected abstract ObjectReturns a position of a signature in the provided fileprotected voidWrites the current signature position between other signature entries on the same levelprotected voidWrite 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 interfaceIdentifierBuilder- 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
-
getCounterSignaturePosition
Returns a current counter signature position in its master signature- Parameters:
masterSignature-AdvancedSignatureto 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
-