Skip to content

Conversation

@smndtrl
Copy link
Contributor

@smndtrl smndtrl commented Jan 3, 2023

This is a WIP. Putting it here to prevent duplicate work.

Missing:

  • Docs
  • Encoding

Comment on lines +73 to +103
fn fields<F, T>(&self, f: F) -> der::Result<T>
where
F: FnOnce(&[&dyn Encode]) -> der::Result<T>,
{
match self {
AuthenticatedSafeItem::Data(data) => f(&[
&self.content_type(),
&data.as_ref().map(|d| ContextSpecific {
tag_number: CONTENT_TAG,
tag_mode: TagMode::Explicit,
value: d.clone(),
}),
]),
AuthenticatedSafeItem::EncryptedData(data) => f(&[
&self.content_type(),
&data.as_ref().map(|d| ContextSpecific {
tag_number: CONTENT_TAG,
tag_mode: TagMode::Explicit,
value: d.clone(),
}),
]),
AuthenticatedSafeItem::EnvelopedData(data) => f(&[
&self.content_type(),
&data.as_ref().map(|d| ContextSpecific {
tag_number: CONTENT_TAG,
tag_mode: TagMode::Explicit,
value: d.clone(),
}),
]),
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, this method was removed in #828

Here's a similar example, although it could probably be cleaned up a bit / DRYed out: https://github.com/RustCrypto/formats/pull/828/files#diff-7eada31819a5738c81669b63773252d75c0ae287f02296637ee5862e36b18408

@carl-wallace carl-wallace mentioned this pull request Jul 12, 2023
@tarcieri
Copy link
Member

tarcieri commented Jan 7, 2024

We went with #1165 instead. Thanks though!

@tarcieri tarcieri closed this Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants