Class TokenCertificateSource
java.lang.Object
eu.europa.esig.dss.spi.x509.CommonCertificateSource
eu.europa.esig.dss.spi.x509.TokenCertificateSource
- All Implemented Interfaces:
CertificateSource, Serializable
- Direct Known Subclasses:
RevocationCertificateSource, SignatureCertificateSource
Represents a source of certificates embedded in a token (signature, timestamp, ocsp response)
- See Also:
-
Field Summary
Fields inherited from class CommonCertificateSource
certificateMatcher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCertificate(eu.europa.esig.dss.model.x509.CertificateToken certificate, eu.europa.esig.dss.enumerations.CertificateOrigin origin) Adds aCertificateTokenwith itsCertificateOriginprotected voidaddCertificateIdentifier(SignerIdentifier signerIdentifier, eu.europa.esig.dss.enumerations.CertificateOrigin origin) Adds aCertificateIdentifierwith its originprotected voidaddCertificateRef(CertificateRef certificateRef, eu.europa.esig.dss.enumerations.CertificateRefOrigin origin) Adds aCertificateRefwith itsCertificateRefOriginSet<eu.europa.esig.dss.model.x509.CertificateToken> findTokensFromRefs(List<CertificateRef> certificateRefs) Returns Set ofCertificateTokens for the providedCertificateRefsReturns a Set of allSignerIdentifierFor CAdES/PAdES/TimestampReturns a Set of all certificate referencesList<eu.europa.esig.dss.enumerations.CertificateRefOrigin> getCertificateRefOrigins(CertificateRef certificateRef) Extracts origins for a given certificateRefprotected List<CertificateRef> getCertificateRefsByOrigin(eu.europa.esig.dss.enumerations.CertificateRefOrigin origin) Gets a list ofCertificateRefs by the givenCertificateRefOriginprotected eu.europa.esig.dss.model.x509.CertificateTokengetCertificateToken(SignerIdentifier signerIdentifier) Gets aCertificateTokenby the givenSignerIdentifierprotected List<eu.europa.esig.dss.model.x509.CertificateToken> getCertificateTokensByOrigin(eu.europa.esig.dss.enumerations.CertificateOrigin origin) Gets a list ofCertificateTokens by the givenCertificateOriginReturns the currentSignerIdentifierFor CAdES/PAdES/TimestampReturns a list of orphan certificate refsgetReferencesForCertificateToken(eu.europa.esig.dss.model.x509.CertificateToken certificateToken) Returns list ofCertificateRefs found for the givencertificateTokenprotected booleanisOrphan(CertificateRef certificateRef) Verifies whether theCertificateRefis orphan (does not have related certificates embedded to the certificate source)Methods inherited from class CommonCertificateSource
addCertificate, doesCertificateReferenceMatch, findTokensFromCertRef, getByCertificateDigest, getByEntityKey, getByPublicKey, getBySignerIdentifier, getBySki, getBySubject, getCertificates, getCertificateSourceType, getEntities, getNumberOfCertificates, getNumberOfEntities, isAllSelfSigned, isCertificateSourceEqual, isCertificateSourceEquivalent, isKnown, isTrusted, isTrustedAtTime, removeCertificate, reset
-
Constructor Details
-
TokenCertificateSource
protected TokenCertificateSource()Default constructor
-
-
Method Details
-
addCertificateIdentifier
protected void addCertificateIdentifier(SignerIdentifier signerIdentifier, eu.europa.esig.dss.enumerations.CertificateOrigin origin) Adds aCertificateIdentifierwith its origin- Parameters:
signerIdentifier- the certificate identifier to be addedorigin- the origin of the certificate identifier
-
addCertificate
protected void addCertificate(eu.europa.esig.dss.model.x509.CertificateToken certificate, eu.europa.esig.dss.enumerations.CertificateOrigin origin) Adds aCertificateTokenwith itsCertificateOrigin- Parameters:
certificate- the certificate to be addedorigin- the origin of the certificate
-
addCertificateRef
protected void addCertificateRef(CertificateRef certificateRef, eu.europa.esig.dss.enumerations.CertificateRefOrigin origin) Adds aCertificateRefwith itsCertificateRefOrigin- Parameters:
certificateRef- the certificate reference to be addedorigin- the origin of the certificate reference
-
getReferencesForCertificateToken
public List<CertificateRef> getReferencesForCertificateToken(eu.europa.esig.dss.model.x509.CertificateToken certificateToken) Returns list ofCertificateRefs found for the givencertificateToken- Parameters:
certificateToken-CertificateTokento find references for- Returns:
- list of
CertificateRefs
-
findTokensFromRefs
public Set<eu.europa.esig.dss.model.x509.CertificateToken> findTokensFromRefs(List<CertificateRef> certificateRefs) Returns Set ofCertificateTokens for the providedCertificateRefs- Parameters:
certificateRefs- list ofCertificateRefs- Returns:
- Set of
CertificateTokens
-
getAllCertificateIdentifiers
Returns a Set of allSignerIdentifierFor CAdES/PAdES/Timestamp- Returns:
- a set of
SignerIdentifier
-
getCurrentCertificateIdentifier
Returns the currentSignerIdentifierFor CAdES/PAdES/Timestamp- Returns:
- the current
SignerIdentifieror null
-
getAllCertificateRefs
Returns a Set of all certificate references- Returns:
- a Set of
CertificateRefs
-
getOrphanCertificateRefs
Returns a list of orphan certificate refs- Returns:
- list of
CertificateRefs
-
isOrphan
Verifies whether theCertificateRefis orphan (does not have related certificates embedded to the certificate source)- Parameters:
certificateRef-CertificateRefto check- Returns:
- TRUE if the certificate reference is orphan, FALSE otherwise
-
getCertificateToken
protected eu.europa.esig.dss.model.x509.CertificateToken getCertificateToken(SignerIdentifier signerIdentifier) Gets aCertificateTokenby the givenSignerIdentifier- Parameters:
signerIdentifier-SignerIdentifier- Returns:
CertificateToken
-
getCertificateTokensByOrigin
protected List<eu.europa.esig.dss.model.x509.CertificateToken> getCertificateTokensByOrigin(eu.europa.esig.dss.enumerations.CertificateOrigin origin) Gets a list ofCertificateTokens by the givenCertificateOrigin- Parameters:
origin-CertificateOrigin- Returns:
- a list of
CertificateTokens
-
getCertificateRefsByOrigin
protected List<CertificateRef> getCertificateRefsByOrigin(eu.europa.esig.dss.enumerations.CertificateRefOrigin origin) Gets a list ofCertificateRefs by the givenCertificateRefOrigin- Parameters:
origin-CertificateRefOrigin- Returns:
- a list of
CertificateRefs
-
getCertificateRefOrigins
public List<eu.europa.esig.dss.enumerations.CertificateRefOrigin> getCertificateRefOrigins(CertificateRef certificateRef) Extracts origins for a given certificateRef- Parameters:
certificateRef-CertificateRefto get origins for- Returns:
- a list of
CertificateRefOrigins
-