diff --git a/rcgen/src/key_pair.rs b/rcgen/src/key_pair.rs index b1d41f25..3e039723 100644 --- a/rcgen/src/key_pair.rs +++ b/rcgen/src/key_pair.rs @@ -690,9 +690,12 @@ impl ExternalError for Result { } } -pub(crate) trait PublicKeyData { +/// The public key data of a key pair +pub trait PublicKeyData { + /// The public key in DER format fn der_bytes(&self) -> &[u8]; + /// The algorithm used by the key pair fn algorithm(&self) -> &SignatureAlgorithm; } diff --git a/rcgen/src/lib.rs b/rcgen/src/lib.rs index 0caecbeb..4a1c18bc 100644 --- a/rcgen/src/lib.rs +++ b/rcgen/src/lib.rs @@ -58,7 +58,7 @@ pub use crl::{ }; pub use csr::{CertificateSigningRequest, CertificateSigningRequestParams, PublicKey}; pub use error::{Error, InvalidAsn1String}; -use key_pair::PublicKeyData; +pub use key_pair::PublicKeyData; #[cfg(all(feature = "crypto", feature = "aws_lc_rs"))] pub use key_pair::RsaKeySize; pub use key_pair::{KeyPair, RemoteKeyPair};