Create() public static method

public static Create ( EncryptionType type ) : Encryptor
type EncryptionType
return Encryptor
Example #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);
        }
Example #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);
        }