Structureswift-crypto 3.12.2_CryptoExtras->Crypto
SealedBox
AES_GCM_SIV.swift:124- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
struct SealedBox
struct SealedBox
import Crypto
A cryptography library for Swift.
import _CryptoExtras
Provides additional cryptographic APIs that are not available in CryptoKit (and therefore the core Crypto library).
enum _SIV
AES in GCM SIV mode with 128-bit tags.
enum AES
A container for Advanced Encryption Standard (AES) ciphers.
enum GCM
The Advanced Encryption Standard (AES) Galois Counter Mode (GCM) cipher suite.
static func open(_ sealedBox: SealedBox, using key: SymmetricKey) throws -> Data
Authenticates and decrypts data using AES-GCM-SIV.
static func open<AuthenticatedData>(_ sealedBox: SealedBox, using key: SymmetricKey, authenticating authenticatedData: AuthenticatedData) throws -> Data where AuthenticatedData : DataProtocol
Authenticates and decrypts data using AES-GCM-SIV.
static func seal<Plaintext>(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil) throws -> SealedBox where Plaintext : DataProtocol
Encrypts and authenticates data using AES-GCM-SIV.
static func seal<Plaintext, AuthenticatedData>(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil, authenticating authenticatedData: AuthenticatedData) throws -> SealedBox where Plaintext : DataProtocol, AuthenticatedData : DataProtocol
Encrypts and authenticates data using AES-GCM-SIV.
struct Nonce
protocol Sendable
init<D>(combined: D) throws where D : DataProtocol
init<C, T>(nonce: AES.GCM._SIV.Nonce, ciphertext: C, tag: T) throws where C : DataProtocol, T : DataProtocol
var ciphertext: Data { get }
The ciphertext
let combined: Data
The combined representation ( nonce || ciphertext || tag)
var nonce: AES.GCM._SIV.Nonce { get }
The Nonce
var tag: Data { get }
The authentication tag