open(_:using:)

    Decrypts the message and verifies its authenticity.

    AES-GCM.swift:88
    static func open(_ sealedBox: SealedBox, using key: SymmetricKey) throws -> Data

    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.

    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