/*
 * Copyright (c) 2002-2011 JSCAPE
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 *  the terms of the license agreement you entered into with JSCAPE.
 */

package com.jscape.util.net.ssl;

import com.jscape.util.ArrayTools;

import javax.net.ssl.SSLEngine;

/**
 * @author Alex Usun
 */
public class SslEngineClientParameters {

    public final String[] enabledCipherSuites;

    public SslEngineClientParameters(String... enabledCipherSuites) {
        this.enabledCipherSuites = enabledCipherSuites;
    }

    public void setup(SSLEngine engine) {
        engine.setUseClientMode(true);

        if (this.enabledCipherSuites != null && this.enabledCipherSuites.length > 0) {
            engine.setEnabledCipherSuites(this.enabledCipherSuites);
        }
    }

    @Override
    public String toString() {
        return "SslEngineClientParameters {"
                + "enabledCipherSuites=" + ArrayTools.toString(this.enabledCipherSuites)
                + '}';
    }
}
