Type Method


Decrypts the message and verifies its authenticity.


static func open(_ sealedBox: ChaChaPoly.SealedBox, using key: SymmetricKey) throws -> Data



The sealed box to open.


The cryptographic key that was used to seal the message.

Return Value

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.

See Also

Decrypting and Verifying the Message

static func open<AuthenticatedData>(ChaChaPoly.SealedBox, using: SymmetricKey, authenticating: AuthenticatedData) -> Data

Decrypts the message and verifies the authenticity of both the encrypted message and additional data.