/// Hawk key. /// /// While any sequence of bytes can be specified as a key, note that each digest algorithm has /// a suggested key length, and that passwords should *not* be used as keys. Keys of incorrect /// length are handled according to the digest's implementation. pubstruct Key(Box<dyn HmacKey>);
/// Hawk credentials: an ID and a key associated with that ID. The digest algorithm /// must be agreed between the server and the client, and the length of the key is /// specific to that algorithm. pubstruct Credentials { pub id: String, pub key: Key,
}
#[cfg(all(test, any(feature = "use_ring", feature = "use_openssl")))] mod test { usesuper::*;
#[test] fn test_new_sha256() { let key = vec![77u8; 32]; // hmac::SigningKey doesn't allow any visibilty inside, so we just build the // key and assume it works..
Key::new(key, DigestAlgorithm::Sha256).unwrap();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.