<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleArchive",
  "identifier" : "/documentation/AppleArchive/ArchiveEncryptionContext/decryptAttributes()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple Archive",
      "AppleArchive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B17EncryptionContextC17decryptAttributesSbyF"
  },
  "title" : "decryptAttributes()"
}
-->

# decryptAttributes()

Validates decryption keys, collects archive attributes, and updates the context with decrypted archive attributes.

```
func decryptAttributes() -> Bool
```

## Return Value

`true` on success; otherwise, `false` if the credentials and archive prologue don’t match.

## Discussion

You must have created the current context from an encrypted stream.

Apple Archive performs the same validation and updates when it opens a decryption input stream. Therefore, you don’t need to call this function before calling either [`decryptionStream(readingFrom:encryptionContext:flags:threadCount:)`](/documentation/AppleArchive/ArchiveByteStream/decryptionStream(readingFrom:encryptionContext:flags:threadCount:)) or [`randomAccessDecryptionStream(readingFrom:encryptionContext:allocationLimit:flags:threadCount:)`](/documentation/AppleArchive/ArchiveByteStream/randomAccessDecryptionStream(readingFrom:encryptionContext:allocationLimit:flags:threadCount:)).

---

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)