Skip to content

Commit

Permalink
x509-cert: use BuilderProfile for consistency (#1517)
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo authored Sep 11, 2024
1 parent 622b648 commit c74b3ad
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions x509-cert/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ use crate::{

pub mod profile;

use self::profile::BuildProfile;
use self::profile::BuilderProfile;

#[deprecated(
since = "0.3.0",
note = "please use `x509_cert::builder::profile::BuildProfile` instead"
note = "please use `x509_cert::builder::profile::BuilderProfile` instead"
)]
pub use self::profile::BuildProfile as Profile;
pub use self::profile::BuilderProfile as Profile;

const NULL_OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("0.0.0");

Expand Down Expand Up @@ -152,7 +152,7 @@ pub struct CertificateBuilder<P> {

impl<P> CertificateBuilder<P>
where
P: BuildProfile,
P: BuilderProfile,
{
/// Creates a new certificate builder
pub fn new(
Expand Down Expand Up @@ -352,7 +352,7 @@ pub trait Builder: Sized {

impl<P> Builder for CertificateBuilder<P>
where
P: BuildProfile,
P: BuilderProfile,
{
type Output = Certificate;

Expand Down
4 changes: 2 additions & 2 deletions x509-cert/src/builder/profile.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Certificate profiles
//!
//! Profiles need implement by the [`BuildProfile`] trait.
//! Profiles need implement by the [`BuilderProfile`] trait.
//! They may then be consumed by a [`builder::CertificateBuilder`].
//!
//!
Expand Down Expand Up @@ -29,7 +29,7 @@ pub mod devid;
/// generate a [`cabf::Root`], or a TLS [`cabf::tls::Subscriber`] certificate.
///
/// See [implementors](#implementors) for a full list of existing profiles.
pub trait BuildProfile {
pub trait BuilderProfile {
/// Issuer to be used for issued certificates
fn get_issuer(&self, subject: &Name) -> Name;

Expand Down
4 changes: 2 additions & 2 deletions x509-cert/src/builder/profile/cabf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use alloc::vec;
use std::collections::HashSet;

use crate::{
builder::{BuildProfile, Error, Result},
builder::{BuilderProfile, Error, Result},
certificate::TbsCertificate,
ext::{
pkix::{
Expand Down Expand Up @@ -123,7 +123,7 @@ impl Root {
}
}

impl BuildProfile for Root {
impl BuilderProfile for Root {
fn get_issuer(&self, subject: &Name) -> Name {
subject.clone()
}
Expand Down
6 changes: 3 additions & 3 deletions x509-cert/src/builder/profile/cabf/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use const_oid::db::rfc5912;

use crate::{
attr::AttributeTypeAndValue,
builder::{BuildProfile, Result},
builder::{BuilderProfile, Result},
certificate::TbsCertificate,
ext::{
pkix::{
Expand Down Expand Up @@ -50,7 +50,7 @@ pub struct Subordinate {
pub client_auth: bool,
}

impl BuildProfile for Subordinate {
impl BuilderProfile for Subordinate {
fn get_issuer(&self, _subject: &Name) -> Name {
self.issuer.clone()
}
Expand Down Expand Up @@ -231,7 +231,7 @@ pub struct Tls12Options {
pub enable_key_agreement: bool,
}

impl BuildProfile for Subscriber {
impl BuilderProfile for Subscriber {
fn get_issuer(&self, _subject: &Name) -> Name {
self.issuer.clone()
}
Expand Down
4 changes: 2 additions & 2 deletions x509-cert/src/builder/profile/devid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use alloc::vec;

use crate::{
builder::{BuildProfile, Result},
builder::{BuilderProfile, Result},
certificate::TbsCertificate,
ext::{
pkix::{
Expand Down Expand Up @@ -112,7 +112,7 @@ impl DevId {
}
}

impl BuildProfile for DevId {
impl BuilderProfile for DevId {
fn get_issuer(&self, _subject: &Name) -> Name {
self.issuer.clone()
}
Expand Down

0 comments on commit c74b3ad

Please sign in to comment.