Create() публичный статический Метод

public static Create ( EncryptionType type ) : Encryptor
type EncryptionType
Результат Encryptor
Пример #1
0
        bool createEncryptor(EncryptionType type)
        {
            Encryptor encryptor = Encryptor.Create(type);

            if (encryptor == null)
            {
                LogWarning("Failed to create encryptor: {0}", type);
                return(false);
            }

            encryptors_[type] = encryptor;

            if (default_encryptor_ == EncryptionType.kNoneEncryption)
            {
                setDefaultEncryption(type);
            }

            return(true);
        }
Пример #2
0
        bool createEncryptor(EncryptionType type)
        {
            if (encryptors_.ContainsKey(type))
            {
                return(true);
            }

            Encryptor encryptor = Encryptor.Create(type);

            if (encryptor == null)
            {
                LogWarning("Encryptor - Failed to create '{0}' encryptor", type);
                return(false);
            }

            encryptors_[type] = encryptor;

            if (default_encryptor_ == EncryptionType.kNoneEncryption)
            {
                setDefaultEncryption(type);
            }

            return(true);
        }