@@ -4,7 +4,10 @@ use std::fmt::Debug;
44
55use x509_cert:: { Certificate , name:: RdnSequence , spki:: EncodePublicKey } ;
66
7- use crate :: { CertificatePair , keys:: CertificateKeypair } ;
7+ use crate :: {
8+ CertificatePair ,
9+ keys:: { CertificateKeypair , ecdsa, rsa} ,
10+ } ;
811
912mod ca_builder;
1013mod consts;
@@ -13,8 +16,10 @@ pub use ca_builder::*;
1316pub use consts:: * ;
1417pub use k8s:: * ;
1518
16- /// A certificate authority (CA) which is used to generate and sign
17- /// intermediate or leaf certificates.
19+ /// A certificate authority (CA) which is used to generate and sign intermediate or leaf
20+ /// certificates.
21+ ///
22+ /// Use [`CertificateAuthorityBuilder`] to create new certificates.
1823#[ derive( Debug ) ]
1924pub struct CertificateAuthority < SK >
2025where
3338 Self { certificate_pair }
3439 }
3540
41+ /// Use this function in combination with [`CertificateAuthorityBuilder`] to create new CAs.
3642 pub fn builder ( ) -> CertificateAuthorityBuilderBuilder < ' static , SK > {
3743 CertificateAuthorityBuilder :: start_builder ( )
3844 }
4955 & self . ca_cert ( ) . tbs_certificate . issuer
5056 }
5157}
58+
59+ impl CertificateAuthority < rsa:: SigningKey > {
60+ /// Same as [`Self::builder`], but enforces the RSA algorithm for key creation.
61+ pub fn builder_with_rsa ( ) -> CertificateAuthorityBuilderBuilder < ' static , rsa:: SigningKey > {
62+ Self :: builder ( )
63+ }
64+ }
65+
66+ impl CertificateAuthority < ecdsa:: SigningKey > {
67+ /// Same as [`Self::builder`], but enforces the ecdsa algorithm for key creation.
68+ pub fn builder_with_ecdsa ( ) -> CertificateAuthorityBuilderBuilder < ' static , ecdsa:: SigningKey > {
69+ Self :: builder ( )
70+ }
71+ }
0 commit comments