Package com.codedx.security
Interface ExtraCertManager
-
- All Known Implementing Classes:
SingleCertManager
public interface ExtraCertManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPermanentCert(Certificate cert)
Add a certificate that will be accepted until this manager is "purged".void
addTemporaryCert(Certificate cert)
Add a certificate that will be accepted until some event (as determined by the implementation of this interface) occurs, causing it to be "forgotten".KeyStore
asKeyStore()
Return a representation of this manager as a KeyStore instance.void
purgeAllCerts()
Remove all certificates that have been added either byaddTemporaryCert(Certificate)
oraddPermanentCert(Certificate)
.void
purgePermanentCerts()
Remove all certificates that have been added viaaddPermanentCert(Certificate)
.void
purgeTemporaryCerts()
Remove all certificates that have been added viaaddTemporaryCert(Certificate)
.
-
-
-
Method Detail
-
addTemporaryCert
void addTemporaryCert(Certificate cert) throws IOException, GeneralSecurityException
Add a certificate that will be accepted until some event (as determined by the implementation of this interface) occurs, causing it to be "forgotten".- Parameters:
cert
- The certificate to add- Throws:
IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrectGeneralSecurityException
- if there is a problem reading/writing data within the keystore
-
addPermanentCert
void addPermanentCert(Certificate cert) throws IOException, GeneralSecurityException
Add a certificate that will be accepted until this manager is "purged". Certificates added in this way will generally be written to disk, and will be available upon restarting the program.- Parameters:
cert
- The certificate to add- Throws:
IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrectGeneralSecurityException
- if there is a problem reading/writing data within the keystore
-
purgeTemporaryCerts
void purgeTemporaryCerts() throws IOException, GeneralSecurityException
Remove all certificates that have been added viaaddTemporaryCert(Certificate)
.- Throws:
IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrectGeneralSecurityException
- if there is a problem reading/writing data within the keystore
-
purgePermanentCerts
void purgePermanentCerts() throws IOException, GeneralSecurityException
Remove all certificates that have been added viaaddPermanentCert(Certificate)
.- Throws:
IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrectGeneralSecurityException
- if there is a problem reading/writing data within the keystore
-
purgeAllCerts
void purgeAllCerts() throws IOException, GeneralSecurityException
Remove all certificates that have been added either byaddTemporaryCert(Certificate)
oraddPermanentCert(Certificate)
.- Throws:
IOException
- if there is an I/O or format problem with the keystore data, if a password is required but not given, or if the given password was incorrectGeneralSecurityException
- if there is a problem reading/writing data within the keystore
-
asKeyStore
KeyStore asKeyStore() throws GeneralSecurityException
Return a representation of this manager as a KeyStore instance.- Returns:
- A new KeyStore that represents the contents of this certificate manager
- Throws:
GeneralSecurityException
- if there is a problem reading/writing data within the keystore
-
-