---
title: "setSigningPublicKey(_:)"
framework: applearchive
role: symbol
role_heading: Instance Method
path: "applearchive/archiveencryptioncontext/setsigningpublickey(_:)"
---

# setSigningPublicKey(_:)

Sets the signing public key that the context requires to unlock a signed archive.

## Declaration

```swift
func setSigningPublicKey(_ key: P256.Signing.PublicKey) throws
```

## Parameters

- `key`: The recipient public key.

## Discussion

Discussion The public signing key is necessary to unlock a signed archive. If you don’t provide a private key when you create a new archive, provide a public key to tie the encryption to the signing identity. In this case, you need to sign the archive offline using the corresponding signing private key.

## See Also

### Setting and retrieving keys

- [mainKey](applearchive/archiveencryptioncontext/mainkey.md)
- [symmetricKey](applearchive/archiveencryptioncontext/symmetrickey.md)
- [generateSymmetricKey()](applearchive/archiveencryptioncontext/generatesymmetrickey().md)
- [setSymmetricKey(_:)](applearchive/archiveencryptioncontext/setsymmetrickey(_:).md)
- [setRecipientPrivateKey(_:)](applearchive/archiveencryptioncontext/setrecipientprivatekey(_:).md)
- [setSigningPrivateKey(_:)](applearchive/archiveencryptioncontext/setsigningprivatekey(_:).md)
- [setRecipientPublicKey(_:)](applearchive/archiveencryptioncontext/setrecipientpublickey(_:).md)
