#openssl #rfc #convert #name #cipher #suite #tls

openssl_to_rfc

Convert OpenSSL cipher suite names into RFC names

4 releases (breaking)

0.4.0 Oct 29, 2021
0.3.0 Jul 12, 2020
0.2.0 Apr 30, 2020
0.1.0 Apr 30, 2020

#2430 in Cryptography

MIT/Apache

63KB
957 lines

openssl_to_rfc

Crates.io

openssl_to_rfc converts an OpenSSL cipher suite name like ECDH-RSA-AES128-GCM-SHA256 to the equivalent RFC version TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256.

This crate is pure Rust and does not depend on openssl.


lib.rs:

This crate provides methods to convert OpenSSL cipher suite names into the equivalent RFC name and vice versa.

use openssl_to_rfc::TLSCipherSuite;

let openssl_name = "ECDH-RSA-AES128-GCM-SHA256";
let cipher = TLSCipherSuite::from_openssl_name(openssl_name).unwrap();

assert_eq!(cipher, TLSCipherSuite::TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256);
assert_eq!(cipher.as_openssl_name(), openssl_name);

For SSLv2 cipher suites, use the SSLV2CipherSuite enum instead.

Dependencies

~2MB
~44K SLoC