@@ -19,7 +19,7 @@ fn encode_general_subtrees<'a>(
1919 ka_bytes : & ' a cryptography_keepalive:: KeepAlive < pyo3:: pybacked:: PyBackedBytes > ,
2020 ka_str : & ' a cryptography_keepalive:: KeepAlive < pyo3:: pybacked:: PyBackedStr > ,
2121 subtrees : & pyo3:: Bound < ' a , pyo3:: PyAny > ,
22- ) -> Result < Option < extensions:: SequenceOfSubtrees < ' a > > , CryptographyError > {
22+ ) -> Result < Option < extensions:: SequenceOfSubtrees < ' a , Asn1Write > > , CryptographyError > {
2323 if subtrees. is_none ( ) {
2424 Ok ( None )
2525 } else {
@@ -32,9 +32,7 @@ fn encode_general_subtrees<'a>(
3232 maximum : None ,
3333 } ) ;
3434 }
35- Ok ( Some ( common:: Asn1ReadableOrWritable :: new_write (
36- asn1:: SequenceOfWriter :: new ( subtree_seq) ,
37- ) ) )
35+ Ok ( Some ( asn1:: SequenceOfWriter :: new ( subtree_seq) ) )
3836 }
3937}
4038
@@ -55,9 +53,7 @@ pub(crate) fn encode_authority_key_identifier<'a>(
5553 let authority_cert_issuer = if let Some ( authority_cert_issuer) = aki. authority_cert_issuer {
5654 let gns =
5755 x509:: common:: encode_general_names ( py, & ka_bytes, & ka_str, & authority_cert_issuer) ?;
58- Some ( common:: Asn1ReadableOrWritable :: new_write (
59- asn1:: SequenceOfWriter :: new ( gns) ,
60- ) )
56+ Some ( asn1:: SequenceOfWriter :: new ( gns) )
6157 } else {
6258 None
6359 } ;
@@ -69,7 +65,9 @@ pub(crate) fn encode_authority_key_identifier<'a>(
6965 } else {
7066 None
7167 } ;
72- Ok ( asn1:: write_single ( & extensions:: AuthorityKeyIdentifier {
68+ Ok ( asn1:: write_single ( & extensions:: AuthorityKeyIdentifier :: <
69+ Asn1Write ,
70+ > {
7371 authority_cert_issuer,
7472 authority_cert_serial_number,
7573 key_identifier : aki. key_identifier . as_deref ( ) ,
@@ -96,16 +94,14 @@ pub(crate) fn encode_distribution_points<'p>(
9694
9795 let crl_issuer = if let Some ( py_crl_issuer) = py_dp. crl_issuer {
9896 let gns = x509:: common:: encode_general_names ( py, & ka_bytes, & ka_str, & py_crl_issuer) ?;
99- Some ( common:: Asn1ReadableOrWritable :: new_write (
100- asn1:: SequenceOfWriter :: new ( gns) ,
101- ) )
97+ Some ( asn1:: SequenceOfWriter :: new ( gns) )
10298 } else {
10399 None
104100 } ;
105101 let distribution_point = if let Some ( py_full_name) = py_dp. full_name {
106102 let gns = x509:: common:: encode_general_names ( py, & ka_bytes, & ka_str, & py_full_name) ?;
107103 Some ( extensions:: DistributionPointName :: FullName (
108- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SequenceOfWriter :: new ( gns) ) ,
104+ asn1:: SequenceOfWriter :: new ( gns) ,
109105 ) )
110106 } else if let Some ( py_relative_name) = py_dp. relative_name {
111107 let mut name_entries = vec ! [ ] ;
@@ -114,7 +110,7 @@ pub(crate) fn encode_distribution_points<'p>(
114110 name_entries. push ( ne) ;
115111 }
116112 Some ( extensions:: DistributionPointName :: NameRelativeToCRLIssuer (
117- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SetOfWriter :: new ( name_entries) ) ,
113+ asn1:: SetOfWriter :: new ( name_entries) ,
118114 ) )
119115 } else {
120116 None
@@ -338,7 +334,7 @@ fn encode_issuing_distribution_point(
338334 let py_full_name = ext. getattr ( pyo3:: intern!( py, "full_name" ) ) ?;
339335 let gns = x509:: common:: encode_general_names ( ext. py ( ) , & ka_bytes, & ka_str, & py_full_name) ?;
340336 Some ( extensions:: DistributionPointName :: FullName (
341- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SequenceOfWriter :: new ( gns) ) ,
337+ asn1:: SequenceOfWriter :: new ( gns) ,
342338 ) )
343339 } else if ext
344340 . getattr ( pyo3:: intern!( py, "relative_name" ) ) ?
@@ -353,7 +349,7 @@ fn encode_issuing_distribution_point(
353349 name_entries. push ( name_entry) ;
354350 }
355351 Some ( extensions:: DistributionPointName :: NameRelativeToCRLIssuer (
356- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SetOfWriter :: new ( name_entries) ) ,
352+ asn1:: SetOfWriter :: new ( name_entries) ,
357353 ) )
358354 } else {
359355 None
@@ -610,7 +606,7 @@ pub(crate) fn encode_extension(
610606
611607 let permitted = ext. getattr ( pyo3:: intern!( py, "permitted_subtrees" ) ) ?;
612608 let excluded = ext. getattr ( pyo3:: intern!( py, "excluded_subtrees" ) ) ?;
613- let nc = extensions:: NameConstraints {
609+ let nc = extensions:: NameConstraints :: < Asn1Write > {
614610 permitted_subtrees : encode_general_subtrees (
615611 ext. py ( ) ,
616612 & ka_bytes,
0 commit comments