pub struct LicenseGenerator { /* private fields */ }Expand description
License generator for creating and signing licenses
Implementations§
Source§impl LicenseGenerator
impl LicenseGenerator
Sourcepub fn new(private_key: RsaPrivateKey) -> Self
pub fn new(private_key: RsaPrivateKey) -> Self
Create a new license generator with a private key
Sourcepub fn from_pem_file(path: &Path) -> Result<Self>
pub fn from_pem_file(path: &Path) -> Result<Self>
Create a new license generator from a PEM file
Sourcepub fn generate(&self, data: LicenseData) -> Result<SignedLicense>
pub fn generate(&self, data: LicenseData) -> Result<SignedLicense>
Generate a signed license from license data
Sourcepub fn export_binary(&self, license: &SignedLicense) -> Result<Vec<u8>>
pub fn export_binary(&self, license: &SignedLicense) -> Result<Vec<u8>>
Export a signed license to binary format
Sourcepub fn export_json(&self, license: &SignedLicense) -> Result<String>
pub fn export_json(&self, license: &SignedLicense) -> Result<String>
Export a signed license to JSON format (legacy)
Sourcepub fn save_binary(&self, license: &SignedLicense, path: &Path) -> Result<()>
pub fn save_binary(&self, license: &SignedLicense, path: &Path) -> Result<()>
Save a license to a binary file
Auto Trait Implementations§
impl Freeze for LicenseGenerator
impl RefUnwindSafe for LicenseGenerator
impl Send for LicenseGenerator
impl Sync for LicenseGenerator
impl Unpin for LicenseGenerator
impl UnsafeUnpin for LicenseGenerator
impl UnwindSafe for LicenseGenerator
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