class LoginByClientCertificateStrategy extends java.lang.Object implements JabberLoginStrategy
Constructor and Description |
---|
LoginByClientCertificateStrategy(AccountID accountID)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
javax.net.ssl.SSLContext |
createSslContext(CertificateService cs,
javax.net.ssl.X509ExtendedTrustManager trustManager)
Creates the SSLContext for the XMPP connection configured with a
customized TrustManager and a KeyManager based on the selected client
certificate.
|
boolean |
isTlsRequired()
Always true as the authentication occurs with the TLS client
certificate.
|
boolean |
login(org.jivesoftware.smack.Connection connection,
java.lang.String userName,
java.lang.String resource)
Performs the login on the XMPP connection using the SASL EXTERNAL
mechanism.
|
boolean |
loginPreparationSuccessful()
Does nothing.
|
UserCredentials |
prepareLogin(SecurityAuthority authority,
int reasonCode)
Does nothing.
|
public LoginByClientCertificateStrategy(AccountID accountID)
accountID
- The account to use for the strategy.public UserCredentials prepareLogin(SecurityAuthority authority, int reasonCode)
prepareLogin
in interface JabberLoginStrategy
authority
- unusedreasonCode
- unusedSecurityAuthority
public boolean loginPreparationSuccessful()
loginPreparationSuccessful
in interface JabberLoginStrategy
public boolean isTlsRequired()
isTlsRequired
in interface JabberLoginStrategy
public javax.net.ssl.SSLContext createSslContext(CertificateService cs, javax.net.ssl.X509ExtendedTrustManager trustManager) throws java.security.GeneralSecurityException
createSslContext
in interface JabberLoginStrategy
certificateService
- certificate service to retrieve the
SSL contexttrustManager
- Trust manager to use for the contextjava.security.GeneralSecurityException
public boolean login(org.jivesoftware.smack.Connection connection, java.lang.String userName, java.lang.String resource) throws org.jivesoftware.smack.XMPPException
login
in interface JabberLoginStrategy
connection
- The connection on which the login is performed.userName
- The username for the login.resource
- The XMPP resource.org.jivesoftware.smack.XMPPException
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.