<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/AES/GCM/seal(inPlace:using:nonce:authenticating:tag:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit3AESO3GCMO4seal7inPlace5using5nonce14authenticating3tagys14MutableRawSpanVz_AA12SymmetricKeyVAE5NonceVs0mN0VSgs06OutputmN0VztKFZ"
  },
  "title" : "seal(inPlace:using:nonce:authenticating:tag:)"
}
-->

# seal(inPlace:using:nonce:authenticating:tag:)

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

```
static func seal(inPlace message: inout MutableRawSpan, using key: SymmetricKey, nonce: AES.GCM.Nonce, authenticating authenticatedData: RawSpan? = nil, tag: inout OutputRawSpan) throws
```

## Parameters

`message`

The plaintext data to seal, which will be updated in place.

`key`

A cryptographic key used to seal the message.

`nonce`

The nonce the sealing process requires.

`authenticatedData`

Additional data to be authenticated, if provided.

`tag`

receives the 16-byte authentication tag

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)