static func open(_ sealedBox: ChaChaPoly.SealedBox, using key: SymmetricKey) throws -> Data
Decrypts the message and verifies its authenticity.
- Parameters:
- sealedBox: The sealed box to open.
- key: The cryptographic key that was used to seal the message.
- 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.
static func open<AuthenticatedData>(_ sealedBox: ChaChaPoly.SealedBox, using key: SymmetricKey, authenticating authenticatedData: AuthenticatedData) throws -> Data where AuthenticatedData : DataProtocol
Decrypts the message and verifies the authenticity of both the encrypted
message and additional data.
- Parameters:
- sealedBox: The sealed box to open.
- key: The cryptographic key that was used to seal the message.
- authenticatedData: Additional data that was authenticated.
- 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.
Secures the given plaintext message with encryption and an
authentication tag that covers both the encrypted data and additional
data.
- Parameters:
- 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 ``ChaChaPoly/Nonce/init()``.
- authenticatedData: Additional data to be authenticated.
- Returns: The sealed message.
static func seal<Plaintext>(_ message: Plaintext, using key: SymmetricKey, nonce: ChaChaPoly.Nonce? = nil) throws -> ChaChaPoly.SealedBox where Plaintext : DataProtocol
Secures the given plaintext message with encryption and an
authentication tag.
- Parameters:
- 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 ``ChaChaPoly/Nonce/init()``.
- Returns: The sealed message.
Skipped declarations
2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.