seal(_:using:nonce:authenticating:)
Secures the given plaintext message with encryption and an authentication tag that covers both the encrypted data and additional data.
Declaration
static func seal<Plaintext, AuthenticatedData>(_ message: Plaintext, using key: SymmetricKey, nonce: AES.GCM.Nonce? = nil, authenticating authenticatedData: AuthenticatedData) throws -> AES.GCM.SealedBox where Plaintext : DataProtocol, AuthenticatedData : 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().
- authenticatedData:
Additional data to be authenticated.
Return Value
The sealed message.