MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / to_verification_key

Method to_verification_key

nodedb/src/control/security/jwks/cache.rs:232–248  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

230 }
231
232 fn to_verification_key(&self) -> Option<VerificationKey> {
233 use base64::Engine;
234 let bytes = base64::engine::general_purpose::STANDARD
235 .decode(&self.key_data)
236 .ok()?;
237 let key_type = match self.key_type.as_str() {
238 "rsa" => super::key::KeyType::Rsa(bytes),
239 "ec_p256" => super::key::KeyType::EcP256(bytes),
240 "ec_p384" => super::key::KeyType::EcP384(bytes),
241 _ => return None,
242 };
243 Some(VerificationKey {
244 kid: self.kid.clone(),
245 algorithm: self.algorithm.clone(),
246 key_type,
247 })
248 }
249}
250
251#[cfg(test)]

Callers 2

load_from_diskMethod · 0.80
disk_roundtripFunction · 0.80

Calls 4

okMethod · 0.45
decodeMethod · 0.45
as_strMethod · 0.45
cloneMethod · 0.45

Tested by 1

disk_roundtripFunction · 0.64