---
title: "signature(for:context:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/mldsa87/privatekey/signature(for:context:)"
---

# signature(for:context:)

Generates a MLDSA87 signature, with context.

## Declaration

```swift
func signature<D, C>(for data: D, context: C) throws -> Data where D : DataProtocol, C : DataProtocol
```

## Parameters

- `data`: The data to sign.
- `context`: Context for the signature.

## Return Value

Return Value The MLDSA87 signature. This method throws if CryptoKit encounters an error producing the signature.

## See Also

### Signing data

- [signature(for:)](cryptokit/mldsa87/privatekey/signature(for:).md)
