pub struct KeyPair {
pub public_key: RsaPublicKey,
/* private fields */
}Expand description
RSA key pair for license signing
Fields§
§public_key: RsaPublicKeyImplementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn private_key(&self) -> &RsaPrivateKey
pub fn private_key(&self) -> &RsaPrivateKey
Get a reference to the private key
Sourcepub fn into_private_key(self) -> RsaPrivateKey
pub fn into_private_key(self) -> RsaPrivateKey
Consume the key pair and return the private key
Sourcepub fn export_private_pem(&self) -> Result<String>
pub fn export_private_pem(&self) -> Result<String>
Export the private key as PEM string
Sourcepub fn export_public_pem(&self) -> Result<String>
pub fn export_public_pem(&self) -> Result<String>
Export the public key as PEM string
Sourcepub fn save_to_files(
&self,
private_path: &Path,
public_path: &Path,
) -> Result<()>
pub fn save_to_files( &self, private_path: &Path, public_path: &Path, ) -> Result<()>
Save the key pair to files
Sourcepub fn load_from_files(private_path: &Path, public_path: &Path) -> Result<Self>
pub fn load_from_files(private_path: &Path, public_path: &Path) -> Result<Self>
Load a key pair from files
On Unix, this checks that the private key file is not readable by group/other.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnsafeUnpin for KeyPair
impl UnwindSafe for KeyPair
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