Skip to content

Commit

Permalink
fix api names in doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmayclin committed Nov 27, 2024
1 parent ab186e6 commit bbf6aa1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bindings/rust/s2n-tls/src/callbacks/pkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ mod tests {
}
}

let public_chain = CertificateChain::from_public_pems(CERT).unwrap();
let public_chain = CertificateChain::from_public_pem(CERT).unwrap();

let server_config = {
let mut config = config::Builder::new();
Expand Down
6 changes: 3 additions & 3 deletions bindings/rust/s2n-tls/src/cert_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl CertificateChain<'_> {
///
/// This can be used with [crate::config::Builder::load_chain] to share a
/// single cert across multiple configs.
pub fn from_pems(chain: &[u8], key: &[u8]) -> Result<CertificateChain<'static>, Error> {
pub fn from_pem(chain: &[u8], key: &[u8]) -> Result<CertificateChain<'static>, Error> {
let mut builder = Self::allocate_owned()?;
unsafe {
// SAFETY: manual audit of load_pem_bytes shows that `chain_pem` and
Expand All @@ -62,8 +62,8 @@ impl CertificateChain<'_> {
/// reference counting handled by the rust bindings.
///
/// This method is only used when performing private-key offloading. For standard
/// use-cases see [CertificateChain::from_pems].
pub fn from_public_pems(chain: &[u8]) -> Result<CertificateChain<'static>, Error> {
/// use-cases see [CertificateChain::from_pem].
pub fn from_public_pem(chain: &[u8]) -> Result<CertificateChain<'static>, Error> {
let mut builder = Self::allocate_owned()?;
unsafe {
// SAFETY: manual audit of load_public_pem_bytes shows that `chain_pem`
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/s2n-tls/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl Builder {
/// can be loaded.
///
/// For more advanced cert use cases such as sharing certs across configs or
/// serving differents certs based on the client SNI, see [Builder::add_to_store].
/// serving differents certs based on the client SNI, see [Builder::load_chain].
pub fn load_pem(&mut self, certificate: &[u8], private_key: &[u8]) -> Result<&mut Self, Error> {
let certificate = CString::new(certificate).map_err(|_| Error::INVALID_INPUT)?;
let private_key = CString::new(private_key).map_err(|_| Error::INVALID_INPUT)?;
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/s2n-tls/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl CertKeyPair {
}

pub fn into_certificate_chain(&self) -> CertificateChain<'static> {
CertificateChain::from_pems(&self.cert, &self.key).unwrap()
CertificateChain::from_pem(&self.cert, &self.key).unwrap()
}

pub fn cert_path(&self) -> &str {
Expand Down

0 comments on commit bbf6aa1

Please sign in to comment.