fn sign_hmac(alg: &'static digest::Algorithm, key: Key, signing_input: &str) -> Result<String> {
    let signing_key = match key {
        Key::Hmac(bytes) => hmac::SigningKey::new(alg, bytes),
        _ => return Err(ErrorKind::InvalidKeyFormat)?,
    };
    let digest = hmac::sign(&signing_key, signing_input.as_bytes());

    Ok(base64::encode_config::<hmac::Signature>(&digest, base64::URL_SAFE_NO_PAD))
}
/// The actual HS signing + encoding
The actual HS signing + encoding
The actual HS signing + encoding
fn sign_hmac(alg: &'static digest::Algorithm, key: Key, signing_input: &str) -> Result<String> {
    let signing_key = match key {
        Key::Hmac(bytes) => hmac::SigningKey::new(alg, bytes),
        _ => return Err(ErrorKind::InvalidKeyFormat)?,
    };
    let digest = hmac::sign(&signing_key, signing_input.as_bytes());
    Ok(base64::encode_config::<hmac::Signature>(&digest, base64::URL_SAFE_NO_PAD))
}
fn sign_hmac ( alg : & ' static digest :: Algorithm , key : Key , signing_input : & str ) -> Result < String > { let signing_key = match key { Key :: Hmac ( bytes ) => hmac :: SigningKey :: new ( alg , bytes ) , _ => return Err ( ErrorKind :: InvalidKeyFormat ) ? , } ; let digest = hmac :: sign ( & signing_key , signing_input . as_bytes ( ) ) ; Ok ( base64 :: encode_config :: < hmac :: Signature > ( & digest , base64 :: URL_SAFE_NO_PAD ) ) }
The actual HS signing + encoding
The actual HS signing + encoding
alg
&'static digest::Algorithm
key
Key
signing_input
&str