seal(_:using:nonce:)
Secures the given plaintext message with encryption and an authentication tag.
Declaration
static func seal<Plaintext>(_ message: Plaintext, using key: SymmetricKey, nonce: ChaChaPoly.Nonce? = nil) throws -> ChaChaPoly.SealedBox where Plaintext : DataProtocolParameters
- message:
The plaintext data to seal.
- key:
A cryptographic key used to seal the message.
- nonce:
The nonce the sealing process requires. If you don’t provide a nonce, the method generates a random one by invoking Init().
Return Value
The sealed message.