---
title: decryptAttributes()
framework: applearchive
role: symbol
role_heading: Instance Method
path: applearchive/archiveencryptioncontext/decryptattributes()
---

# decryptAttributes()

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

## Declaration

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

## Return Value

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

## Discussion

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:) or randomAccessDecryptionStream(readingFrom:encryptionContext:allocationLimit:flags:threadCount:).

## See Also

### Getting and setting encryption context properties

- [archiveIdentifier](applearchive/archiveencryptioncontext/archiveidentifier.md)
- [authData](applearchive/archiveencryptioncontext/authdata.md)
- [checksumMode](applearchive/archiveencryptioncontext/checksummode-swift.property.md)
- [ArchiveEncryptionContext.ChecksumMode](applearchive/archiveencryptioncontext/checksummode-swift.struct.md)
- [containerSize](applearchive/archiveencryptioncontext/containersize.md)
- [encryptionMode](applearchive/archiveencryptioncontext/encryptionmode-swift.property.md)
- [ArchiveEncryptionContext.EncryptionMode](applearchive/archiveencryptioncontext/encryptionmode-swift.struct.md)
- [compressionAlgorithm](applearchive/archiveencryptioncontext/compressionalgorithm.md)
- [ArchiveCompression](applearchive/archivecompression.md)
- [compressionBlockSize](applearchive/archiveencryptioncontext/compressionblocksize.md)
- [paddingSize](applearchive/archiveencryptioncontext/paddingsize.md)
- [profile](applearchive/archiveencryptioncontext/profile-swift.property.md)
- [ArchiveEncryptionContext.Profile](applearchive/archiveencryptioncontext/profile-swift.struct.md)
- [rawSize](applearchive/archiveencryptioncontext/rawsize.md)
- [signatureEncryptionKey](applearchive/archiveencryptioncontext/signatureencryptionkey.md)
