---
title: "sec_protocol_metadata_create_secret(_:_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/sec_protocol_metadata_create_secret(_:_:_:_:)"
---

# sec_protocol_metadata_create_secret(_:_:_:_:)

## Declaration

```swift
func sec_protocol_metadata_create_secret(_ metadata: sec_protocol_metadata_t, _ label_len: Int, _ label: UnsafePointer<CChar>, _ exporter_length: Int) -> dispatch_data_t?
```

## Parameters

- `metadata`: A sec_protocol_metadata_t instance.
- `label_len`: Length of the KDF label string.
- `label`: KDF label string.
- `exporter_length`: Length of the secret to be exported.

## Return Value

Return Value Returns a dispatch_data_t object carrying the exported secret.

## Discussion

Discussion Export a secret, e.g., a cryptographic key, derived from the protocol metadata using a label string.
