Java Security extractDirective(HashMap map, String key, String value)

Here you can find the source of extractDirective(HashMap map, String key, String value)

Description

Processes directive/value pairs from the digest-challenge and fill out the provided map.

License

Open Source License

Parameter

Parameter Description
key A non-null String challenge token name.
value A non-null String token value.

Exception

Parameter Description
SaslException if either the key or the value is null orif the key already has a value.

Declaration

private static void extractDirective(HashMap<String, String> map,
        String key, String value) throws SaslException 

Method Source Code

//package com.java2s;
/**//w w w. j  a va2s .co  m
 * Copyright 2007-2016, Kaazing Corporation. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.HashMap;

import javax.security.sasl.SaslException;

public class Main {
    /**
     * Processes directive/value pairs from the digest-challenge and
     * fill out the provided map.
     * 
     * @param key A non-null String challenge token name.
     * @param value A non-null String token value.
     * @throws SaslException if either the key or the value is null or
     * if the key already has a value. 
     */
    private static void extractDirective(HashMap<String, String> map,
            String key, String value) throws SaslException {
        if (map.get(key) != null) {
            throw new SaslException("Peer sent more than one " + key
                    + " directive");
        }

        map.put(key, value);
    }
}

Related

  1. checkDoAsPermission()
  2. checkPolicy(int flags, Map props)
  3. cloneKerberosTicket(KerberosTicket kerberosTicket)
  4. convertLegacyToRFC2253(String dn)
  5. credsToTicket(Credentials serviceCreds)
  6. filterMechs(String[] mechs, int[] policies, Map props)
  7. get(Configuration configuration, String section, String key)
  8. getCommonName(String name)
  9. getDirectiveValue( HashMap directivesMap, String directive, boolean mandatory)