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

Method try_get_as_bytes

src/decoding.rs:236–241  ·  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

234 ///
235 /// To be used for defining your own `CryptoProvider`.
236 pub fn try_get_as_bytes(&self) -> Result<&[u8]> {
237 match &self.kind {
238 DecodingKeyKind::SecretOrDer(b) => Ok(b),
239 DecodingKeyKind::RsaModulusExponent { .. } => Err(ErrorKind::InvalidKeyFormat.into()),
240 }
241 }
242}
243
244impl 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