Class CMSSignerInfoGeneratorBuilder

java.lang.Object
eu.europa.esig.dss.cms.CMSSignerInfoGeneratorBuilder

public class CMSSignerInfoGeneratorBuilder extends Object
This class is used to build an instance of org.bouncycastle.cms.SignerInfoGenerator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected eu.europa.esig.dss.enumerations.DigestAlgorithm
    Digest algorithm to be used on message-digest computation
    protected org.bouncycastle.asn1.cms.AttributeTable
    Attributes to be signed
    protected eu.europa.esig.dss.model.x509.CertificateToken
    The signing-certificate of the signer
    protected org.bouncycastle.asn1.cms.AttributeTable
    Unsigned attributes
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bouncycastle.cms.SignerInfoGenerator
    build(eu.europa.esig.dss.model.DSSDocument toSignDocument, org.bouncycastle.operator.ContentSigner contentSigner)
    Builds a SignerInfoGenerator for signing a toSignDocument
    org.bouncycastle.cms.SignerInfoGenerator
    build(org.bouncycastle.operator.ContentSigner contentSigner)
    Builds a SignerInfoGenerator with no original document provided
    protected org.bouncycastle.operator.DigestCalculatorProvider
    getDigestCalculatorProvider(eu.europa.esig.dss.model.DSSDocument toSignDocument)
    Returns a DigestCalculatorProvider
    protected org.bouncycastle.cms.SignerInfoGeneratorBuilder
    getSignerInfoGeneratorBuilder(org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
    This method creates a builder of SignerInfoGenerator
    setDigestAlgorithm(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
    Sets the Digest Algorithm to be used on message-digest computation
    setSignedAttributes(org.bouncycastle.asn1.cms.AttributeTable signedAttributes)
    Sets the signed attributes
    setSigningCertificate(eu.europa.esig.dss.model.x509.CertificateToken signingCertificate)
    Sets the signing-certificate of the signer
    setUnsignedAttributes(org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes)
    Sets the unsigned attributes

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • signingCertificate

      protected eu.europa.esig.dss.model.x509.CertificateToken signingCertificate
      The signing-certificate of the signer
    • digestAlgorithm

      protected eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm
      Digest algorithm to be used on message-digest computation
    • signedAttributes

      protected org.bouncycastle.asn1.cms.AttributeTable signedAttributes
      Attributes to be signed
    • unsignedAttributes

      protected org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes
      Unsigned attributes
  • Constructor Details

    • CMSSignerInfoGeneratorBuilder

      public CMSSignerInfoGeneratorBuilder()
      Default constructor
  • Method Details

    • setSigningCertificate

      public CMSSignerInfoGeneratorBuilder setSigningCertificate(eu.europa.esig.dss.model.x509.CertificateToken signingCertificate)
      Sets the signing-certificate of the signer
      Parameters:
      signingCertificate - CertificateToken
      Returns:
      this CMSSignerInfoGeneratorBuilder
    • setDigestAlgorithm

      public CMSSignerInfoGeneratorBuilder setDigestAlgorithm(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      Sets the Digest Algorithm to be used on message-digest computation
      Parameters:
      digestAlgorithm - DigestAlgorithm
      Returns:
      this CMSSignerInfoGeneratorBuilder
    • setSignedAttributes

      public CMSSignerInfoGeneratorBuilder setSignedAttributes(org.bouncycastle.asn1.cms.AttributeTable signedAttributes)
      Sets the signed attributes
      Parameters:
      signedAttributes - AttributeTable
      Returns:
      this CMSSignerInfoGeneratorBuilder
    • setUnsignedAttributes

      public CMSSignerInfoGeneratorBuilder setUnsignedAttributes(org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes)
      Sets the unsigned attributes
      Parameters:
      unsignedAttributes - AttributeTable
      Returns:
      this CMSSignerInfoGeneratorBuilder
    • build

      public org.bouncycastle.cms.SignerInfoGenerator build(org.bouncycastle.operator.ContentSigner contentSigner)
      Builds a SignerInfoGenerator with no original document provided
      Parameters:
      contentSigner - ContentSigner
      Returns:
      SignerInfoGenerator
    • build

      public org.bouncycastle.cms.SignerInfoGenerator build(eu.europa.esig.dss.model.DSSDocument toSignDocument, org.bouncycastle.operator.ContentSigner contentSigner)
      Builds a SignerInfoGenerator for signing a toSignDocument
      Parameters:
      toSignDocument - DSSDocument to be signed
      contentSigner - ContentSigner
      Returns:
      SignerInfoGenerator
    • getDigestCalculatorProvider

      protected org.bouncycastle.operator.DigestCalculatorProvider getDigestCalculatorProvider(eu.europa.esig.dss.model.DSSDocument toSignDocument)
      Returns a DigestCalculatorProvider
      Parameters:
      toSignDocument - DSSDocument to sign
      Returns:
      DigestCalculatorProvider
    • getSignerInfoGeneratorBuilder

      protected org.bouncycastle.cms.SignerInfoGeneratorBuilder getSignerInfoGeneratorBuilder(org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider)
      This method creates a builder of SignerInfoGenerator
      Parameters:
      digestCalculatorProvider - the digest calculator (can be pre-computed)
      Returns:
      a SignerInfoGeneratorBuilder that generate the signed and unsigned attributes according to the parameters