seal(_:using:nonce:)

    Secures the given plaintext message with encryption and an authentication tag.

    AES-GCM.swift:58
    static func seal<Plaintext>(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil) throws -> SealedBox where Plaintext : DataProtocol

    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 AES.GCM.Nonce.

    Returns

    The sealed message.

    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