Static Methodswift-crypto 3.8.0Crypto
open(_:using:)
Decrypts the message and verifies its authenticity.
AES-GCM.swift:88static func open(_ sealedBox: SealedBox, using key: SymmetricKey) throws -> Data
Parameters
Returns
The original plaintext message that was sealed in the box, as long as the correct key is used and authentication succeeds. The call throws an error if decryption or authentication fail.
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<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>(Plaintext, using: SymmetricKey, nonce: Nonce?
) throws -> SealedBox Secures the given plaintext message with encryption and an authentication tag.
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.