MCPcopy Create free account
hub / github.com/Keats/jsonwebtoken / try_get_as_bytes

Method try_get_as_bytes

src/decoding.rs:245–250  ·  view source on GitHub ↗

Try to get the key in raw byte format. To be used for defining your own `CryptoProvider`.

(&self)

Source from the content-addressed store, hash-verified

243 ///
244 /// To be used for defining your own `CryptoProvider`.
245 pub fn try_get_as_bytes(&self) -> Result<&[u8]> {
246 match &self.kind {
247 DecodingKeyKind::SecretOrDer(b) => Ok(b),
248 DecodingKeyKind::RsaModulusExponent { .. } => Err(ErrorKind::InvalidKeyFormat.into()),
249 }
250 }
251}
252
253impl TryFrom<&Jwk> for DecodingKey {

Callers 3

from_decoding_keyMethod · 0.80
newMethod · 0.80
verifyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected