@@ -676,43 +676,14 @@ impl CertificateParams {
676
676
Ok ( params)
677
677
}
678
678
fn write_request < K : PublicKeyData > ( & self , pub_key : & K , writer : DERWriter ) -> Result < ( ) , Error > {
679
- // No .. pattern, we use this to ensure every field is used
680
- #[ deny( unused) ]
681
- let Self {
682
- alg,
683
- not_before,
684
- not_after,
685
- serial_number,
686
- subject_alt_names : _,
687
- distinguished_name,
688
- is_ca,
689
- key_usages : _,
690
- extended_key_usages : _,
691
- name_constraints : _,
692
- crl_distribution_points : _,
693
- custom_extensions : _,
694
- key_pair,
695
- use_authority_key_identifier_extension,
696
- key_identifier_method,
697
- } = self ;
698
- // - alg and key_pair will be used by the caller
699
- // - not_before and not_after cannot be put in a CSR
700
- // - There might be a use case for specifying the key identifier
701
- // in the CSR, but in the current API it can't be distinguished
702
- // from the defaults so this is left for a later version if
703
- // needed.
704
- let _ = ( alg, key_pair, not_before, not_after, key_identifier_method) ;
705
- if serial_number. is_some ( )
706
- || * is_ca != IsCa :: NoCa
707
- || * use_authority_key_identifier_extension
708
- {
679
+ if self . serial_number . is_some ( ) || self . use_authority_key_identifier_extension {
709
680
return Err ( Error :: UnsupportedInCsr ) ;
710
681
}
711
682
writer. write_sequence ( |writer| {
712
683
// Write version
713
684
writer. next ( ) . write_u8 ( 0 ) ;
714
685
// Write issuer
715
- write_distinguished_name ( writer. next ( ) , & distinguished_name) ;
686
+ write_distinguished_name ( writer. next ( ) , & self . distinguished_name ) ;
716
687
// Write subjectPublicKeyInfo
717
688
pub_key. serialize_public_key_der ( writer. next ( ) ) ;
718
689
// Write extensions
0 commit comments