Class BaselineBCertificateSelector

java.lang.Object
eu.europa.esig.dss.spi.x509.CertificateReorderer
eu.europa.esig.dss.spi.x509.BaselineBCertificateSelector

public class BaselineBCertificateSelector extends CertificateReorderer
This class is used to retrieve the used certificates for a signature from the user parameters. It avoids duplicate entries, orders certificates from the signing certificate to the Root CA and filters trust anchors depending on the policy.
  • Constructor Details

    • BaselineBCertificateSelector

      public BaselineBCertificateSelector(CertificateToken signingCertificate, Collection<CertificateToken> certificateChain)
      Constructor to build a certificate chain for signingCertificate
      Parameters:
      signingCertificate - CertificateToken identifies a signing-certificate to build a certificate chain for
      certificateChain - a collection of CertificateToken to build a certificate chain from
  • Method Details

    • setTrustedCertificateSource

      public BaselineBCertificateSelector setTrustedCertificateSource(CertificateSource trustedCertificateSource)
      Sets the trusted certificate source
      Parameters:
      trustedCertificateSource - CertificateSource
      Returns:
      this BaselineBCertificateSelector
    • setTrustAnchorBPPolicy

      public BaselineBCertificateSelector setTrustAnchorBPPolicy(boolean trustAnchorBPPolicy)
      Sets whether a trust anchor policy should be used. When enabled, the trust anchor is not included to the generated certificate chain. Otherwise, the chain is generated up to a trust anchor, including the trust anchor itself. Default : TRUE (trust anchor is not included to the generated certificate chain)
      Parameters:
      trustAnchorBPPolicy - whether a trust anchor policy should be used
      Returns:
      this BaselineBCertificateSelector
    • getCertificates

      public List<CertificateToken> getCertificates()
      Returns a certificate chain for a B-level signature creation
      Returns:
      an ordered list of CertificateTokens