コード例 #1
0
ファイル: UnitTest.cs プロジェクト: vbprofi/UWPX-Client
        public void TestScramSHA1SASLMechanism_4()
        {
            ScramSHA1SASLMechanism     mechanism = new ScramSHA1SASLMechanism("user", "pencil", "fyko+d2lbbFgONRv9qkxdawL");
            SelectSASLMechanismMessage msg       = mechanism.getSelectSASLMechanismMessage();
            MessageParser2             parser    = new MessageParser2();
            List <AbstractMessage>     msgs      = parser.parseMessages("<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1meWtvK2QybGJiRmdPTlJ2OXFreGRhd0wzcmZjTkhZSlkxWlZ2V1ZzN2oscz1RU1hDUitRNnNlazhiZjkyLGk9NDA5Ng==</challenge>");
            ScramSHA1ChallengeMessage  challenge = (ScramSHA1ChallengeMessage)msgs[0];
            AbstractMessage            resp      = mechanism.generateResponse(challenge);

            Assert.IsTrue(resp is ScramSha1ChallengeSolutionMessage);
        }
コード例 #2
0
ファイル: UnitTest.cs プロジェクト: vbprofi/UWPX-Client
        public void TestScramSHA1SASLMechanism_5()
        {
            ScramSHA1SASLMechanism            mechanism = new ScramSHA1SASLMechanism("user", "pencil", "fyko+d2lbbFgONRv9qkxdawL");
            SelectSASLMechanismMessage        msg       = mechanism.getSelectSASLMechanismMessage();
            MessageParser2                    parser    = new MessageParser2();
            List <AbstractMessage>            msgs      = parser.parseMessages("<challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cj1meWtvK2QybGJiRmdPTlJ2OXFreGRhd0wzcmZjTkhZSlkxWlZ2V1ZzN2oscz1RU1hDUitRNnNlazhiZjkyLGk9NDA5Ng==</challenge>");
            ScramSHA1ChallengeMessage         challenge = (ScramSHA1ChallengeMessage)msgs[0];
            AbstractMessage                   resp      = mechanism.generateResponse(challenge);
            ScramSha1ChallengeSolutionMessage respMsg   = (ScramSha1ChallengeSolutionMessage)resp;

            Assert.IsTrue(string.Equals("Yz1iaXdzLHI9ZnlrbytkMmxiYkZnT05Sdjlxa3hkYXdMM3JmY05IWUpZMVpWdldWczdqLHA9djBYOHYzQnoyVDBDSkdiSlF5RjBYK0hJNFRzPQ==".ToLower(), respMsg.SOLUTION.ToLower()));
        }