pub struct WindowsSigner { /* private fields */ }Expand description
Configuration for Windows signtool signing.
Implementations§
Source§impl WindowsSigner
impl WindowsSigner
Sourcepub fn from_env() -> Result<Option<Self>, SigntoolConfigError>
pub fn from_env() -> Result<Option<Self>, SigntoolConfigError>
Construct from environment variables.
Checks for certificate-based signing first, then Azure Trusted Signing.
Returns Ok(None) when no signing variables are set.
§Errors
SigntoolConfigError::IncompleteCertificateConfigurationwhen only some certificate variables are set.SigntoolConfigError::IncompleteAzureConfigurationwhen only some Azure variables are set.SigntoolConfigError::AzureMetadataWritewhen generating Azure metadata fails.
Sourcepub fn sign(&self, path: &Path) -> Result<(), SigntoolError>
pub fn sign(&self, path: &Path) -> Result<(), SigntoolError>
Sign a file with signtool.
If the file is already Authenticode-signed, it is skipped. Unlike macOS codesign --force
which replaces existing signatures, signtool adds nested signatures — so repeatedly
signing the same file would accumulate signatures and grow the file.
§Errors
SigntoolError::NonUtf8Pathif a path argument is not valid UTF-8.SigntoolError::Signif signtool cannot be spawned or exits with a non-zero status.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowsSigner
impl RefUnwindSafe for WindowsSigner
impl Send for WindowsSigner
impl Sync for WindowsSigner
impl Unpin for WindowsSigner
impl UnsafeUnpin for WindowsSigner
impl UnwindSafe for WindowsSigner
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