---
name: "pskc_set_key_data_b64secret"
section: "3"
platform: "linux"
package: "oath-toolkit"
version: "2.6.15-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pskc_set_key_data_b64secret"
---

# pskc\_set\_key\_data\_b64secret(3)

API function

## NAME

pskc\_set\_key\_data\_b64secret - API function

## SYNOPSIS

**#include \<pskc.h\>**

**int pskc\_set\_key\_data\_b64secret(pskc\_key\_t \*** *key***, const char \*** *b64secret***);**

## ARGUMENTS

- pskc\_key\_t \* key

  a **pskc\_key\_t** handle, from **pskc\_get\_keypackage()**.

- const char \* b64secret

  the base64 encoded secret to set.

## DESCRIPTION

Set the PSKC KeyPackage Key Data Secret value in base64 as a zero-terminated string.  The *b64secret* data is copied into the *key* handle, so you may modify or deallocate the *b64secret* pointer after calling this function.  The data is base64 decoded by this function to verify data validity.  On errors, the old secret is not modified.

## RETURNS

**PSKC\_BASE64\_ERROR** on base64 decoding errors, **PSKC\_MALLOC\_ERROR** on memory allocation errors, or **PSKC\_OK** on success.

## SINCE

2\.2.0

## REPORTING BUGS

Report bugs to \<oath-toolkit-help@nongnu.org\>. libpskc home page: https://oath-toolkit.codeberg.page/ General help using GNU software: http://www.gnu.org/gethelp/

## COPYRIGHT

Copyright © 2009-2026 Simon Josefsson.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
