pub struct ChunkSigner {
signing_key: Vec<u8>,
scope: String,
ts: String,
prev_sig: String,
}Expand description
Stateful per-chunk signer for STREAMING-AWS4-HMAC-SHA256-PAYLOAD uploads.
Each call to sign_chunk produces the
chunk-signature trailer required by AWS chunked encoding and advances
the internal HMAC chain for the next chunk.
Fields§
§signing_key: Vec<u8>§scope: String§ts: String§prev_sig: StringImplementations§
Source§impl ChunkSigner
impl ChunkSigner
Sourcepub fn new(
signing_key: Vec<u8>,
scope: String,
ts: String,
seed_signature: String,
) -> Self
pub fn new( signing_key: Vec<u8>, scope: String, ts: String, seed_signature: String, ) -> Self
create a new signer.
seed_signature is the signature you put in the Authorization header
Create a new ChunkSigner from the seed values established during
the initial header signing step.
Sourcepub fn sign_chunk(
&mut self,
chunk: Bytes,
) -> Result<Bytes, Box<dyn Error + Send + Sync>>
pub fn sign_chunk( &mut self, chunk: Bytes, ) -> Result<Bytes, Box<dyn Error + Send + Sync>>
sign one payload chunk and return the wire bytes and update internal state.
Sourcepub fn final_chunk(&mut self) -> Bytes
pub fn final_chunk(&mut self) -> Bytes
Final 0-length chunk (must be sent after the body) Produce the zero-length terminal chunk that signals end-of-stream.
Auto Trait Implementations§
impl Freeze for ChunkSigner
impl RefUnwindSafe for ChunkSigner
impl Send for ChunkSigner
impl Sync for ChunkSigner
impl Unpin for ChunkSigner
impl UnsafeUnpin for ChunkSigner
impl UnwindSafe for ChunkSigner
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more