當前位置: 首頁>>代碼示例>>Java>>正文


Java SaslServer.dispose方法代碼示例

本文整理匯總了Java中javax.security.sasl.SaslServer.dispose方法的典型用法代碼示例。如果您正苦於以下問題:Java SaslServer.dispose方法的具體用法?Java SaslServer.dispose怎麽用?Java SaslServer.dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.security.sasl.SaslServer的用法示例。


在下文中一共展示了SaslServer.dispose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: disposeSaslServer

import javax.security.sasl.SaslServer; //導入方法依賴的package包/類
private void disposeSaslServer(AMQProtocolSession ps)
{
    SaslServer ss = ps.getSaslServer();
    if (ss != null)
    {
        ps.setSaslServer(null);
        try
        {
            ss.dispose();
        }
        catch (SaslException e)
        {
            _logger.error("Error disposing of Sasl server: " + e);
        }
    }
}
 
開發者ID:wso2,項目名稱:andes,代碼行數:17,代碼來源:ConnectionStartOkMethodHandler.java

示例2: secure

import javax.security.sasl.SaslServer; //導入方法依賴的package包/類
protected void secure(final SaslServer ss, final Connection conn, final byte[] response)
{
    try
    {
        byte[] challenge = ss.evaluateResponse(response);
        if (ss.isComplete())
        {
            ss.dispose();
            tuneAuthorizedConnection(conn);
        }
        else
        {
            connectionAuthContinue(conn, challenge);
        }
    }
    catch (SaslException e)
    {
        connectionAuthFailed(conn, e);
    }
}
 
開發者ID:wso2,項目名稱:andes,代碼行數:21,代碼來源:ServerDelegate.java

示例3: safeDispose

import javax.security.sasl.SaslServer; //導入方法依賴的package包/類
static void safeDispose(SaslServer saslServer) {
  try {
    saslServer.dispose();
  } catch (SaslException e) {
    LOG.error("Error disposing of SASL server", e);
  }
}
 
開發者ID:apache,項目名稱:hbase,代碼行數:8,代碼來源:SaslUtil.java

示例4: main

import javax.security.sasl.SaslServer; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {

        Map<String, String> props = new TreeMap<String, String>();
        props.put(Sasl.QOP, "auth");

        // client
        SaslClient client = Sasl.createSaslClient(new String[]{ DIGEST_MD5 },
            "user1", "xmpp", "127.0.0.1", props, authCallbackHandler);
        if (client == null) {
            throw new Exception("Unable to find client implementation for: " +
                DIGEST_MD5);
        }

        byte[] response = client.hasInitialResponse()
            ? client.evaluateChallenge(EMPTY) : EMPTY;
        logger.info("initial: " + new String(response));

        // server
        byte[] challenge = null;
        SaslServer server = Sasl.createSaslServer(DIGEST_MD5, "xmpp",
          "127.0.0.1", props, authCallbackHandler);
        if (server == null) {
            throw new Exception("Unable to find server implementation for: " +
                DIGEST_MD5);
        }

        if (!client.isComplete() || !server.isComplete()) {
            challenge = server.evaluateResponse(response);

            logger.info("challenge: " + new String(challenge));

            if (challenge != null) {
                response = client.evaluateChallenge(challenge);
            }
        }

        String challengeString = new String(challenge, "UTF-8").toLowerCase();

        if (challengeString.indexOf("\"md5-sess\"") > 0 ||
            challengeString.indexOf("\"utf-8\"") > 0) {
            throw new Exception("The challenge string's charset and " +
                "algorithm values must not be enclosed within quotes");
        }

        client.dispose();
        server.dispose();
    }
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:48,代碼來源:NoQuoteParams.java


注:本文中的javax.security.sasl.SaslServer.dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。