Enum tugger_code_signing::SigningCertificate[][src]

pub enum SigningCertificate {
    Memory(CapturedX509CertificateInMemorySigningKeyPair),
    PfxFile(PathBufStringCapturedX509CertificateInMemorySigningKeyPair),
    WindowsStoreAuto,
    WindowsStoreSubject(SystemStoreString),
    WindowsStoreSha1Thumbprint(SystemStoreString),
}

Represents a signing key and public certificate to sign something.

Variants

A parsed certificate and signing key stored in memory.

The private key is managed by the ring crate.

A PFX file containing validated certificate data.

The password to open the file is also tracked.

WindowsStoreAuto

Use an automatically chosen certificate in the Windows certificate store.

WindowsStoreSubject(SystemStoreString)

A certificate stored in a Windows certificate store with a subject name string.

See SystemStore for the possible system stores. SystemStore::My (the current user’s store) is typically where code signing certificates are located.

The string defines a value to match against in the certificate’s subject field to locate the certificate.

WindowsStoreSha1Thumbprint(SystemStoreString)

A certificate stored in a Windows certificate with a specified SHA-1 thumbprint.

See SystemStore for the possible system stores. SystemStore::My (the current user’s store) is typically where code signing certificates re located.

The string defines the SHA-1 thumbprint of the certificate. You can find this in the Details tab of the certificate when viewed in certmgr.msc.

Implementations

impl SigningCertificate[src]

pub fn from_pfx_file(
    path: impl AsRef<Path>,
    password: &str
) -> Result<Self, SigningError>
[src]

Obtain an instance referencing a file containing PFX / PKCS #12 data.

This is like Self::from_pfx_data except the certificate is referenced by path instead of persisted into memory. However, we do read the certificate data as part of constructing the instance to verify the certificate is well-formed.

pub fn from_pfx_data(data: &[u8], password: &str) -> Result<Self, SigningError>[src]

Obtain an instance by parsing PFX / PKCS #12 data.

PFX data is commonly encountered in .pfx or .p12 files, such as those created when exporting certificates from Apple’s Keychain Access or Windows’ certmgr.

The contents of the file require a password to decrypt. However, if no password was provided to create the data, this password may be the empty string.

pub fn windows_store_with_subject(
    store: &str,
    subject: impl ToString
) -> Result<Self, SigningError>
[src]

Construct an instance referring to a named certificate in a Windows certificate store.

store is the name of a Windows certificate store to open. See SystemStore for possible values. The My store (the store for the current user) is likely where code signing certificates live.

subject is a string to match against the certificate’s subject field to locate the certificate.

pub fn windows_store_with_sha1_thumbprint(
    store: &str,
    thumbprint: impl ToString
) -> Result<Self, SigningError>
[src]

Construct an instance referring to a certificate with a SHA-1 thumbprint in a Windows certificate store.

store is the name of a Windows certificate store to open. See SystemStore for possible values. The My store (the store for the current user) is likely where code signing certificates live.

thumbprint is the SHA-1 thumbprint of the certificate. It should uniquely identify any X.509 certificate.

pub fn to_windows_code_signing_certificate(
    &self
) -> Result<CodeSigningCertificate, SigningError>
[src]

Attempt to convert this instance to a CodeSigningCertificate for use signing on Windows.

Trait Implementations

impl Debug for SigningCertificate[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<SigningCertificate> for Signer[src]

fn from(cert: SigningCertificate) -> Self[src]

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]