Static Methodswift-crypto 3.8.0Crypto
seal(_:using:nonce:)
Secures the given plaintext message with encryption and an authentication tag.
AES-GCM.swift:58static func seal<Plaintext>(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil) throws -> SealedBox where Plaintext : DataProtocol
Parameters
Returns
The sealed message.
Other members in extension
Types
struct Nonce
A value used once during a cryptographic operation and then discarded.
struct SealedBox
A secure container for your data that you can access using a cipher.
Type members
static func open(SealedBox, using: SymmetricKey
) throws -> Data Decrypts the message and verifies its authenticity.
static func open<AuthenticatedData>(SealedBox, using: SymmetricKey, authenticating: AuthenticatedData
) throws -> Data Decrypts the message and verifies the authenticity of both the encrypted message and additional data.
static func seal<Plaintext, AuthenticatedData>(Plaintext, using: SymmetricKey, nonce: Nonce?, authenticating: AuthenticatedData
) throws -> SealedBox Secures the given plaintext message with encryption and an authentication tag that covers both the encrypted data and additional data.