pub struct SignedAttributesDer(_, _);Implementations§
source§impl SignedAttributesDer
impl SignedAttributesDer
sourcepub fn new(sa: SignedAttributes, tag: Option<Tag>) -> Self
pub fn new(sa: SignedAttributes, tag: Option<Tag>) -> Self
Examples found in repository?
src/asn1/rfc5652.rs (line 450)
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457
pub fn encode_ref(&self) -> impl Values + '_ {
encode::sequence((
u8::from(self.version).encode(),
&self.sid,
&self.digest_algorithm,
// Always write signed attributes with DER encoding per RFC 5652.
self.signed_attributes
.as_ref()
.map(|attrs| SignedAttributesDer::new(attrs.clone(), Some(Tag::CTX_0))),
&self.signature_algorithm,
self.signature.encode_ref(),
self.unsigned_attributes
.as_ref()
.map(|attrs| attrs.encode_ref_as(Tag::CTX_1)),
))
}Trait Implementations§
source§impl Values for SignedAttributesDer
impl Values for SignedAttributesDer
source§fn encoded_len(&self, _: Mode) -> usize
fn encoded_len(&self, _: Mode) -> usize
Returns the length of the encoded values for the given mode.
source§fn write_encoded<W: Write>(&self, _: Mode, target: &mut W) -> Result<(), Error>
fn write_encoded<W: Write>(&self, _: Mode, target: &mut W) -> Result<(), Error>
Encodes the values in the given mode and writes them to
target.source§fn explicit(self, tag: Tag) -> Constructed<Self>where
Self: Sized,
fn explicit(self, tag: Tag) -> Constructed<Self>where
Self: Sized,
Converts the encoder into one with an explicit tag.
source§fn to_captured(&self, mode: Mode) -> Captured
fn to_captured(&self, mode: Mode) -> Captured
Captures the encoded values in the given mode.