Package eu.europa.esig.dss.diagnostic
Class CertificateWrapper
java.lang.Object
eu.europa.esig.dss.diagnostic.AbstractTokenProxy
eu.europa.esig.dss.diagnostic.CertificateWrapper
- All Implemented Interfaces:
TokenProxy
- Direct Known Subclasses:
RelatedCertificateWrapper
Provides a user-friendly interface of dealing with JAXB
XmlCertificate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.since DSS 5.12.byte[]
Returns binaries of the token, when presentReturns the Authority Information Access URLsReturns the certificate's Distinguished Name (by RFC 2253)<T extends XmlCertificateExtension>
TgetCertificateExtensionForOid
(String oid, Class<T> targetClass) Returns a certificate extension with the givenoid
when presentReturns a list of all certificate extensionsReturns the certificate issuer's Distinguished Name (by RFC 2253)Returns the certificate policies IdsReturns a list of revocation data relevant to the certificateReturns expiredCertsRevocationInfo extension from TL Trusted ServicedReturns the common nameReturns the country codeReturns the certificate policies URLsReturns the CRL Distribution Points URLsprotected XmlBasicSignature
Returns a basic signature validationprotected List<XmlChainItem>
Returns the token's certificate chainprotected XmlSigningCertificate
Returns the signing certificate of the tokenReturns the certificate's Digest if presentgetEmail()
Returns the emailReturns a string identifier of the certificate's public keyReturns value of the excludedSubtrees field of nameConstraints certificate extension, when presentReturns a list of extended-key-usagesReturns the given namegetId()
Returns the unique identifier of the objectint
Returns value of the inhibitAnyPolicy certificate extension's valueint
Returns value of the inhibitPolicyMapping field of policyConstraints certificate extensionReturns the defined key-usages for the certificateReturns the localityReturns aXmlCertificateContentEquivalence
list corresponding to the matching MRA informationThis method returns a name of a Trusted Service used to apply translation for the certificate QcStatements based on the defined Mutual Recognition Agreement schemeReturns the certificate's notAfter date (the date the certificate cannot be used after)Returns the certificate's notBefore date (the date the certificate cannot be used before)Returns the OCSP Access URLsReturns the organization unitReturns the organization identifierReturns the organization nameReturns a list of QcStatements OIDs not supported by the implementation defined in a third-country Trusted List before MRA mappingReturns a list of QCLegislation Country Codes defined in a third-country Trusted List before MRA mappingReturns a list of QCTypes defined in a third-country Trusted List before MRA mappingReturns a list of QcStatements OIDs not supported by the implementationint
Returns value of BasicConstraints.PathLenConstraint if present and BasicConstraints.cA is set to trueReturns value of the permittedSubtrees field of nameConstraints certificate extension, when presentReturns the certificate policies IdsReturns the PSD2 QCStatement (id-etsi-psd2-qcStatement extension, ETSI TS 119 495)Returns the pseudoReturns QcEuRetentionPeriodReturns a list of QCLegislation Country Codes (present inside id-etsi-qcs-QcCClegislation extension)Returns the QCEuLimitValueReturns QcEuPDS LocationsReturns a list of QCTypes (present inside id-etsi-qcs-QcType extension)Returns human-readable certificate nameint
Returns value of the requireExplicitPolicy field of policyConstraints certificate extensiongetRevocationDataById
(String revocationId) Returns revocation data by its idReturns the semantics identifierReturns the serial number of the certificateReturns a list of sources the certificate has been obtained from (e.g.getState()
Returns the stateReturns subject alternative namesbyte[]
Returns the Subject Key Identifier certificate extension's value, when presentReturns the subject serial number of the certificateReturns the surnamegetTitle()
Returns the titleReturns a list ofTrustedServiceWrapper
sReturns a list ofXmlTrustedServiceProvider
sint
hashCode()
boolean
isCA()
Returns whether the certificate defines BasicConstraints.cA extension set to TRUEboolean
Returns if the MRA has been enactedboolean
Checks if the certificate has an extended-key-usage "ocspSigning" (1.3.6.1.5.5.7.3.9)boolean
Returns if the certificate has id-pkix-ocsp-no-check attributeboolean
Returns if the certificate has been defined as QC compliant in a third-country Trusted List before MRA mappingboolean
Returns if the certificate has been defined as supported by QSCD in a third-country Trusted List before MRA mappingboolean
Returns if the certificate is QC compliant (has id-etsi-qcs-QcCompliance extension)boolean
Returns if the revocation data is available for the certificateboolean
Returns if the certificate is self-signedboolean
Returns if the certificate is supported by QSCD (has id-etsi-qcs-QcSSCD extension)boolean
Returns if the certificate is trustedboolean
Returns if the Trusted List has been reached for the particular certificateboolean
Returns if the certificate contains id-etsi-ext-valassured-ST-certs extension, as defined in ETSI EN 319 412-1 "5.2 Certificate Extensions regarding Validity Assured Certificate"Methods inherited from class eu.europa.esig.dss.diagnostic.AbstractTokenProxy
foundCertificates, foundRevocations, getCertificateChain, getDigestAlgorithm, getDigestMatchers, getEncryptionAlgorithm, getKeyLengthUsedToSignThisToken, getMaskGenerationFunction, getSignatureAlgorithm, getSigningCertificate, getSigningCertificatePublicKey, getSigningCertificateReference, getSigningCertificateReferences, isCertificateChainFromTrustedStore, isSignatureIntact, isSignatureValid, isSigningCertificateReferencePresent, isSigningCertificateReferenceUnique, isTrustedChain, toString
-
Constructor Details
-
CertificateWrapper
Default constructor- Parameters:
certificate
-XmlCertificate
to be wrapped
-
-
Method Details
-
getId
Description copied from interface:TokenProxy
Returns the unique identifier of the object- Returns:
String
id
-
getCurrentBasicSignature
Description copied from class:AbstractTokenProxy
Returns a basic signature validation- Specified by:
getCurrentBasicSignature
in classAbstractTokenProxy
- Returns:
XmlBasicSignature
-
getCurrentCertificateChain
Description copied from class:AbstractTokenProxy
Returns the token's certificate chain- Specified by:
getCurrentCertificateChain
in classAbstractTokenProxy
- Returns:
- a list of
XmlChainItem
s
-
getCurrentSigningCertificate
Description copied from class:AbstractTokenProxy
Returns the signing certificate of the token- Specified by:
getCurrentSigningCertificate
in classAbstractTokenProxy
- Returns:
XmlSigningCertificate
-
isTrusted
public boolean isTrusted()Returns if the certificate is trusted- Returns:
- TRUE if the certificate is trusted, FALSE otherwise
-
isSelfSigned
public boolean isSelfSigned()Returns if the certificate is self-signed- Returns:
- TRUE if the certificate is self-signed, FALSE otherwise
-
getCertificateExtensions
Returns a list of all certificate extensions- Returns:
- a list of
XmlCertificateExtension
-
getCertificateExtensionForOid
public <T extends XmlCertificateExtension> T getCertificateExtensionForOid(String oid, Class<T> targetClass) Returns a certificate extension with the givenoid
when present- Parameters:
oid
-String
OID of the certificate extension- Returns:
XmlCertificateExtension
when present, NULL otherwise
-
getSubjectAlternativeNames
Returns subject alternative names- Returns:
- a list of
String
s
-
isCA
public boolean isCA()Returns whether the certificate defines BasicConstraints.cA extension set to TRUE- Returns:
- TRUE if the BasicConstraints.cA extension is defined and set to true, FALSE otherwise
-
getPathLenConstraint
public int getPathLenConstraint()Returns value of BasicConstraints.PathLenConstraint if present and BasicConstraints.cA is set to true- Returns:
- integer value of BasicConstraints.PathLenConstraint if applicable, -1 otherwise
-
getRequireExplicitPolicy
public int getRequireExplicitPolicy()Returns value of the requireExplicitPolicy field of policyConstraints certificate extension- Returns:
- requireExplicitPolicy value if present, -1 otherwise
-
getInhibitPolicyMapping
public int getInhibitPolicyMapping()Returns value of the inhibitPolicyMapping field of policyConstraints certificate extension- Returns:
- inhibitPolicyMapping value if present, -1 otherwise
-
getInhibitAnyPolicy
public int getInhibitAnyPolicy()Returns value of the inhibitAnyPolicy certificate extension's value- Returns:
- inhibitAnyPolicy certificate extension's value if present, -1 otherwise
-
getPermittedSubtrees
Returns value of the permittedSubtrees field of nameConstraints certificate extension, when present- Returns:
- list of
XmlGeneralSubtree
if field is present, empty list otherwise
-
getExcludedSubtrees
Returns value of the excludedSubtrees field of nameConstraints certificate extension, when present- Returns:
- list of
XmlGeneralSubtree
if field is present, empty list otherwise
-
getKeyUsages
Returns the defined key-usages for the certificate- Returns:
- a list of
KeyUsageBit
s
-
isRevocationDataAvailable
public boolean isRevocationDataAvailable()Returns if the revocation data is available for the certificate- Returns:
- TRUE if the revocation data is available, FALSE otherwise
-
getSources
Returns a list of sources the certificate has been obtained from (e.g. TRUSTED_LIST, SIGNATURE, AIA, etc.)- Returns:
- a list of
CertificateSourceType
s
-
getCertificateRevocationData
Returns a list of revocation data relevant to the certificate- Returns:
- a list of
CertificateRevocationWrapper
s
-
getRevocationDataById
Returns revocation data by its id- Parameters:
revocationId
-String
representing id of a revocation data to extract- Returns:
CertificateRevocationWrapper
-
isIdPkixOcspNoCheck
public boolean isIdPkixOcspNoCheck()Returns if the certificate has id-pkix-ocsp-no-check attribute- Returns:
- TRUE if the certificate has id-pkix-ocsp-no-check attribute, FALSE otherwise
-
isIdKpOCSPSigning
public boolean isIdKpOCSPSigning()Checks if the certificate has an extended-key-usage "ocspSigning" (1.3.6.1.5.5.7.3.9)- Returns:
- TRUE if the certificate has extended-key-usage "ocspSigning", FALSE otherwise
-
isValAssuredShortTermCertificate
public boolean isValAssuredShortTermCertificate()Returns if the certificate contains id-etsi-ext-valassured-ST-certs extension, as defined in ETSI EN 319 412-1 "5.2 Certificate Extensions regarding Validity Assured Certificate"- Returns:
- TRUE if the certificate is a validity assured short-term certificate, FALSE otherwise
-
getExtendedKeyUsages
Returns a list of extended-key-usages- Returns:
- a list of
XmlOID
s
-
getNotBefore
Returns the certificate's notBefore date (the date the certificate cannot be used before)- Returns:
Date
notBefore
-
getNotAfter
Returns the certificate's notAfter date (the date the certificate cannot be used after)- Returns:
Date
notAfter
-
getEntityKey
Returns a string identifier of the certificate's public key- Returns:
String
public key's identifier
-
getCertificateTSPServiceExpiredCertsRevocationInfo
Returns expiredCertsRevocationInfo extension from TL Trusted Serviced- Returns:
Date
expiredCertsRevocationInfo extension
-
getSerialNumber
Returns the serial number of the certificate- Returns:
String
-
getSubjectSerialNumber
Returns the subject serial number of the certificate- Returns:
String
-
getTitle
Returns the title- Returns:
String
-
getCommonName
Returns the common name- Returns:
String
-
getCountryName
Returns the country code- Returns:
String
-
getGivenName
Returns the given name- Returns:
String
-
getOrganizationIdentifier
Returns the organization identifier- Returns:
String
-
getOrganizationName
Returns the organization name- Returns:
String
-
getOrganizationalUnit
Returns the organization unit- Returns:
String
-
getEmail
Returns the email- Returns:
String
-
getLocality
Returns the locality- Returns:
String
-
getState
Returns the state- Returns:
String
-
getSurname
Returns the surname- Returns:
String
-
getPseudo
Returns the pseudo- Returns:
String
-
getDigestAlgoAndValue
Returns the certificate's Digest if present- Returns:
XmlDigestAlgoAndValue
-
isTrustedListReached
public boolean isTrustedListReached()Returns if the Trusted List has been reached for the particular certificate- Returns:
- TRUE if the Trusted List has been reached, FALSE otherwise
-
getTrustServiceProviders
Returns a list ofXmlTrustedServiceProvider
s- Returns:
- a list of
XmlTrustedServiceProvider
s
-
getTrustedServices
Returns a list ofTrustedServiceWrapper
s- Returns:
- a list of
TrustedServiceWrapper
s
-
getCertificateDN
Returns the certificate's Distinguished Name (by RFC 2253)- Returns:
String
-
getCertificateIssuerDN
Returns the certificate issuer's Distinguished Name (by RFC 2253)- Returns:
String
-
getCRLDistributionPoints
Returns the CRL Distribution Points URLs- Returns:
- a list of
String
s
-
getAuthorityInformationAccessUrls
Deprecated.since DSS 5.12. Use#getCAIssuersAccessUrls
method instead.Returns the Authority Information Access URLs- Returns:
- a list of
String
s
-
getCAIssuersAccessUrls
Returns the Authority Information Access URLs- Returns:
- a list of
String
s
-
getOCSPAccessUrls
Returns the OCSP Access URLs- Returns:
- a list of
String
s
-
getSubjectKeyIdentifier
public byte[] getSubjectKeyIdentifier()Returns the Subject Key Identifier certificate extension's value, when present- Returns:
- byte array representing the Subject Key Identifier
-
getCpsUrls
Returns the certificate policies URLs- Returns:
- a list of
String
s
-
getPolicyIds
Returns the certificate policies Ids- Returns:
- a list of
String
s
-
getCertificatePolicies
Returns the certificate policies Ids- Returns:
- a list of
String
s
-
isQcCompliance
public boolean isQcCompliance()Returns if the certificate is QC compliant (has id-etsi-qcs-QcCompliance extension)- Returns:
- TRUE if the certificate is QC compliant, FALSE otherwise
-
isSupportedByQSCD
public boolean isSupportedByQSCD()Returns if the certificate is supported by QSCD (has id-etsi-qcs-QcSSCD extension)- Returns:
- TRUE if the certificate is supported by QSCD, FALSE otherwise
-
getQcTypes
Returns a list of QCTypes (present inside id-etsi-qcs-QcType extension)- Returns:
- a list of
QCType
s
-
getQcLegislationCountryCodes
Returns a list of QCLegislation Country Codes (present inside id-etsi-qcs-QcCClegislation extension)- Returns:
- a list of
String
s
-
getPSD2Info
Returns the PSD2 QCStatement (id-etsi-psd2-qcStatement extension, ETSI TS 119 495)- Returns:
PSD2InfoWrapper
-
getQCLimitValue
Returns the QCEuLimitValue- Returns:
QCLimitValueWrapper
-
getQCEuRetentionPeriod
Returns QcEuRetentionPeriod- Returns:
Integer
retention period
-
getQCPDSLocations
Returns QcEuPDS Locations- Returns:
- a list of
XmlLangAndValue
s
-
getSemanticsIdentifier
Returns the semantics identifier- Returns:
SemanticsIdentifier
-
getOtherQcStatements
Returns a list of QcStatements OIDs not supported by the implementation- Returns:
- a list of
String
s
-
isEnactedMRA
public boolean isEnactedMRA()Returns if the MRA has been enacted- Returns:
- TRUE if the MRA has been enacted, FALSE otherwise
-
getMRAEnactedTrustServiceLegalIdentifier
This method returns a name of a Trusted Service used to apply translation for the certificate QcStatements based on the defined Mutual Recognition Agreement scheme- Returns:
String
-
getMRACertificateContentEquivalenceList
Returns aXmlCertificateContentEquivalence
list corresponding to the matching MRA information- Returns:
- a list of
XmlCertificateContentEquivalence
s
-
isOriginalThirdCountryQcCompliance
public boolean isOriginalThirdCountryQcCompliance()Returns if the certificate has been defined as QC compliant in a third-country Trusted List before MRA mapping- Returns:
- TRUE if the certificate is QC compliant, FALSE otherwise
-
isOriginalThirdCountrySupportedByQSCD
public boolean isOriginalThirdCountrySupportedByQSCD()Returns if the certificate has been defined as supported by QSCD in a third-country Trusted List before MRA mapping- Returns:
- TRUE if the certificate is supported by QSCD, FALSE otherwise
-
getOriginalThirdCountryQCTypes
Returns a list of QCTypes defined in a third-country Trusted List before MRA mapping- Returns:
- a list of
QCType
s
-
getOriginalThirdCountryQcLegislationCountryCodes
Returns a list of QCLegislation Country Codes defined in a third-country Trusted List before MRA mapping- Returns:
- a list of
String
s
-
getOriginalThirdCountryOtherQcStatements
Returns a list of QcStatements OIDs not supported by the implementation defined in a third-country Trusted List before MRA mapping- Returns:
- a list of
String
s
-
getBinaries
public byte[] getBinaries()Description copied from class:AbstractTokenProxy
Returns binaries of the token, when present- Specified by:
getBinaries
in classAbstractTokenProxy
- Returns:
- a byte array
-
getReadableCertificateName
Returns human-readable certificate name- Returns:
String
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractTokenProxy
-
equals
- Overrides:
equals
in classAbstractTokenProxy
-