rust-native-tls alternatives and similar packages
Based on the "Cryptography" category.
Alternatively, view rust-native-tls alternatives based on common mentions on social networks and blogs.
-
Ockam
Build secure-by-design applications that can Trust Data-in-Motion. Orchestrate end-to-end encryption, mutual authentication, key management, credential management & authorization policy enforcement โ at scale. -
rust-crypto
A (mostly) pure-Rust implementation of various cryptographic algorithms. -
exonum
An extensible open-source framework for creating private/permissioned blockchain applications -
curve25519-dalek
A pure-Rust implementation of group operations on Ristretto and Curve25519 -
ed25519-dalek
Fast and efficient ed25519 signing and verification in Rust. -
sodiumoxide
[DEPRECATED] Sodium Oxide: Fast cryptographic library for Rust (bindings to libsodium) -
miscreant
Meta-repository for Miscreant: misuse-resistant symmetric encryption library with AES-SIV (RFC 5297) and AES-PMAC-SIV support -
RustCrypto
Authenticated Encryption with Associated Data Algorithms: high-level encryption ciphers -
RustCrypto Elliptic Curves
Collection of pure Rust elliptic curve implementations: NIST P-256, P-384, secp256k1 -
orion
Usable, easy and safe pure-Rust crypto [Moved to: https://github.com/orion-rs/orion] -
rust-security-framework
Bindings to the macOS Security.framework -
recrypt
A set of cryptographic primitives for building a multi-hop Proxy Re-encryption scheme, known as Transform Encryption. -
Roughenough
A Roughtime secure time sync client and server written in Rust -
schannel-rs
Schannel API-bindings for rust (provides an interface for native SSL/TLS using windows APIs) -
rust-djangohashers
A Rust port of the password primitives used in Django Project. -
rustotpony
๐ด RusTOTPony โ CLI manager of one-time password generators aka Google Authenticator -
rncryptor-rs
Pure Rust implementation of the RNCryptor cryptographic format by Rob Napier
Clean code begins in your IDE with SonarLint
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of rust-native-tls or a related project?
README
rust-native-tls
An abstraction over platform-specific TLS implementations.
Specifically, this crate uses SChannel on Windows (via the schannel
crate),
Secure Transport on macOS (via the security-framework
crate), and OpenSSL (via
the openssl
crate) on all other platforms.
Installation
# Cargo.toml
[dependencies]
native-tls = "0.2"
Usage
An example client looks like:
extern crate native_tls;
use native_tls::TlsConnector;
use std::io::{Read, Write};
use std::net::TcpStream;
fn main() {
let connector = TlsConnector::new().unwrap();
let stream = TcpStream::connect("google.com:443").unwrap();
let mut stream = connector.connect("google.com", stream).unwrap();
stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
let mut res = vec![];
stream.read_to_end(&mut res).unwrap();
println!("{}", String::from_utf8_lossy(&res));
}
To accept connections as a server from remote clients:
extern crate native_tls;
use native_tls::{Identity, TlsAcceptor, TlsStream};
use std::fs::File;
use std::io::{Read};
use std::net::{TcpListener, TcpStream};
use std::sync::Arc;
use std::thread;
fn main() {
let mut file = File::open("identity.pfx").unwrap();
let mut identity = vec![];
file.read_to_end(&mut identity).unwrap();
let identity = Identity::from_pkcs12(&identity, "hunter2").unwrap();
let acceptor = TlsAcceptor::new(identity).unwrap();
let acceptor = Arc::new(acceptor);
let listener = TcpListener::bind("0.0.0.0:8443").unwrap();
fn handle_client(stream: TlsStream<TcpStream>) {
// ...
}
for stream in listener.incoming() {
match stream {
Ok(stream) => {
let acceptor = acceptor.clone();
thread::spawn(move || {
let stream = acceptor.accept(stream).unwrap();
handle_client(stream);
});
}
Err(e) => { /* connection failed */ }
}
}
}
License
rust-native-tls
is primarily distributed under the terms of both the MIT
license and the Apache License (Version 2.0), with portions covered by various
BSD-like licenses.
See LICENSE-APACHE, and LICENSE-MIT for details.
*Note that all licence references and agreements mentioned in the rust-native-tls README section above
are relevant to that project's source code only.