|
Java example source code file (NoQuoteParams.java)
The NoQuoteParams.java Java example source code/* * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 6287172 * @summary SASL + Digest-MD5, charset quoted */ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.Map; import java.util.TreeMap; import java.util.logging.Logger; import javax.security.auth.callback.Callback; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.PasswordCallback; import javax.security.auth.callback.UnsupportedCallbackException; import javax.security.sasl.RealmCallback; import javax.security.sasl.Sasl; import javax.security.sasl.SaslClient; import javax.security.sasl.SaslException; import javax.security.sasl.SaslServer; import javax.security.auth.callback.CallbackHandler; import com.sun.security.auth.callback.DialogCallbackHandler; import com.sun.security.auth.callback.TextCallbackHandler; /* * According to RFC 2831, DIGEST-MD5 servers must generate challenge strings * whose charset and algorithm values are not enclosed within quotes. * For example, * challenge: realm="127.0.0.1",nonce="8GBOabRGeIqZB5BiaYJ1NDTuteV+D7n+qbSTH1fo",qop="auth",charset=utf-8,algorithm=md5-sess */ public class NoQuoteParams { private static Logger logger = Logger.getLogger("global"); private static final String DIGEST_MD5 = "DIGEST-MD5"; private static final byte[] EMPTY = new byte[0]; private static CallbackHandler authCallbackHandler = new SampleCallbackHandler(); public static void main(String[] args) throws Exception { Map<String, String> props = new TreeMap Other Java examples (source code examples)Here is a short list of links related to this Java NoQuoteParams.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.