pub struct KeyUtils {
pub rsa_pub_components_from_private_key: fn(&[u8]) -> Result<(Vec<u8>, Vec<u8>)>,
pub rsa_pub_components_from_public_key: fn(&[u8]) -> Result<(Vec<u8>, Vec<u8>)>,
pub ec_pub_components_from_private_key: fn(&[u8], Algorithm) -> Result<(EllipticCurve, Vec<u8>, Vec<u8>)>,
pub ed_pub_components_from_private_key: fn(&[u8], &EllipticCurve) -> Result<Vec<u8>>,
pub compute_digest: fn(&[u8], ThumbprintHash) -> Result<Vec<u8>>,
}Expand description
Holds utility functions required for JWK processing.
Use the KeyUtils::new_unimplemented function to initialize all values to dummies.
Fields§
§rsa_pub_components_from_private_key: fn(&[u8]) -> Result<(Vec<u8>, Vec<u8>)>Given a DER encoded private key, extract the RSA public key components (n, e)
rsa_pub_components_from_public_key: fn(&[u8]) -> Result<(Vec<u8>, Vec<u8>)>Given a DER encoded public key, extract the RSA public key components (n, e)
ec_pub_components_from_private_key: fn(&[u8], Algorithm) -> Result<(EllipticCurve, Vec<u8>, Vec<u8>)>Given a DER encoded private key and an algorithm, extract the associated curve and the EC public key components (x, y)
ed_pub_components_from_private_key: fn(&[u8], &EllipticCurve) -> Result<Vec<u8>>Given a DER encoded private key and the curve type, extract the ED public key component (x)
compute_digest: fn(&[u8], ThumbprintHash) -> Result<Vec<u8>>Given some data and a name of a hash function, compute hash_function(data)
Implementations§
Source§impl KeyUtils
impl KeyUtils
Sourcepub const fn new_unimplemented() -> Self
pub const fn new_unimplemented() -> Self
Initialises all values to dummies. Will lead to a panic when JWKs are required, so only use it if you don’t want to support JWKs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyUtils
impl RefUnwindSafe for KeyUtils
impl Send for KeyUtils
impl Sync for KeyUtils
impl Unpin for KeyUtils
impl UnsafeUnpin for KeyUtils
impl UnwindSafe for KeyUtils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more