#certificate #private-key #x509 #tls #security #encryption #spoofing

certificate_manager

A library for managing and spoofing X.509 certificates

1 unstable release

new 0.2.0 Jan 27, 2025

#1981 in Cryptography

25 downloads per month

Apache-2.0

28KB
271 lines

Certificate Authority Loader

==========================

A Rust library for loading Certificate Authorities (CAs) from PEM formatted files.

Overview

This library provides a simple and secure way to load Certificate Authorities from PEM files. It supports loading CAs with encrypted private keys, using a provided passphrase.

Features

  • Loads CA certificates and private keys from PEM files
  • Supports encrypted private keys with passphrase decryption
  • Returns a CertificateAuthority struct containing the loaded certificate and private key

Usage

To use this library, add the following dependency to your Cargo.toml file:

[dependencies]
certificate_manager = "0.1.0"

Then, use the load_from_pem_files function to load a CA from PEM files:

use certificate_manager::certificate::CertificateAuthority;

let cert_file = "path/to/ca_cert.pem";
let key_file = "path/to/ca_key.pem";
let passphrase = Some("my_secret_passphrase".to_string());

let ca = CertificateAuthority::load_from_pem_files(cert_file, key_file, passphrase)
    .expect("Failed to load CA");

API Documentation

The load_from_pem_files function is documented with detailed information on its arguments, return values, and error handling.

Contributing

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request.

License

This library is licensed under the MIT License. See the LICENSE file for details.

Dependencies

~73MB
~2M SLoC