package com.jscape.inet.ssh.protocol.v2.marshaling.keys;

import com.jscape.inet.ssh.protocol.v2.messages.PublicKeyAlgorithm;

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

    public static SignatureCodec init(SignatureCodec codec) {
        for (PublicKeyAlgorithm value : PublicKeyAlgorithm.values()) {
            switch (value.keyAlgorithm) {
                case "RSA":
                    codec.set(new SignatureCodec.Entry(value.identifier, new RsaSignatureCodec()));
                    break;
                case "DSA":
                    codec.set(new SignatureCodec.Entry(value.identifier, new DsaSignatureCodec()));
                    break;
                case "EC":
                    codec.set(new SignatureCodec.Entry(value.identifier, new EcSignatureCodec()));
                    break;
                default:
                    break;
            }
        }

        return codec;
    }

    private SignatureCodecs() {
        // empty
    }
}
