Noise-C
|
Functions | |
int | noise_load_certificate_chain_from_buffer (Noise_CertificateChain **chain, NoiseProtobuf *pbuf) |
Loads a certificate chain from a protobuf. More... | |
int | noise_load_certificate_chain_from_file (Noise_CertificateChain **chain, const char *filename) |
Loads a certificate chain from a file. More... | |
int | noise_load_certificate_from_buffer (Noise_Certificate **cert, NoiseProtobuf *pbuf) |
Loads a certificate from a protobuf. More... | |
int | noise_load_certificate_from_file (Noise_Certificate **cert, const char *filename) |
Loads a certificate from a file. More... | |
int | noise_load_private_key_from_buffer (Noise_PrivateKey **key, NoiseProtobuf *pbuf, const void *passphrase, size_t passphrase_len) |
Loads a private key from a protobuf. More... | |
int | noise_load_private_key_from_file (Noise_PrivateKey **key, const char *filename, const void *passphrase, size_t passphrase_len) |
Loads a private key from a file. More... | |
int | noise_save_certificate_chain_to_buffer (const Noise_CertificateChain *chain, NoiseProtobuf *pbuf) |
Saves a certificate chain to a protobuf. More... | |
int | noise_save_certificate_chain_to_file (const Noise_CertificateChain *chain, const char *filename) |
Saves a certificate chain to a file. More... | |
int | noise_save_certificate_to_buffer (const Noise_Certificate *cert, NoiseProtobuf *pbuf) |
Saves a certificate to a protobuf. More... | |
int | noise_save_certificate_to_file (const Noise_Certificate *cert, const char *filename) |
Saves a certificate to a file. More... | |
int | noise_save_private_key_to_buffer (const Noise_PrivateKey *key, NoiseProtobuf *pbuf, const void *passphrase, size_t passphrase_len, const char *protect_name) |
Saves a private key in encrypted form to a protobuf. More... | |
int | noise_save_private_key_to_file (const Noise_PrivateKey *key, const char *filename, const void *passphrase, size_t passphrase_len, const char *protect_name) |
Saves a private key in encrypted form to a file. More... | |
int noise_load_certificate_chain_from_buffer | ( | Noise_CertificateChain ** | chain, |
NoiseProtobuf * | pbuf | ||
) |
Loads a certificate chain from a protobuf.
chain | Variable that returns the certificate chain if one is loaded. |
pbuf | The protobuf to load the certificate chain from. |
The certificate chain is expected to occupy the entire buffer. Trailing unknown data will be rejected as invalid.
If the buffer contains a certificate instead of a full chain, then this function will load the certificate and convert it into a chain containing a single certificate.
int noise_load_certificate_chain_from_file | ( | Noise_CertificateChain ** | chain, |
const char * | filename | ||
) |
Loads a certificate chain from a file.
chain | Variable that returns the certificate chain if one is loaded. |
filename | The name of the file to load the certificate chain from. |
The certificate chain is expected to occupy the entire file. Trailing unknown data will be rejected as invalid.
If the file contains a certificate instead of a full chain, then this function will load the certificate and convert it into a chain containing a single certificate.
int noise_load_certificate_from_buffer | ( | Noise_Certificate ** | cert, |
NoiseProtobuf * | pbuf | ||
) |
Loads a certificate from a protobuf.
cert | Variable that returns the certificate if one is loaded. |
pbuf | The protobuf to load the certificate from. |
The certificate is expected to occupy the entire buffer. Trailing unknown data will be rejected as invalid.
If the buffer contains a certificate chain, then this function will load the first certificate in the chain and discard the rest. No verification will be performed on the certificate even if the remaining certificates in the chain would allow verification.
int noise_load_certificate_from_file | ( | Noise_Certificate ** | cert, |
const char * | filename | ||
) |
Loads a certificate from a file.
cert | Variable that returns the certificate if one is loaded. |
filename | The name of the file to load the certificate from. |
The certificate is expected to occupy the entire file. Trailing unknown data will be rejected as invalid.
If the file contains a certificate chain, then this function will load the first certificate in the chain and discard the rest. No verification will be performed on the certificate even if the remaining certificates in the chain would allow verification.
int noise_load_private_key_from_buffer | ( | Noise_PrivateKey ** | key, |
NoiseProtobuf * | pbuf, | ||
const void * | passphrase, | ||
size_t | passphrase_len | ||
) |
Loads a private key from a protobuf.
key | Variable that returns the private key if one is loaded. |
pbuf | The protobuf to load the private key from. |
passphrase | Points to the passphrase to use to unlock the private key. |
passphrase_len | Length of the passphrase in bytes. |
The private key is expected to occupy the entire buffer. Trailing unknown data will be rejected as invalid.
int noise_load_private_key_from_file | ( | Noise_PrivateKey ** | key, |
const char * | filename, | ||
const void * | passphrase, | ||
size_t | passphrase_len | ||
) |
Loads a private key from a file.
key | Variable that returns the private key if one is loaded. |
filename | The name of the file to load the private key from. |
passphrase | Points to the passphrase to use to unlock the private key. |
passphrase_len | Length of the passphrase in bytes. |
The private key is expected to occupy the entire buffer. Trailing unknown data will be rejected as invalid.
int noise_save_certificate_chain_to_buffer | ( | const Noise_CertificateChain * | chain, |
NoiseProtobuf * | pbuf | ||
) |
Saves a certificate chain to a protobuf.
chain | The certificate chain to be saved. |
pbuf | The protobuf to save the certificate chain to. |
int noise_save_certificate_chain_to_file | ( | const Noise_CertificateChain * | chain, |
const char * | filename | ||
) |
Saves a certificate chain to a file.
chain | The certificate chain to be saved. |
filename | The name of the file to save the certificate chain to. |
int noise_save_certificate_to_buffer | ( | const Noise_Certificate * | cert, |
NoiseProtobuf * | pbuf | ||
) |
Saves a certificate to a protobuf.
cert | The certificate to be saved. |
pbuf | The protobuf to save the certificate to. |
int noise_save_certificate_to_file | ( | const Noise_Certificate * | cert, |
const char * | filename | ||
) |
Saves a certificate to a file.
cert | The certificate to be saved. |
filename | The name of the file to save the certificate to. |
int noise_save_private_key_to_buffer | ( | const Noise_PrivateKey * | key, |
NoiseProtobuf * | pbuf, | ||
const void * | passphrase, | ||
size_t | passphrase_len, | ||
const char * | protect_name | ||
) |
Saves a private key in encrypted form to a protobuf.
key | The private key to be saved. |
pbuf | The protobuf to write the encrypted data to. |
passphrase | Points to the passphrase to use to encrypt the private key. |
passphrase_len | Length of the passphrase in bytes. |
protect_name | The name of the algorithm to use to protect the private key; e.g. "ChaChaPoly_BLAKE2b_PBKDF2". |
int noise_save_private_key_to_file | ( | const Noise_PrivateKey * | key, |
const char * | filename, | ||
const void * | passphrase, | ||
size_t | passphrase_len, | ||
const char * | protect_name | ||
) |
Saves a private key in encrypted form to a file.
key | The private key to be saved. |
filename | The name of the file to save to. |
passphrase | Points to the passphrase to use to encrypt the private key. |
passphrase_len | Length of the passphrase in bytes. |
protect_name | The name of the algorithm to use to protect the private key; e.g. "ChaChaPoly_BLAKE2b_PBKDF2". |