Struct nethsm::KeyImportData
source · pub struct KeyImportData {
pub prime_p: Option<Vec<u8>>,
pub prime_q: Option<Vec<u8>>,
pub public_exponent: Option<Vec<u8>>,
pub data: Option<Vec<u8>>,
}Expand description
The key data required when importing a secret key
The prime_p, prime_q and public_exponent fields must be Option::Some for keys
of type KeyType::Rsa. The data field must be Option::Some for keys
of type KeyType::Curve25519, KeyType::EcP224, KeyType::EcP256, KeyType::EcP384
and KeyType::EcP521.
Fields§
§prime_p: Option<Vec<u8>>§prime_q: Option<Vec<u8>>§public_exponent: Option<Vec<u8>>§data: Option<Vec<u8>>Implementations§
source§impl KeyImportData
impl KeyImportData
sourcepub fn validate_key_type(&self, key_type: KeyType) -> Result<(), Error>
pub fn validate_key_type(&self, key_type: KeyType) -> Result<(), Error>
Ensures the provided KeyType is compatible with the data
Checks whether all needed data for a KeyType is present to be able to import it.
§Errors
Returns an Error::KeyImport if:
key_typeisKeyType::RsaandKeyImportData::prime_p,KeyImportData::prime_q,KeyImportData::public_exponentisNonekey_typeisKeyType::Curve25519,KeyType::EcP224,KeyType::EcP256,KeyType::EcP384, orKeyType::EcP521andKeyImportData::dataisNone
Auto Trait Implementations§
impl Freeze for KeyImportData
impl RefUnwindSafe for KeyImportData
impl Send for KeyImportData
impl Sync for KeyImportData
impl Unpin for KeyImportData
impl UnwindSafe for KeyImportData
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