MCPcopy Create free account
hub / github.com/RustCrypto/formats / encode_to_slice

Method encode_to_slice

der/src/encode.rs:31–35  ·  view source on GitHub ↗

Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.

(&self, buf: &'a mut [u8])

Source from the content-addressed store, hash-verified

29 /// Encode this value to the provided byte slice, returning a sub-slice
30 /// containing the encoded message.
31 fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]> {
32 let mut writer = SliceWriter::new(buf);
33 self.encode(&mut writer)?;
34 writer.finish()
35 }
36
37 /// Encode this message as ASN.1 DER, appending it to the provided
38 /// byte vector.

Callers 7

empty_dataFunction · 0.80
empty_encrypted_dataFunction · 0.80
simple_dataFunction · 0.80
round_tripFunction · 0.80
encdec_normalFunction · 0.80
encdec_irrationalsFunction · 0.80
encdec_reasonable_f64Function · 0.80

Implementers 12

version.rspkcs8/src/version.rs
version.rspkcs1/src/version.rs
document.rsder/src/document.rs
tag.rsder/src/tag.rs
header.rsder/src/header.rs
encode_ref.rsder/src/encode_ref.rs
length.rsder/src/length.rs
encode.rsder/src/encode.rs
optional.rsder/src/asn1/optional.rs
pbes2.rspkcs5/src/pbes2.rs
pbes1.rspkcs5/src/pbes1.rs
kdf.rspkcs5/src/pbes2/kdf.rs

Calls 2

encodeMethod · 0.45
finishMethod · 0.45

Tested by 7

empty_dataFunction · 0.64
empty_encrypted_dataFunction · 0.64
simple_dataFunction · 0.64
round_tripFunction · 0.64
encdec_normalFunction · 0.64
encdec_irrationalsFunction · 0.64
encdec_reasonable_f64Function · 0.64