pub struct PackageSigner { /* private fields */ }Expand description
Package signer for creating and verifying signatures
Implementations§
Source§impl PackageSigner
impl PackageSigner
Sourcepub fn from_signing_key(signing_key: SigningKey) -> Self
pub fn from_signing_key(signing_key: SigningKey) -> Self
Create a signer from an existing signing key
Sourcepub fn verifier_only() -> Self
pub fn verifier_only() -> Self
Create a verifier (no signing capability)
Sourcepub fn add_trusted_key(&mut self, public_key: &[u8]) -> Result<()>
pub fn add_trusted_key(&mut self, public_key: &[u8]) -> Result<()>
Add a trusted public key for verification
Sourcepub fn public_key(&self) -> Option<Vec<u8>>
pub fn public_key(&self) -> Option<Vec<u8>>
Get public key for verification
Sourcepub fn export_signing_key(&self) -> Option<Vec<u8>>
pub fn export_signing_key(&self) -> Option<Vec<u8>>
Export signing key (use with caution!)
Sourcepub fn sign_package(&self, package: &Package) -> Result<PackageSignature>
pub fn sign_package(&self, package: &Package) -> Result<PackageSignature>
Sign a package
Sourcepub fn verify_package(
&self,
package: &Package,
signature: &PackageSignature,
) -> Result<bool>
pub fn verify_package( &self, package: &Package, signature: &PackageSignature, ) -> Result<bool>
Verify package signature
Sourcepub fn save_signature<P: AsRef<Path>>(
signature: &PackageSignature,
path: P,
) -> Result<()>
pub fn save_signature<P: AsRef<Path>>( signature: &PackageSignature, path: P, ) -> Result<()>
Save signature to file
Sourcepub fn load_signature<P: AsRef<Path>>(path: P) -> Result<PackageSignature>
pub fn load_signature<P: AsRef<Path>>(path: P) -> Result<PackageSignature>
Load signature from file
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PackageSigner
impl RefUnwindSafe for PackageSigner
impl Send for PackageSigner
impl Sync for PackageSigner
impl Unpin for PackageSigner
impl UnsafeUnpin for PackageSigner
impl UnwindSafe for PackageSigner
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more