Struct lock_keeper::crypto::Import
source · pub struct Import {
key_material: Vec<u8>,
}
Expand description
Raw material for an imported signing key.
Fields§
§key_material: Vec<u8>
Implementations§
source§impl Import
impl Import
sourcepub fn new(bytes: Vec<u8>) -> Result<Self, LockKeeperError>
pub fn new(bytes: Vec<u8>) -> Result<Self, LockKeeperError>
Create a new Import
around the bytes representing signing key
material. Bytes are validated for appropriate format.
sourcepub fn into_signing_key(
self,
user_id: &UserId,
key_id: &KeyId
) -> Result<SigningKeyPair, LockKeeperError>
pub fn into_signing_key( self, user_id: &UserId, key_id: &KeyId ) -> Result<SigningKeyPair, LockKeeperError>
Convert an Import
into a SigningKeyPair
with appropriate
context.
This is part of the flow to send an imported key in cleartext to the key server and must be called by the server.
This will fail if material
is not a scalar value formatted in big
endian. See k256 documentation
for details.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Import
impl<'de> Deserialize<'de> for Import
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Import
impl RefUnwindSafe for Import
impl Send for Import
impl Sync for Import
impl Unpin for Import
impl UnwindSafe for Import
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
source§impl<T> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
fn from_message(value: Message) -> Result<Self, LockKeeperError>
fn to_message(self) -> Result<Message, LockKeeperError>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request