Functions | Variables
pkcs8.c File Reference
#include <openssl/pkcs8.h>
#include <assert.h>
#include <limits.h>
#include <string.h>
#include <openssl/bytestring.h>
#include <openssl/cipher.h>
#include <openssl/digest.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include <openssl/nid.h>
#include <openssl/rand.h>
#include "internal.h"
#include "../bytestring/internal.h"
#include "../internal.h"
Include dependency graph for pkcs8.c:

Go to the source code of this file.

Functions

static const struct pbe_suiteget_pkcs12_pbe_suite (int pbe_nid)
 
static int pkcs12_encode_password (const char *in, size_t in_len, uint8_t **out, size_t *out_len)
 
int pkcs12_key_gen (const char *pass, size_t pass_len, const uint8_t *salt, size_t salt_len, uint8_t id, unsigned iterations, size_t out_len, uint8_t *out, const EVP_MD *md)
 
static int pkcs12_pbe_cipher_init (const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, unsigned iterations, const char *pass, size_t pass_len, const uint8_t *salt, size_t salt_len, int is_encrypt)
 
static int pkcs12_pbe_decrypt_init (const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, const char *pass, size_t pass_len, CBS *param)
 
int pkcs12_pbe_encrypt_init (CBB *out, EVP_CIPHER_CTX *ctx, int alg, unsigned iterations, const char *pass, size_t pass_len, const uint8_t *salt, size_t salt_len)
 
int PKCS8_marshal_encrypted_private_key (CBB *out, int pbe_nid, const EVP_CIPHER *cipher, const char *pass, size_t pass_len, const uint8_t *salt, size_t salt_len, int iterations, const EVP_PKEY *pkey)
 
EVP_PKEYPKCS8_parse_encrypted_private_key (CBS *cbs, const char *pass, size_t pass_len)
 
int pkcs8_pbe_decrypt (uint8_t **out, size_t *out_len, CBS *algorithm, const char *pass, size_t pass_len, const uint8_t *in, size_t in_len)
 

Variables

static const struct pbe_suite kBuiltinPBE []
 

Function Documentation

◆ get_pkcs12_pbe_suite()

static const struct pbe_suite* get_pkcs12_pbe_suite ( int  pbe_nid)
static

Definition at line 320 of file pkcs8.c.

◆ pkcs12_encode_password()

static int pkcs12_encode_password ( const char *  in,
size_t  in_len,
uint8_t **  out,
size_t *  out_len 
)
static

Definition at line 75 of file pkcs8.c.

◆ pkcs12_key_gen()

int pkcs12_key_gen ( const char *  pass,
size_t  pass_len,
const uint8_t salt,
size_t  salt_len,
uint8_t  id,
unsigned  iterations,
size_t  out_len,
uint8_t out,
const EVP_MD md 
)

Definition at line 109 of file pkcs8.c.

◆ pkcs12_pbe_cipher_init()

static int pkcs12_pbe_cipher_init ( const struct pbe_suite suite,
EVP_CIPHER_CTX ctx,
unsigned  iterations,
const char *  pass,
size_t  pass_len,
const uint8_t salt,
size_t  salt_len,
int  is_encrypt 
)
static

Definition at line 233 of file pkcs8.c.

◆ pkcs12_pbe_decrypt_init()

static int pkcs12_pbe_decrypt_init ( const struct pbe_suite suite,
EVP_CIPHER_CTX ctx,
const char *  pass,
size_t  pass_len,
CBS param 
)
static

Definition at line 257 of file pkcs8.c.

◆ pkcs12_pbe_encrypt_init()

int pkcs12_pbe_encrypt_init ( CBB out,
EVP_CIPHER_CTX ctx,
int  alg,
unsigned  iterations,
const char *  pass,
size_t  pass_len,
const uint8_t salt,
size_t  salt_len 
)

Definition at line 333 of file pkcs8.c.

◆ PKCS8_marshal_encrypted_private_key()

int PKCS8_marshal_encrypted_private_key ( CBB out,
int  pbe_nid,
const EVP_CIPHER cipher,
const char *  pass,
size_t  pass_len,
const uint8_t salt,
size_t  salt_len,
int  iterations,
const EVP_PKEY pkey 
)

Definition at line 445 of file pkcs8.c.

◆ PKCS8_parse_encrypted_private_key()

EVP_PKEY* PKCS8_parse_encrypted_private_key ( CBS cbs,
const char *  pass,
size_t  pass_len 
)

Definition at line 419 of file pkcs8.c.

◆ pkcs8_pbe_decrypt()

int pkcs8_pbe_decrypt ( uint8_t **  out,
size_t *  out_len,
CBS algorithm,
const char *  pass,
size_t  pass_len,
const uint8_t in,
size_t  in_len 
)

Definition at line 360 of file pkcs8.c.

Variable Documentation

◆ kBuiltinPBE

const struct pbe_suite kBuiltinPBE[]
static

Definition at line 281 of file pkcs8.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:26