EVP_PKEY_CTX_SET1_PBE_PASS(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’… EVP_PKEY_CTX_SET1_PBE_PASS πŸ’…

okay so bestie, welcome to the 3ossl manual page for EVP_PKEY_CTX_set1_pbe_pass β€” yes that's a whole mouthful, yes I promise it's actually cute once you get it πŸŽ€


✨ NAME ✨

EVP_PKEY_CTX_set1_pbe_pass β€” the generic KDF support functions, aka the little helpers that every KDF algorithm gets to share πŸ’–


🌸 SYNOPSIS 🌸

#include <openssl/kdf.h>

int EVP_PKEY_CTX_set1_pbe_pass(EVP_PKEY_CTX *pctx, unsigned char *pass,
                               int passlen);

like, that's it. that's the whole vibe. πŸ¦‹


🧚 DESCRIPTION 🧚

okay so these functions are generic support functions for all KDF algorithms β€” no cap, they're the shared bestie squad that every KDF gets to borrow from ✨

  • EVP_PKEY_CTX_set1_pbe_pass() β€” sets the password to the passlen first bytes from pass. literally just the first passlen bytes. not more, not fewer. the way that it's so precise?? obsessed πŸ’…

πŸŽ€ STRING CTRLS πŸŽ€

there's also support for string based control operations via EVP_PKEY_CTX_ctrl_str(3) β€” and ngl this part is kinda iconic πŸ‘‘

so you can hand over the password in two different ways:

  • "pass" β€” the type parameter used to specify the password directly, like just type it out bestie πŸ“
  • "hexpass" β€” the type parameter used to give the password in hex encoding, for when you're feeling extra hexadecimal 🌈

πŸ’€ RETURN VALUES πŸ’€

all these functions return 1 for success and 0 or a negative value for failure. like yes, 0 is a fail, don't @ me 😭

and listen β€” in particular a return value of -2 indicates the operation is not supported by the public key algorithm. so if you get -2, it's not you, it's the algorithm. it just doesn't do that πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

go read them fr fr, they're the supporting cast and they ate πŸ’œ


⭐ HISTORY ⭐

EVP_PKEY_CTX_set1_pbe_pass() was converted from a macro to a function in OpenSSL 3.0. glow-up era honestly πŸ§šβ€β™€οΈβœ¨


Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page bestie 🫢 this was OpenSSL 3.5.6, dated 2026-04-07 β€” mwah, stan 3ossl, see you in the next manpage πŸ’–πŸ’…

πŸ“¦ where this page comes from