public class DefaultTrustListManager extends Object implements TrustListManager, AutoCloseable
Constructor and Description |
---|
DefaultTrustListManager(File baseDir) |
Modifier and Type | Method and Description |
---|---|
void |
addIssuerCertificate(X509Certificate certificate)
Add
certificate to the Issuer Certificates list. |
void |
addRejectedCertificate(X509Certificate certificate)
Add
certificate to the Rejected Certificates list. |
void |
addTrustedCertificate(X509Certificate certificate)
Add
certificate to the Trusted Certificates list. |
void |
close()
Stop the certificate store watcher and free all resources.
|
File |
getBaseDir() |
com.google.common.collect.ImmutableList<X509Certificate> |
getIssuerCertificates()
Get the list of Issuer Certificates.
|
File |
getIssuerCertsDir() |
com.google.common.collect.ImmutableList<X509CRL> |
getIssuerCrls()
Get the list of Issuer CRLs.
|
File |
getIssuerCrlsDir() |
File |
getIssuerDir() |
com.google.common.collect.ImmutableList<X509Certificate> |
getRejectedCertificates()
Get the list of Rejected Certificates.
|
File |
getRejectedDir() |
com.google.common.collect.ImmutableList<X509Certificate> |
getTrustedCertificates()
Get the list of Trusted Certificates.
|
File |
getTrustedCertsDir() |
com.google.common.collect.ImmutableList<X509CRL> |
getTrustedCrls()
Get the list of Trusted CRLs.
|
File |
getTrustedCrlsDir() |
File |
getTrustedDir() |
boolean |
removeIssuerCertificate(ByteString thumbprint)
Remove the certificate identified by
thumbprint from the Issuer Certificates list. |
boolean |
removeRejectedCertificate(ByteString thumbprint)
Remove the certificate identified by
thumbprint from the Rejected Certificates list. |
boolean |
removeTrustedCertificate(ByteString thumbprint)
Remove the certificate identified by
thumbprint from the Trusted Certificates list. |
void |
setIssuerCertificates(List<X509Certificate> issuerCertificates)
Set a new list of Issuer Certificates.
|
void |
setIssuerCrls(List<X509CRL> issuerCrls)
Set a new list of Issuer CRLs.
|
void |
setTrustedCertificates(List<X509Certificate> trustedCertificates)
Set a new list of Trusted Certificates.
|
void |
setTrustedCrls(List<X509CRL> trustedCrls)
Set a new list of Trusted CRLs.
|
public DefaultTrustListManager(File baseDir) throws IOException
IOException
public void close() throws IOException
After calling closing CertificateValidator.verifyTrustChain(List)
will fail for all inputs.
close
in interface AutoCloseable
IOException
public com.google.common.collect.ImmutableList<X509CRL> getIssuerCrls()
TrustListManager
getIssuerCrls
in interface TrustListManager
X509CRL
s.public com.google.common.collect.ImmutableList<X509CRL> getTrustedCrls()
TrustListManager
getTrustedCrls
in interface TrustListManager
X509CRL
s.public com.google.common.collect.ImmutableList<X509Certificate> getIssuerCertificates()
TrustListManager
getIssuerCertificates
in interface TrustListManager
X509Certificate
s.public com.google.common.collect.ImmutableList<X509Certificate> getTrustedCertificates()
TrustListManager
getTrustedCertificates
in interface TrustListManager
X509Certificate
s.public com.google.common.collect.ImmutableList<X509Certificate> getRejectedCertificates()
TrustListManager
getRejectedCertificates
in interface TrustListManager
X509Certificate
s.public void setIssuerCrls(List<X509CRL> issuerCrls)
TrustListManager
setIssuerCrls
in interface TrustListManager
issuerCrls
- a new list of issuer X509CRL
s.public void setTrustedCrls(List<X509CRL> trustedCrls)
TrustListManager
setTrustedCrls
in interface TrustListManager
trustedCrls
- a new list of trusted X509CRL
s.public void setIssuerCertificates(List<X509Certificate> issuerCertificates)
TrustListManager
setIssuerCertificates
in interface TrustListManager
issuerCertificates
- a new list of issuer X509Certificate
s.public void setTrustedCertificates(List<X509Certificate> trustedCertificates)
TrustListManager
setTrustedCertificates
in interface TrustListManager
trustedCertificates
- a new list of trusted X509Certificate
s.public void addIssuerCertificate(X509Certificate certificate)
TrustListManager
certificate
to the Issuer Certificates list.addIssuerCertificate
in interface TrustListManager
certificate
- the X509Certificate
to add to the Issuer Certificates list.public void addTrustedCertificate(X509Certificate certificate)
TrustListManager
certificate
to the Trusted Certificates list.addTrustedCertificate
in interface TrustListManager
certificate
- the X509Certificate
to add to the Trusted Certificates list.public void addRejectedCertificate(X509Certificate certificate)
TrustListManager
certificate
to the Rejected Certificates list.addRejectedCertificate
in interface TrustListManager
certificate
- the X509Certificate
to add to the Rejected Certificates list.public boolean removeIssuerCertificate(ByteString thumbprint)
TrustListManager
thumbprint
from the Issuer Certificates list.removeIssuerCertificate
in interface TrustListManager
thumbprint
- the certificate thumbprint.true
if a certificate with a matching thumbprint was found.public boolean removeTrustedCertificate(ByteString thumbprint)
TrustListManager
thumbprint
from the Trusted Certificates list.removeTrustedCertificate
in interface TrustListManager
thumbprint
- the certificate thumbprint.true
if a certificate with a matching thumbprint was found.public boolean removeRejectedCertificate(ByteString thumbprint)
TrustListManager
thumbprint
from the Rejected Certificates list.removeRejectedCertificate
in interface TrustListManager
thumbprint
- the certificate thumbprint.true
if a certificate with a matching thumbprint was found.public File getBaseDir()
public File getIssuerDir()
public File getIssuerCertsDir()
public File getIssuerCrlsDir()
public File getTrustedDir()
public File getTrustedCertsDir()
public File getTrustedCrlsDir()
public File getRejectedDir()
Copyright © 2020. All rights reserved.