pub struct Sm9EncMasterKey { /* private fields */ }Implementations§
Source§impl Sm9EncMasterKey
impl Sm9EncMasterKey
Sourcepub fn generate() -> Result<Self, GmsslError>
pub fn generate() -> Result<Self, GmsslError>
Generate a new SM9 encryption master key.
Sourcepub fn extract_key(&self, id: &str) -> Result<Sm9EncKey, GmsslError>
pub fn extract_key(&self, id: &str) -> Result<Sm9EncKey, GmsslError>
Extract a user’s decryption private key from the master key.
Sourcepub fn from_encrypted_pem(
pem_data: &[u8],
password: &str,
) -> Result<Self, GmsslError>
pub fn from_encrypted_pem( pem_data: &[u8], password: &str, ) -> Result<Self, GmsslError>
Import from encrypted PEM (in-memory).
Sourcepub fn to_encrypted_pem(&self, password: &str) -> Result<Vec<u8>, GmsslError>
pub fn to_encrypted_pem(&self, password: &str) -> Result<Vec<u8>, GmsslError>
Export to encrypted PEM (in-memory).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sm9EncMasterKey
impl RefUnwindSafe for Sm9EncMasterKey
impl Send for Sm9EncMasterKey
impl Sync for Sm9EncMasterKey
impl Unpin for Sm9EncMasterKey
impl UnsafeUnpin for Sm9EncMasterKey
impl UnwindSafe for Sm9EncMasterKey
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