---
title: "signature(for:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/p384/signing/privatekey/signature(for:)-wrsj"
---

# signature(for:)

Generates an Elliptic Curve Digital Signature Algorithm (ECDSA) signature of the digest you provide over the P-384 elliptic curve.

## Declaration

```swift
func signature<D>(for digest: D) throws -> P384.Signing.ECDSASignature where D : Digest
```

## Parameters

- `digest`: The digest of the data to sign.

## Return Value

Return Value The signature corresponding to the digest. The signing algorithm employs randomization to generate a different signature on every call, even for the same data and key.

## See Also

### Creating a signature

- [signature(for:)](cryptokit/p384/signing/privatekey/signature(for:)-8nncg.md)
- [P384.Signing.ECDSASignature](cryptokit/p384/signing/ecdsasignature.md)
