Class XAdESLevelBaselineT

All Implemented Interfaces:
SignatureExtension<XAdESSignatureParameters>
Direct Known Subclasses:
XAdESLevelBaselineLT, XAdESLevelC

public class XAdESLevelBaselineT
extends ExtensionBuilder
implements SignatureExtension<XAdESSignatureParameters>
-T profile of XAdES signature
  • Field Details

  • Constructor Details

  • Method Details

    • extendSignatures

      public DSSDocument extendSignatures​(DSSDocument dssDocument, XAdESSignatureParameters params) throws DSSException
      Description copied from interface: SignatureExtension
      Extends the level of the signatures contained in a document.
      Specified by:
      extendSignatures in interface SignatureExtension<XAdESSignatureParameters>
      Parameters:
      dssDocument - The signed document to be signed
      Returns:
      Throws:
      DSSException
    • extendSignatureTag

      protected void extendSignatureTag() throws DSSException
      Extends the signature to a desired level. This method is overridden by other profiles.
      For -T profile adds the SignatureTimeStamp element which contains a single HashDataInfo element that refers to the ds:SignatureValue element of the [XMLDSIG] signature. The timestamp token is obtained from TSP source.
      Adds <SignatureTimeStamp> segment into <UnsignedSignatureProperties> element.
      Throws:
      DSSException
    • setTspSource

      public void setTspSource​(TSPSource tspSource)
      Sets the TSP source to be used when extending the digital signature
      Parameters:
      tspSource - the tspSource to set
    • getValidationDataForInclusion

      protected ValidationDataForInclusion getValidationDataForInclusion​(ValidationContext validationContext)
      Returns a XAdES ValidationDataForInclusion (LT-, XL- level)
      Parameters:
      validationContext - a signature ValidationContext
      Returns:
      ValidationDataForInclusion
    • incorporateCertificateValues

      protected Element incorporateCertificateValues​(Element parentDom, Collection<CertificateToken> certificatesToBeAdded)
      This method incorporates all certificates passed as parameter :
       
       	<xades:CertificateValues>
      		<xades:EncapsulatedX509Certificate>MIIC9TC...</xades:EncapsulatedX509Certificate>
      		...
       	</xades:CertificateValues>
       
       
      Parameters:
      parentDom - the parent element
      certificatesToBeAdded - a collection of CertificateTokens to be added into the signature values element
      Returns:
      Element incorporated signature values element
    • incorporateRevocationValues

      protected Element incorporateRevocationValues​(Element parentDom, Collection<CRLToken> crlsToAdd, Collection<OCSPToken> ocspsToAdd)
      This method incorporates revocation values.
              
       		<xades:RevocationValues>
       	
       
      Parameters:
      parentDom - the parent element
      crlsToAdd - a collection of CRLTokens to be added into the signature
      ocspsToAdd - a collection of OCSPTokens to be added into the signature
      Returns:
      Element incorporated revocation values element
    • incorporateCertificateValues

      protected void incorporateCertificateValues​(Element parentDom, Collection<CertificateToken> certificatesToBeAdded, String indent)
      This method incorporates all certificates passed as parameter, as well as adds missing indents if the parameter is specified
       
       	<xades:CertificateValues>
      		<xades:EncapsulatedX509Certificate>MIIC9TC...</xades:EncapsulatedX509Certificate>
      		...
       	</xades:CertificateValues>
       
       
      Parameters:
      parentDom - the parent element
      certificatesToBeAdded - the certificates to be added into the signature
      indent - String to add between elements (if not NULL)
    • incorporateRevocationValues

      protected void incorporateRevocationValues​(Element parentDom, Collection<CRLToken> crlsToAdd, Collection<OCSPToken> ocspsToAdd, String indent)
      This method incorporates revocation values, as well as adds missing indents if the parameter is specified:
              
       		<xades:RevocationValues>
       	
       
      Parameters:
      parentDom - the parent element
      crlsToAdd - a collection of CRLTokens to be added into the signature
      ocspsToAdd - a collection of OCSPTokens to be added into the signature
      indent - String to add between elements (if not NULL)
    • createXAdESTimeStampType

      protected void createXAdESTimeStampType​(TimestampType timestampType, String timestampC14nMethod, byte[] digestValue) throws DSSException
      Creates any XAdES TimeStamp object representation. The timestamp token is obtained from TSP source
      Parameters:
      timestampType - TimestampType
      timestampC14nMethod - canonicalization method
      digestValue - array of byte representing the digest to timestamp
      Throws:
      DSSException - in case of any error