@@ -270,7 +270,7 @@ where
270270 /// It is also possible to directly greate RSA or ECDSA-based leaf
271271 /// certificates using [`CertificateAuthority::generate_rsa_leaf_certificate`]
272272 /// and [`CertificateAuthority::generate_ecdsa_leaf_certificate`].
273- #[ instrument( skip( key_pair) ) ]
273+ #[ instrument( skip( self , key_pair) ) ]
274274 pub fn generate_leaf_certificate < T > (
275275 & mut self ,
276276 key_pair : T ,
@@ -304,8 +304,6 @@ where
304304 // The leaf certificate can be used for WWW client and server
305305 // authentication. This is a base requirement for TLS certs.
306306 let eku = ExtendedKeyUsage ( vec ! [ ID_KP_CLIENT_AUTH , ID_KP_SERVER_AUTH ] ) ;
307- let aki = AuthorityKeyIdentifier :: try_from ( spki. owned_to_ref ( ) )
308- . context ( ParseAuthorityKeyIdentifierSnafu ) ?;
309307
310308 let signer = self . certificate_pair . key_pair . signing_key ( ) ;
311309 let mut builder = CertificateBuilder :: new (
@@ -331,9 +329,6 @@ where
331329 builder
332330 . add_extension ( & eku)
333331 . context ( AddCertificateExtensionSnafu ) ?;
334- builder
335- . add_extension ( & aki)
336- . context ( AddCertificateExtensionSnafu ) ?;
337332
338333 debug ! ( "create and sign leaf certificate" ) ;
339334 let certificate = builder. build ( ) . context ( BuildCertificateSnafu ) ?;
@@ -348,7 +343,7 @@ where
348343 ///
349344 /// See [`CertificateAuthority::generate_leaf_certificate`] for more
350345 /// information.
351- #[ instrument]
346+ #[ instrument( skip ( self ) ) ]
352347 pub fn generate_rsa_leaf_certificate (
353348 & mut self ,
354349 name : & str ,
@@ -363,7 +358,7 @@ where
363358 ///
364359 /// See [`CertificateAuthority::generate_leaf_certificate`] for more
365360 /// information.
366- #[ instrument]
361+ #[ instrument( skip ( self ) ) ]
367362 pub fn generate_ecdsa_leaf_certificate (
368363 & mut self ,
369364 name : & str ,
@@ -477,14 +472,16 @@ mod test {
477472 use super :: * ;
478473
479474 #[ tokio:: test]
480- async fn test ( ) {
475+ async fn test_rsa_key_generation ( ) {
481476 let mut ca = CertificateAuthority :: new_rsa ( ) . unwrap ( ) ;
482- ca. generate_leaf_certificate (
483- rsa:: SigningKey :: new ( ) . unwrap ( ) ,
484- "Airflow" ,
485- "pod" ,
486- Duration :: from_secs ( 3600 ) ,
487- )
488- . unwrap ( ) ;
477+ ca. generate_rsa_leaf_certificate ( "Airflow" , "pod" , Duration :: from_secs ( 3600 ) )
478+ . unwrap ( ) ;
479+ }
480+
481+ #[ tokio:: test]
482+ async fn test_ecdsa_key_generation ( ) {
483+ let mut ca = CertificateAuthority :: new_ecdsa ( ) . unwrap ( ) ;
484+ ca. generate_ecdsa_leaf_certificate ( "Airflow" , "pod" , Duration :: from_secs ( 3600 ) )
485+ . unwrap ( ) ;
489486 }
490487}
0 commit comments