pub struct PublicKey { /* private fields */ }Expand description
An Ed25519 public key for verifying license signatures.
This is the key that should be embedded in client applications. It can only verify signatures, not create them.
§Example
use rust_license_key::crypto::PublicKey;
// Load from base64 (e.g., embedded in application)
let public_key_base64 = "..."; // Your public key here
// let public_key = PublicKey::from_base64(public_key_base64).unwrap();Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn from_base64(public_key_base64: &str) -> Result<Self>
pub fn from_base64(public_key_base64: &str) -> Result<Self>
Creates a public key from a base64-encoded string.
§Arguments
public_key_base64- The base64-encoded public key (32 bytes when decoded).
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Creates a public key from raw bytes.
§Arguments
bytes- The raw public key bytes (exactly 32 bytes).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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