Class UserFriendlyIdentifierProvider

java.lang.Object
eu.europa.esig.dss.validation.UserFriendlyIdentifierProvider
All Implemented Interfaces:
TokenIdentifierProvider

public class UserFriendlyIdentifierProvider extends Object implements TokenIdentifierProvider
Creates an identifier for a given token by the template: TOKEN-CommonCertName-CreationDate-id(optional) Examples: SIGNATURE-JohnConner-20201015-2045 CERTIFICATE-CryptoSign-20151014-1425
  • Constructor Details

    • UserFriendlyIdentifierProvider

      public UserFriendlyIdentifierProvider()
      Default constructor instantiating empty maps of processed tokens
  • Method Details

    • setSignaturePrefix

      public void setSignaturePrefix(String signaturePrefix)
      Sets the prefix to be used for signature identifiers Default = "SIGNATURE"
      Parameters:
      signaturePrefix - String
    • setCounterSignaturePrefix

      public void setCounterSignaturePrefix(String counterSignaturePrefix)
      Sets the prefix to be used for counter-signature identifiers Default = "COUNTER-SIGNATURE"
      Parameters:
      counterSignaturePrefix - String
    • setTimestampPrefix

      public void setTimestampPrefix(String timestampPrefix)
      Sets the prefix to be used for timestamp identifiers Default = "TIMESTAMP"
      Parameters:
      timestampPrefix - String
    • setCertificatePrefix

      public void setCertificatePrefix(String certificatePrefix)
      Sets the prefix to be used for certificate identifiers Default = "CERTIFICATE"
      Parameters:
      certificatePrefix - String
    • setCrlPrefix

      public void setCrlPrefix(String crlPrefix)
      Sets the prefix to be used for CRL identifiers Default = "CRL"
      Parameters:
      crlPrefix - String
    • setOcspPrefix

      public void setOcspPrefix(String ocspPrefix)
      Sets the prefix to be used for OCSP identifiers Default = "OCSP"
      Parameters:
      ocspPrefix - String
    • setSignedDataPrefix

      public void setSignedDataPrefix(String signedDataPrefix)
      Sets the prefix to be used for original document identifiers Default = "DOCUMENT"
      Parameters:
      signedDataPrefix - String
    • setLOTLPrefix

      public void setLOTLPrefix(String lotlPrefix)
      Sets the prefix to be used for a LOTL identifier Default = "LOTL"
      Parameters:
      lotlPrefix - String
    • setTLPrefix

      public void setTLPrefix(String tlPrefix)
      Sets the prefix to be used for TL identifiers Default = "TL"
      Parameters:
      tlPrefix - String
    • setPivotPrefix

      public void setPivotPrefix(String pivotPrefix)
      Sets the prefix to be used for pivot identifiers Default = "PIVOT"
      Parameters:
      pivotPrefix - String
    • setDateFormat

      public void setDateFormat(String dateFormat)
      Sets the dataFormat to be used for identifiers creation Default = "yyyyMMdd-HHmm"
      Parameters:
      dateFormat - String the target date format
    • getIdAsString

      public String getIdAsString(IdentifierBasedObject object)
      Description copied from interface: TokenIdentifierProvider
      Gets a String identifier for a given object
      Specified by:
      getIdAsString in interface TokenIdentifierProvider
      Parameters:
      object - IdentifierBasedObject to get String id for
      Returns:
      String
    • getIdAsStringForSignature

      protected String getIdAsStringForSignature(AdvancedSignature signature)
      Gets a String identifier for a given AdvancedSignature
      Parameters:
      signature - AdvancedSignature to get String id for
      Returns:
      String
    • getIdAsStringForToken

      protected String getIdAsStringForToken(Token token)
      Gets a String identifier for a given Token
      Parameters:
      token - Token to get String id for
      Returns:
      String
    • getIdAsStringForSignatureScope

      protected String getIdAsStringForSignatureScope(SignatureScope signatureScope)
      Gets a String identifier for a given SignatureScope
      Parameters:
      signatureScope - SignatureScope to get String id for
      Returns:
      String
    • getIdAsStringForTL

      protected String getIdAsStringForTL(TLInfo tlInfo)
      Gets a String identifier for a given TLInfo
      Parameters:
      tlInfo - TLInfo to get String id for
      Returns:
      String
    • getIdAsStringForCertRef

      protected String getIdAsStringForCertRef(CertificateRef certificateRef)
      Gets a String identifier for a given CertificateRef
      Parameters:
      certificateRef - CertificateRef to get String id for
      Returns:
      String
    • getIdAsStringForRevRef

      protected String getIdAsStringForRevRef(RevocationRef<?> revocationRef)
      Gets a String identifier for a given RevocationRef
      Parameters:
      revocationRef - RevocationRef to get String id for
      Returns:
      String
    • getIdAsStringForRevTokenIdentifier

      protected String getIdAsStringForRevTokenIdentifier(EncapsulatedRevocationTokenIdentifier<?> revocationIdentifier)
      Gets a String identifier for a given EncapsulatedRevocationTokenIdentifier
      Parameters:
      revocationIdentifier - EncapsulatedRevocationTokenIdentifier to get String id for
      Returns:
      String