pub struct LicenseVerifier { /* private fields */ }Expand description
License verifier for validating licenses
Implementations§
Source§impl LicenseVerifier
impl LicenseVerifier
Sourcepub fn new(public_key: RsaPublicKey) -> Self
pub fn new(public_key: RsaPublicKey) -> Self
Create a new license verifier with a public key
Sourcepub fn from_pem_file(path: &Path) -> Result<Self>
pub fn from_pem_file(path: &Path) -> Result<Self>
Create a new license verifier from a PEM file
Sourcepub fn with_hardware_info(self, info: HardwareInfo) -> Self
pub fn with_hardware_info(self, info: HardwareInfo) -> Self
Set custom hardware info (useful for testing or manual override)
Sourcepub fn with_hardware_environment(
self,
env: Arc<dyn HardwareEnvironment>,
) -> Self
pub fn with_hardware_environment( self, env: Arc<dyn HardwareEnvironment>, ) -> Self
Use a custom HardwareEnvironment (e.g. TPM-backed probe in your crate).
Sourcepub fn load_license(&self, path: &Path) -> Result<SignedLicense>
pub fn load_license(&self, path: &Path) -> Result<SignedLicense>
Load a license from a file (auto-detects format)
Sourcepub fn parse_license(&self, data: &[u8]) -> Result<SignedLicense>
pub fn parse_license(&self, data: &[u8]) -> Result<SignedLicense>
Parse a license from bytes (auto-detects format)
Sourcepub fn verify_signature(&self, license: &SignedLicense) -> Result<()>
pub fn verify_signature(&self, license: &SignedLicense) -> Result<()>
Verify the cryptographic signature of a license
Sourcepub fn verify_expiration(&self, license: &SignedLicense) -> Result<()>
pub fn verify_expiration(&self, license: &SignedLicense) -> Result<()>
Verify that the license has not expired
Sourcepub fn verify_hardware(&self, license: &SignedLicense) -> Result<()>
pub fn verify_hardware(&self, license: &SignedLicense) -> Result<()>
Verify hardware binding
Sourcepub fn validate(&self, license: &SignedLicense) -> Result<()>
pub fn validate(&self, license: &SignedLicense) -> Result<()>
Perform full license validation
This verifies:
- Cryptographic signature
- Expiration date
- Hardware binding (if enabled)
Sourcepub fn load_and_validate(&self, path: &Path) -> Result<SignedLicense>
pub fn load_and_validate(&self, path: &Path) -> Result<SignedLicense>
Load and validate a license from a file
Source§impl LicenseVerifier
impl LicenseVerifier
Sourcepub fn validate_detailed(&self, license: &SignedLicense) -> ValidationResult
pub fn validate_detailed(&self, license: &SignedLicense) -> ValidationResult
Perform detailed validation and return a result
Trait Implementations§
Source§impl Clone for LicenseVerifier
impl Clone for LicenseVerifier
Source§fn clone(&self) -> LicenseVerifier
fn clone(&self) -> LicenseVerifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LicenseVerifier
impl !RefUnwindSafe for LicenseVerifier
impl Send for LicenseVerifier
impl Sync for LicenseVerifier
impl Unpin for LicenseVerifier
impl UnsafeUnpin for LicenseVerifier
impl !UnwindSafe for LicenseVerifier
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