android-components / mozilla.components.lib.dataprotect / Keystore / encryptBytes

# encryptBytes

`open fun encryptBytes(plain: ByteArray): ByteArray` (source)

Encrypts data using the managed key.

The output of this method includes the input factors (i.e., initialization vector), ciphertext, and authentication tag as a single byte string; this output can be passed directly to decryptBytes.

### Parameters

`plain` - The "plaintext" data to encrypt

### Exceptions

`GeneralSecurityException` - If the data could not be encrypted

Return
The encrypted data to be stored