---
title: isLocked
framework: pdfkit
role: symbol
role_heading: Instance Property
path: pdfkit/pdfdocument/islocked
---

# isLocked

A Boolean value indicating whether the document is locked.

## Declaration

```swift
var isLocked: Bool { get }
```

## Return Value

Return Value true if the document is locked; false otherwise.

## Discussion

Discussion Only encrypted documents can be locked. Encrypted documents whose password is the empty string are unlocked automatically upon opening, because PDF Kit tries the empty string as a password if none is supplied. Use the unlock(withPassword:) method to unlock a document using a password.

## See Also

### Managing Document Security

- [isEncrypted](pdfkit/pdfdocument/isencrypted.md)
- [unlock(withPassword:)](pdfkit/pdfdocument/unlock(withpassword:).md)
- [permissionsStatus](pdfkit/pdfdocument/permissionsstatus.md)
- [Permission Properties](pdfkit/permission-properties.md)
