public class CertificateToken extends Token
X509Certificate a certificateToken
is created.extraInfo, issuerToken, issuerX500Principal, signatureAlgorithm, signatureInvalidityReason, signatureValid| Constructor and Description |
|---|
CertificateToken(X509Certificate x509Certificate)
Creates a CertificateToken wrapping the provided X509Certificate.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRevocationToken(RevocationToken revocationToken) |
void |
addServiceInfo(ServiceInfo serviceInfo)
This method adds the associated trusted service information.
|
void |
addSourceType(CertificateSourceType certSourceType)
This method adds the source type of the certificate (what is its origin).
|
boolean |
checkKeyUsage(KeyUsageBit keyUsageBit)
This method checks if the certificate contains the given key usage bit.
|
String |
getAbbreviation()
This method returns the DSS abbreviation of the token.
|
Set<ServiceInfo> |
getAssociatedTSPS()
Gets information about the trusted context of the certificate.
|
X509Certificate |
getCertificate()
Gets the enclosed X509 Certificate.
|
DigestAlgorithm |
getDigestAlgorithm() |
byte[] |
getEncoded()
Returns the encoded form of this certificate.
|
EncryptionAlgorithm |
getEncryptionAlgorithm() |
Set<KeyUsageBit> |
getKeyUsageBits()
This method returns a list
KeyUsageBit representing the key usages of the certificate. |
Date |
getNotAfter()
Returns .
|
Date |
getNotBefore()
Returns .
|
PublicKey |
getPublicKey()
Returns the public key associated with the certificate.
To get the encryption algorithm used with this public key call getAlgorithm() method. RFC 2459: 4.1.2.7 Subject Public Key Info This field is used to carry the public key and identify the algorithm with which the key is used. |
Set<RevocationToken> |
getRevocationTokens()
Returns the certificate revocation revocationToken object.
|
BigInteger |
getSerialNumber()
Gets the serialNumber value from the encapsulated certificate.
|
byte[] |
getSignature() |
Set<CertificateSourceType> |
getSources()
Gets information about the context in which this certificate token was created (TRUSTED_LIST, TRUSTED_STORE,
...).
|
X500Principal |
getSubjectX500Principal()
Returns the subject (subject distinguished name) value from the certificate as an X500Principal.
|
CertificateToken |
getTrustAnchor()
Returns the trust anchor associated with the certificate.
|
String |
getXmlId() |
boolean |
isExpiredOn(Date date)
Checks if the certificate is expired on the given date.
|
Boolean |
isRevoked()
This method indicates if the encapsulated certificate is revoked.
|
boolean |
isSelfSigned()
Checks if the certificate is self-signed.
|
boolean |
isSignedBy(CertificateToken issuerToken)
Checks if the token is signed by the token given in the parameter.
|
boolean |
isTrusted()
Checks if the certificate is provided by the trusted source.
|
boolean |
isValidOn(Date date)
Checks if the given date is in the validity period of the certificate.
|
void |
setXmlId(String xmlId)
Sets the Id associated with the certificate in case of an XML signature.
|
String |
toString(String indentStr)
returns a string representation of the token.
|
equals, extraInfo, getDigest, getDSSId, getDSSIdAsString, getIssuerToken, getIssuerX500Principal, getSignatureAlgorithm, getValidationInfo, hashCode, isSignatureValid, toStringpublic CertificateToken(X509Certificate x509Certificate)
x509Certificate - X509Certificatepublic void addSourceType(CertificateSourceType certSourceType)
certSourceType - public void addServiceInfo(ServiceInfo serviceInfo)
serviceInfo - public String getAbbreviation()
TokengetAbbreviation in class Tokenpublic void addRevocationToken(RevocationToken revocationToken)
revocationToken - This is the reference to the CertificateStatus. The object type is used because of the organisation
of module.public Set<RevocationToken> getRevocationTokens()
public PublicKey getPublicKey()
public Date getNotAfter()
public Date getNotBefore()
public boolean isExpiredOn(Date date)
date - public boolean isValidOn(Date date)
date - public Boolean isRevoked()
public boolean isTrusted()
public boolean isSelfSigned()
isSelfSigned in class Tokenpublic X509Certificate getCertificate()
public byte[] getEncoded()
getEncoded in class Tokenpublic Set<CertificateSourceType> getSources()
public Set<ServiceInfo> getAssociatedTSPS()
ServiceInfo for
more information.public BigInteger getSerialNumber()
public X500Principal getSubjectX500Principal()
public boolean isSignedBy(CertificateToken issuerToken)
TokenisSignedBy in class Tokenpublic DigestAlgorithm getDigestAlgorithm()
public EncryptionAlgorithm getEncryptionAlgorithm()
public CertificateToken getTrustAnchor()
this
is returned.public boolean checkKeyUsage(KeyUsageBit keyUsageBit)
keyUsageBit - the keyUsageBit to be checked.public String toString(String indentStr)
Tokenpublic String getXmlId()
public void setXmlId(String xmlId)
xmlId - idpublic Set<KeyUsageBit> getKeyUsageBits()
KeyUsageBit representing the key usages of the certificate.List of KeyUsageBits of different certificate's key usagespublic byte[] getSignature()
Copyright © 2018. All rights reserved.