Decode a JWT without any signature verification/validations and return its [Header](struct.Header.html). If the token has an invalid format (ie 3 parts separated by a `.`), it will return an error. ```rust use jsonwebtoken::decode_header; let token = "a.jwt.token".to_string(); let header = decode_header(&token); ```
(token: impl AsRef<[u8]>)
| 316 | /// let header = decode_header(&token); |
| 317 | /// ``` |
| 318 | pub fn decode_header(token: impl AsRef<[u8]>) -> Result<Header> { |
| 319 | let token = token.as_ref(); |
| 320 | let (_, message) = expect_two!(token.rsplitn(2, |b| *b == b'.')); |
| 321 | let (_, header) = expect_two!(message.rsplitn(2, |b| *b == b'.')); |
| 322 | Header::from_encoded(header) |
| 323 | } |
| 324 | |
| 325 | pub(crate) fn verify_signature_body( |
| 326 | message: &[u8], |
no outgoing calls
no test coverage detected