CryptoModule.legacyCryptoModule constructor

  1. @Deprecated('Use CryptoModule.aesCbcCryptoModule for new applications. This factory ' 'encrypts with the legacy cryptor and is retained only for ' 'backward compatibility.')
CryptoModule.legacyCryptoModule(
  1. CipherKey cipherKey, {
  2. dynamic defaultCryptoConfiguration = const CryptoConfiguration(),
})

Creates a CryptoModule that encrypts with the legacy cryptor.

New content is encrypted using the deprecated LegacyCryptor. Prefer CryptoModule.aesCbcCryptoModule, which encrypts with AesCbcCryptor while still decrypting legacy content.

Implementation

@Deprecated(
    'Use CryptoModule.aesCbcCryptoModule for new applications. This factory '
    'encrypts with the legacy cryptor and is retained only for '
    'backward compatibility.')
factory CryptoModule.legacyCryptoModule(CipherKey cipherKey,
    {defaultCryptoConfiguration = const CryptoConfiguration()}) {
  return CryptoModule(
      // ignore: deprecated_member_use_from_same_package
      defaultCryptor: LegacyCryptor(cipherKey,
          cryptoConfiguration: defaultCryptoConfiguration),
      cryptors: <ICryptor>[AesCbcCryptor(cipherKey)]);
}