Class TbsDocument
- All Implemented Interfaces:
Serializable,Extensible
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum reprenting an ETSI AdES format.static classRepresentation of an ETSI AdES signature requirement.static classBuilder forTbsDocumentobjects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTells whether the resulting signature should use an ETSI AdES format.Gets the Base64-encoded byte string that is the content of the document that is to be signed.Gets the content reference may be used instead of supplying the actual content (setContent(String)).Returns the extension parameters for the instance.getId()Gets the unique ID for this document (within the current request).Gets the MIME type of the document that is to be signed.Gets the Optional processing rules used by the sign service to process sign data.If the document that is to be signed is a PDF document, the sign requester may require the resulting PDF to have a "visible PDF signature".voidsetAdesRequirement(TbsDocument.EtsiAdesRequirement adesRequirement) Specifies whether the resulting signature should use an ETSI AdES format.voidsetContent(String content) Assigns the Base64-encoded byte string that is the content of the document that is to be signed.voidsetContentReference(String contentReference) Assigns a content reference may be used instead of supplying the actual content (setContent(String)).voidsetExtension(Extension extension) Assigns the extension parameters for the instance.voidAssigns unique ID for this document (within the current request).voidsetMimeType(String mimeType) Assigns the MIME type of the document that is to be signed.voidsetMimeType(DocumentType documentType) Assigns The document type of the document that is to be signed.voidsetProcessingRules(String processingRules) Assigns processing rules used by the sign service to process sign data.voidsetVisiblePdfSignatureRequirement(VisiblePdfSignatureRequirement visiblePdfSignatureRequirement) If the document that is to be signed is a PDF document, the sign requester may require the resulting PDF to have a "visible PDF signature".Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface se.idsec.signservice.integration.core.Extensible
addExtensionValue, getExtensionValue
-
Constructor Details
-
TbsDocument
public TbsDocument()
-
-
Method Details
-
getId
Gets the unique ID for this document (within the current request).- Returns:
- unique ID for this document, or
nullif none has been set
-
setId
Assigns unique ID for this document (within the current request). If not supplied, the SignService Integration Service will generate one.- Parameters:
id- unique ID for this document
-
getContent
Gets the Base64-encoded byte string that is the content of the document that is to be signed.- Returns:
- the document content (Base64-encoded)
-
setContent
Assigns the Base64-encoded byte string that is the content of the document that is to be signed.- Parameters:
content- the document content (Base64-encoded)
-
getContentReference
Gets the content reference may be used instead of supplying the actual content (setContent(String)).- Returns:
- a reference to the content or
null
-
setContentReference
Assigns a content reference may be used instead of supplying the actual content (setContent(String)). This is typically something that is useful when handling large documents. However, this feature is only useable if:- The SignService Integration Service profile is in "stateful mode", and,
- the document has previously been cached by the SignService Integration Service.
Typically, this is used if the SignService Integration Service is running as a standalone service. When using the API as an integrated Java library in the service it makes less sense.
- Parameters:
contentReference- a reference to the content
-
getMimeType
Gets the MIME type of the document that is to be signed. SeeDocumentTypefor the supported types.- Returns:
- the MIME type
-
setMimeType
Assigns the MIME type of the document that is to be signed. SeeDocumentTypefor the supported types.- Parameters:
mimeType- the document MIME type- See Also:
-
setMimeType
Assigns The document type of the document that is to be signed.- Parameters:
documentType- the document type
-
getProcessingRules
Gets the Optional processing rules used by the sign service to process sign data.- Returns:
- the processing rules identifier, or
nullif none has been set
-
setProcessingRules
Assigns processing rules used by the sign service to process sign data.- Parameters:
processingRules- the processing rules
-
getAdesRequirement
Tells whether the resulting signature should use an ETSI AdES format.- Returns:
- the AdES requirement or
nullif no AdES requirement exists
-
setAdesRequirement
Specifies whether the resulting signature should use an ETSI AdES format.- Parameters:
adesRequirement- the AdES requirement
-
getVisiblePdfSignatureRequirement
If the document that is to be signed is a PDF document, the sign requester may require the resulting PDF to have a "visible PDF signature". TheVisiblePdfSignatureRequirementspecifies how this visible indication should be included.- Returns:
- requirement for visible PDF signatures, or
null
-
setVisiblePdfSignatureRequirement
public void setVisiblePdfSignatureRequirement(VisiblePdfSignatureRequirement visiblePdfSignatureRequirement) If the document that is to be signed is a PDF document, the sign requester may require the resulting PDF to have a "visible PDF signature". TheVisiblePdfSignatureRequirementspecifies how this visible indication should be included.Note that a signature policy may have a default visible PDF signature requirement configued, which means that the
visiblePdfSignatureRequirementdoes not have to be assigned, unless the signature policy default should be overridden. For the special case where a signature policy has a default requirement configured, and the caller does not want a visible PDF signature to be included at all, anVisiblePdfSignatureRequirementinstance with an extensionVisiblePdfSignatureRequirement.NULL_INDICATOR_EXTENSIONset totrueshould be assigned (seeVisiblePdfSignatureRequirement.createNullVisiblePdfSignatureRequirement()).- Parameters:
visiblePdfSignatureRequirement- requirement for visible PDF signatures
-
getExtension
Returns the extension parameters for the instance.- Specified by:
getExtensionin interfaceExtensible- Returns:
- the extension, or
nullif no extensions are set
-
setExtension
Assigns the extension parameters for the instance.- Specified by:
setExtensionin interfaceExtensible- Parameters:
extension- the extension
-