diff --git a/der/src/encode.rs b/der/src/encode.rs index 28d7cba77..eba1f262d 100644 --- a/der/src/encode.rs +++ b/der/src/encode.rs @@ -69,7 +69,7 @@ pub trait Encode { impl Encode for T where - T: EncodeValue + Tagged, + T: EncodeValue + Tagged + ?Sized, { /// Compute the length of this value in bytes when encoded as ASN.1 DER. fn encoded_len(&self) -> Result { @@ -109,7 +109,10 @@ pub trait EncodePem: Encode + PemLabel { } #[cfg(feature = "pem")] -impl EncodePem for T { +impl EncodePem for T +where + T: Encode + PemLabel + ?Sized, +{ fn to_pem(&self, line_ending: LineEnding) -> Result { let der_len = usize::try_from(self.encoded_len()?)?; let pem_len = pem::encapsulated_len(Self::PEM_LABEL, line_ending, der_len)?; diff --git a/der/src/tag.rs b/der/src/tag.rs index 80b797ca9..8c8490adf 100644 --- a/der/src/tag.rs +++ b/der/src/tag.rs @@ -26,7 +26,7 @@ pub trait Tagged { } /// Types which are [`FixedTag`] always have a known [`Tag`] type. -impl Tagged for T { +impl Tagged for T { fn tag(&self) -> Tag { T::TAG }