|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.certificate.CertificateServiceImpl
public class CertificateServiceImpl
Implementation of the CertificateService. It asks the user to trust a certificate when the automatic verification fails.
| Nested Class Summary | |
|---|---|
protected class |
CertificateServiceImpl.BrowserLikeHostnameMatcher
|
protected class |
CertificateServiceImpl.EMailAddressMatcher
|
| Field Summary |
|---|
| Fields inherited from interface net.java.sip.communicator.service.certificate.CertificateService |
|---|
DO_NOT_TRUST, PNAME_ALWAYS_TRUST, PNAME_CLIENTAUTH_CERTCONFIG_BASE, PNAME_NO_USER_INTERACTION, PNAME_TRUSTSTORE_FILE, PNAME_TRUSTSTORE_PASSWORD, PNAME_TRUSTSTORE_TYPE, TRUST_ALWAYS, TRUST_THIS_SESSION_ONLY |
| Constructor Summary | |
|---|---|
CertificateServiceImpl()
Initializes a new CertificateServiceImpl instance. |
|
| Method Summary | |
|---|---|
void |
addCertificateToTrust(Certificate cert,
String trustFor,
int trustMode)
Adds a certificate to the local trust store. |
List<CertificateConfigEntry> |
getClientAuthCertificateConfigs()
Returns all saved CertificateConfigEntrys. |
SSLContext |
getSSLContext()
Get an SSL Context that validates certificates based on the JRE default check and asks the user when the JRE check fails. |
SSLContext |
getSSLContext(KeyManager[] keyManagers,
X509TrustManager trustManager)
Get an SSL Context with the specified trustmanager. |
SSLContext |
getSSLContext(String clientCertConfig,
X509TrustManager trustManager)
Get an SSL Context with the specified trustmanager. |
SSLContext |
getSSLContext(X509TrustManager trustManager)
Get an SSL Context with the specified trustmanager. |
List<KeyStoreType> |
getSupportedKeyStoreTypes()
Gets a list of all supported KeyStore types. |
X509TrustManager |
getTrustManager(Iterable<String> identitiesToTest)
Creates a trustmanager that validates the certificate based on the JRE default check and asks the user when the JRE check fails. |
X509TrustManager |
getTrustManager(Iterable<String> identitiesToTest,
CertificateMatcher clientVerifier,
CertificateMatcher serverVerifier)
Creates a trustmanager that validates the certificate based on the JRE default check and asks the user when the JRE check fails. |
X509TrustManager |
getTrustManager(String identityToTest)
|
X509TrustManager |
getTrustManager(String identityToTest,
CertificateMatcher clientVerifier,
CertificateMatcher serverVerifier)
|
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removeClientAuthCertificateConfig(String id)
Deletes a saved CertificateConfigEntry. |
void |
setClientAuthCertificateConfig(CertificateConfigEntry e)
Saves or updates the passed CertificateConfigEntry to the config. |
protected int |
verify(X509Certificate[] chain,
String message)
Asks the user whether he trusts the supplied chain of certificates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CertificateServiceImpl()
| Method Detail |
|---|
public void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic List<KeyStoreType> getSupportedKeyStoreTypes()
CertificateService
getSupportedKeyStoreTypes in interface CertificateServicepublic List<CertificateConfigEntry> getClientAuthCertificateConfigs()
CertificateServiceCertificateConfigEntrys.
getClientAuthCertificateConfigs in interface CertificateServicepublic void setClientAuthCertificateConfig(CertificateConfigEntry e)
CertificateServiceCertificateConfigEntry to the config.
If CertificateConfigEntry.getId() returns null, a new entry is
created.
setClientAuthCertificateConfig in interface CertificateServicee - The @see CertificateConfigEntry to save or update.public void removeClientAuthCertificateConfig(String id)
CertificateServiceCertificateConfigEntry.
removeClientAuthCertificateConfig in interface CertificateServiceid - The ID (CertificateConfigEntry.getId()) of the entry to
delete.
public void addCertificateToTrust(Certificate cert,
String trustFor,
int trustMode)
throws CertificateException
CertificateService
addCertificateToTrust in interface CertificateServicecert - The certificate to add to the trust store.trustMode - Whether to trust the certificate permanently or only
for the current session.
CertificateException - when the thumbprint could not be calculated
public SSLContext getSSLContext()
throws GeneralSecurityException
CertificateService
getSSLContext in interface CertificateServiceGeneralSecurityException
public SSLContext getSSLContext(X509TrustManager trustManager)
throws GeneralSecurityException
CertificateService
getSSLContext in interface CertificateServicetrustManager - The trustmanager that will be used by the created
SSLContext
GeneralSecurityException
public SSLContext getSSLContext(String clientCertConfig,
X509TrustManager trustManager)
throws GeneralSecurityException
CertificateService
getSSLContext in interface CertificateServiceclientCertConfig - The ID of a client certificate configuration
entry that is to be used when the server asks for a client TLS
certificatetrustManager - The trustmanager that will be used by the created
SSLContext
GeneralSecurityException
public SSLContext getSSLContext(KeyManager[] keyManagers,
X509TrustManager trustManager)
throws GeneralSecurityException
CertificateService
getSSLContext in interface CertificateServicekeyManagers - The key manager(s) to be used for client
authenticationtrustManager - The trustmanager that will be used by the created
SSLContext
GeneralSecurityException
public X509TrustManager getTrustManager(Iterable<String> identitiesToTest)
throws GeneralSecurityException
CertificateService
getTrustManager in interface CertificateServiceidentitiesToTest - when not null, the values are assumed
to be hostnames for invocations of checkServerTrusted and
e-mail addresses for invocations of checkClientTrusted
GeneralSecurityException
public X509TrustManager getTrustManager(String identityToTest)
throws GeneralSecurityException
getTrustManager in interface CertificateServiceidentityToTest - when not null, the value is assumed to
be a hostname for invocations of checkServerTrusted and an
e-mail address for invocations of checkClientTrusted
GeneralSecurityExceptionCertificateService.getTrustManager(Iterable)
public X509TrustManager getTrustManager(String identityToTest,
CertificateMatcher clientVerifier,
CertificateMatcher serverVerifier)
throws GeneralSecurityException
getTrustManager in interface CertificateServiceidentityToTest - The identity to match against the supplied
verifiers.clientVerifier - The verifier to use in calls to checkClientTrustedserverVerifier - The verifier to use in calls to checkServerTrusted
GeneralSecurityExceptionCertificateService.getTrustManager(Iterable, CertificateMatcher, CertificateMatcher)
public X509TrustManager getTrustManager(Iterable<String> identitiesToTest,
CertificateMatcher clientVerifier,
CertificateMatcher serverVerifier)
throws GeneralSecurityException
CertificateService
getTrustManager in interface CertificateServiceidentitiesToTest - The identities to match against the supplied
verifiers.clientVerifier - The verifier to use in calls to checkClientTrustedserverVerifier - The verifier to use in calls to checkServerTrusted
GeneralSecurityException
protected int verify(X509Certificate[] chain,
String message)
chain - The chain of the certificates to check with user.message - A text that describes why the verification failed.
CertificateService.DO_NOT_TRUST,
CertificateService.TRUST_THIS_SESSION_ONLY,
CertificateService.TRUST_ALWAYS
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||