Exemplo n.º 1
0
        /// <summary>
        /// Register a cryptograph class for this client to encrypt and decrypt packaged send and receive
        /// </summary>
        /// <typeparam name="T">The object crypt</typeparam>
        /// <param name="crypt">The object crypt</param>
        public void RegisterCrypt <T>(T crypt)
        {
            if (!crypt.GetType().IsSubclassOf(typeof(AbstractCrypt)))
            {
                throw new Exception("The object of crypt is invalid, needs extends class DarkKnight.Crypt.AbstractCrypt");
            }

            cryptProvider.registerCrypt(crypt);
        }