Files
headlamp-sealed-secrets-plugin/docs/api-reference/generated/hooks/useSealedSecretEncryption/functions/useSealedSecretEncryption.md
T
Chris Farhood 46d59b48b5 chore: migrate repository to privilegedescalation organization
Updated all GitHub URLs from cpfarhood to privilegedescalation organization:
- Repository URLs in package.json and Artifact Hub metadata
- Documentation links and references
- Git remote updated

No functional changes - this is purely an organizational migration.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-02-12 10:50:30 -05:00

58 lines
1.5 KiB
Markdown

[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
***
[Headlamp Sealed Secrets API](../../../README.md) / [hooks/useSealedSecretEncryption](../README.md) / useSealedSecretEncryption
# Function: useSealedSecretEncryption()
> **useSealedSecretEncryption**(): `object`
Defined in: [src/hooks/useSealedSecretEncryption.ts:73](https://github.com/privilegedescalation/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/hooks/useSealedSecretEncryption.ts#L73)
Custom hook for SealedSecret encryption
Provides encryption functionality with built-in validation, error handling,
and user notifications.
## Returns
`object`
Object with encrypt function and encrypting state
### encrypt()
> **encrypt**: (`request`) => [`AsyncResult`](../../../types/type-aliases/AsyncResult.md)\<[`EncryptionResult`](../interfaces/EncryptionResult.md), `string`\>
#### Parameters
##### request
[`EncryptionRequest`](../interfaces/EncryptionRequest.md)
#### Returns
[`AsyncResult`](../../../types/type-aliases/AsyncResult.md)\<[`EncryptionResult`](../interfaces/EncryptionResult.md), `string`\>
### encrypting
> **encrypting**: `boolean`
## Example
```ts
const { encrypt, encrypting } = useSealedSecretEncryption();
const result = await encrypt({
name: 'my-secret',
namespace: 'default',
scope: 'strict',
keyValues: [{ key: 'password', value: 'secret123' }]
});
if (result.ok) {
// Use result.value.sealedSecretData
}
```