@@ -94,7 +94,7 @@ const PUBLIC_KEY_TAG: TagNumber = TagNumber::N1;
9494/// [RFC 5208 Section 5]: https://tools.ietf.org/html/rfc5208#section-5
9595/// [RFC 5958 Section 2]: https://datatracker.ietf.org/doc/html/rfc5958#section-2
9696#[ derive( Clone ) ]
97- pub struct PrivateKeyInfo < Params , Key > {
97+ pub struct PrivateKeyInfoInner < Params , Key > {
9898 /// X.509 `AlgorithmIdentifier` for the private key type.
9999 pub algorithm : AlgorithmIdentifier < Params > ,
100100
@@ -105,8 +105,8 @@ pub struct PrivateKeyInfo<Params, Key> {
105105 pub public_key : Option < Key > ,
106106}
107107
108- impl < Params , Key > PrivateKeyInfo < Params , Key > {
109- /// Create a new PKCS#8 [`PrivateKeyInfo `] message.
108+ impl < Params , Key > PrivateKeyInfoInner < Params , Key > {
109+ /// Create a new PKCS#8 [`PrivateKeyInfoInner `] message.
110110 ///
111111 /// This is a helper method which initializes `attributes` and `public_key`
112112 /// to `None`, helpful if you aren't using those.
@@ -129,7 +129,7 @@ impl<Params, Key> PrivateKeyInfo<Params, Key> {
129129 }
130130 }
131131}
132- impl < ' a , Params , Key > PrivateKeyInfo < Params , Key >
132+ impl < ' a , Params , Key > PrivateKeyInfoInner < Params , Key >
133133where
134134 Params : der:: Choice < ' a > + Encode ,
135135 Key : From < & ' a [ u8 ] > + AsRef < [ u8 ] > ,
@@ -166,7 +166,7 @@ where
166166 }
167167}
168168
169- impl < ' a , Params , Key > PrivateKeyInfo < Params , Key >
169+ impl < ' a , Params , Key > PrivateKeyInfoInner < Params , Key >
170170where
171171 Params : der:: Choice < ' a > + Encode ,
172172 Key : AsRef < [ u8 ] > ,
@@ -186,15 +186,12 @@ where
186186 }
187187}
188188
189- impl < ' a , Params , Key > DecodeValue < ' a > for PrivateKeyInfo < Params , Key >
189+ impl < ' a , Params , Key > DecodeValue < ' a > for PrivateKeyInfoInner < Params , Key >
190190where
191191 Params : der:: Choice < ' a > + Encode ,
192192 Key : From < & ' a [ u8 ] > ,
193193{
194- fn decode_value < R : Reader < ' a > > (
195- reader : & mut R ,
196- header : Header ,
197- ) -> der:: Result < PrivateKeyInfo < Params , Key > > {
194+ fn decode_value < R : Reader < ' a > > ( reader : & mut R , header : Header ) -> der:: Result < Self > {
198195 reader. read_nested ( header. length , |reader| {
199196 // Parse and validate `version` INTEGER.
200197 let version = Version :: decode ( reader) ?;
@@ -235,7 +232,7 @@ where
235232 }
236233}
237234
238- impl < ' a , Params , Key > EncodeValue for PrivateKeyInfo < Params , Key >
235+ impl < ' a , Params , Key > EncodeValue for PrivateKeyInfoInner < Params , Key >
239236where
240237 Params : der:: Choice < ' a > + Encode ,
241238 Key : AsRef < [ u8 ] > ,
@@ -256,14 +253,14 @@ where
256253 }
257254}
258255
259- impl < ' a , Params , Key > Sequence < ' a > for PrivateKeyInfo < Params , Key >
256+ impl < ' a , Params , Key > Sequence < ' a > for PrivateKeyInfoInner < Params , Key >
260257where
261258 Params : der:: Choice < ' a > + Encode ,
262259 Key : From < & ' a [ u8 ] > + AsRef < [ u8 ] > ,
263260{
264261}
265262
266- impl < ' a , Params , Key > TryFrom < & ' a [ u8 ] > for PrivateKeyInfo < Params , Key >
263+ impl < ' a , Params , Key > TryFrom < & ' a [ u8 ] > for PrivateKeyInfoInner < Params , Key >
267264where
268265 Params : der:: Choice < ' a > + Encode ,
269266 Key : From < & ' a [ u8 ] > + AsRef < [ u8 ] > ,
@@ -275,13 +272,13 @@ where
275272 }
276273}
277274
278- impl < Params , Key > fmt:: Debug for PrivateKeyInfo < Params , Key >
275+ impl < Params , Key > fmt:: Debug for PrivateKeyInfoInner < Params , Key >
279276where
280277 Params : fmt:: Debug ,
281278 Key : fmt:: Debug ,
282279{
283280 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
284- f. debug_struct ( "PrivateKeyInfo " )
281+ f. debug_struct ( "PrivateKeyInfoInner " )
285282 . field ( "version" , & self . version ( ) )
286283 . field ( "algorithm" , & self . algorithm )
287284 . field ( "public_key" , & self . public_key )
@@ -290,38 +287,38 @@ where
290287}
291288
292289#[ cfg( feature = "alloc" ) ]
293- impl < ' a , Params , Key > TryFrom < PrivateKeyInfo < Params , Key > > for SecretDocument
290+ impl < ' a , Params , Key > TryFrom < PrivateKeyInfoInner < Params , Key > > for SecretDocument
294291where
295292 Params : der:: Choice < ' a > + Encode ,
296293 Key : From < & ' a [ u8 ] > + AsRef < [ u8 ] > ,
297294{
298295 type Error = Error ;
299296
300- fn try_from ( private_key : PrivateKeyInfo < Params , Key > ) -> Result < SecretDocument > {
297+ fn try_from ( private_key : PrivateKeyInfoInner < Params , Key > ) -> Result < SecretDocument > {
301298 SecretDocument :: try_from ( & private_key)
302299 }
303300}
304301
305302#[ cfg( feature = "alloc" ) ]
306- impl < ' a , Params , Key > TryFrom < & PrivateKeyInfo < Params , Key > > for SecretDocument
303+ impl < ' a , Params , Key > TryFrom < & PrivateKeyInfoInner < Params , Key > > for SecretDocument
307304where
308305 Params : der:: Choice < ' a > + Encode ,
309306 Key : From < & ' a [ u8 ] > + AsRef < [ u8 ] > ,
310307{
311308 type Error = Error ;
312309
313- fn try_from ( private_key : & PrivateKeyInfo < Params , Key > ) -> Result < SecretDocument > {
310+ fn try_from ( private_key : & PrivateKeyInfoInner < Params , Key > ) -> Result < SecretDocument > {
314311 Ok ( Self :: encode_msg ( private_key) ?)
315312 }
316313}
317314
318315#[ cfg( feature = "pem" ) ]
319- impl < Params , Key > PemLabel for PrivateKeyInfo < Params , Key > {
316+ impl < Params , Key > PemLabel for PrivateKeyInfoInner < Params , Key > {
320317 const PEM_LABEL : & ' static str = "PRIVATE KEY" ;
321318}
322319
323320#[ cfg( feature = "subtle" ) ]
324- impl < Params , Key > ConstantTimeEq for PrivateKeyInfo < Params , Key >
321+ impl < Params , Key > ConstantTimeEq for PrivateKeyInfoInner < Params , Key >
325322where
326323 Params : Eq ,
327324 Key : PartialEq + AsRef < [ u8 ] > ,
@@ -337,15 +334,15 @@ where
337334}
338335
339336#[ cfg( feature = "subtle" ) ]
340- impl < Params , Key > Eq for PrivateKeyInfo < Params , Key >
337+ impl < Params , Key > Eq for PrivateKeyInfoInner < Params , Key >
341338where
342339 Params : Eq ,
343340 Key : AsRef < [ u8 ] > + Eq ,
344341{
345342}
346343
347344#[ cfg( feature = "subtle" ) ]
348- impl < Params , Key > PartialEq for PrivateKeyInfo < Params , Key >
345+ impl < Params , Key > PartialEq for PrivateKeyInfoInner < Params , Key >
349346where
350347 Params : Eq ,
351348 Key : PartialEq + AsRef < [ u8 ] > ,
@@ -355,19 +352,19 @@ where
355352 }
356353}
357354
358- /// [`PrivateKeyInfo `] with [`AnyRef`] algorithm parameters, and `&[u8]` key.
359- pub type PrivateKeyInfoRef < ' a > = PrivateKeyInfo < AnyRef < ' a > , & ' a [ u8 ] > ;
355+ /// [`PrivateKeyInfoInner `] with [`AnyRef`] algorithm parameters, and `&[u8]` key.
356+ pub type PrivateKeyInfo < ' a > = PrivateKeyInfoInner < AnyRef < ' a > , & ' a [ u8 ] > ;
360357
361358/// [`PrivateKeyInfo`] with [`Any`] algorithm parameters, and `Box<[u8]>` key.
362359#[ cfg( feature = "alloc" ) ]
363- pub type PrivateKeyInfoOwned = PrivateKeyInfo < Any , Box < [ u8 ] > > ;
360+ pub type PrivateKeyInfoOwned = PrivateKeyInfoInner < Any , Box < [ u8 ] > > ;
364361
365362#[ cfg( feature = "alloc" ) ]
366363mod allocating {
367364 use super :: * ;
368365 use der:: referenced:: * ;
369366
370- impl < ' a > RefToOwned < ' a > for PrivateKeyInfoRef < ' a > {
367+ impl < ' a > RefToOwned < ' a > for PrivateKeyInfo < ' a > {
371368 type Owned = PrivateKeyInfoOwned ;
372369 fn ref_to_owned ( & self ) -> Self :: Owned {
373370 PrivateKeyInfoOwned {
@@ -379,9 +376,9 @@ mod allocating {
379376 }
380377
381378 impl OwnedToRef for PrivateKeyInfoOwned {
382- type Borrowed < ' a > = PrivateKeyInfoRef < ' a > ;
379+ type Borrowed < ' a > = PrivateKeyInfo < ' a > ;
383380 fn owned_to_ref ( & self ) -> Self :: Borrowed < ' _ > {
384- PrivateKeyInfoRef {
381+ PrivateKeyInfo {
385382 algorithm : self . algorithm . owned_to_ref ( ) ,
386383 private_key : self . private_key . owned_to_ref ( ) ,
387384 public_key : self . public_key . owned_to_ref ( ) ,
0 commit comments