package com.jscape.util.net.socket;

import javax.net.ssl.SSLSocket;

/**
 * @author Alex Usun
 */
public enum ClientAuthenticationNecessity {

    NOT_REQUIRED() {
        @Override
        public void applyTo(SSLSocket socket) {
            // empty
        }
    },
    REQUIRED() {
        @Override
        public void applyTo(SSLSocket socket) {
            socket.setNeedClientAuth(true);
        }
    },
    DESIRED() {
        @Override
        public void applyTo(SSLSocket socket) {
            socket.setWantClientAuth(true);
        }
    };

    public abstract void applyTo(SSLSocket socket);
}
