pub trait AppleCertificateBuilder: Sized {
// Required methods
fn apple_subject(
&mut self,
team_id: &str,
person_name: &str,
country: &str
) -> Result<(), AppleCodesignError>;
fn apple_email_address(
&mut self,
address: &str
) -> Result<(), AppleCodesignError>;
fn apple_extended_key_usage(
&mut self,
usage: ExtendedKeyUsagePurpose
) -> Result<(), AppleCodesignError>;
fn apple_code_signing_certificate_extension(
&mut self,
extension: CodeSigningCertificateExtension
) -> Result<(), AppleCodesignError>;
fn apple_certificate_profile(
&mut self,
profile: CertificateProfile
) -> Result<(), AppleCodesignError>;
fn apple_code_signing_extensions(
&self
) -> Vec<CodeSigningCertificateExtension>;
}
Expand description
Extensions to X509CertificateBuilder specializing in Apple certificate behavior.
Most callers should call Self::apple_certificate_profile to configure a preset profile for the certificate being generated. After that - and it is important it is after - call Self::apple_subject to define the subject field. If you call this after registering code signing extensions, it detects the appropriate format for the Common Name field.
Required Methods§
sourcefn apple_subject(
&mut self,
team_id: &str,
person_name: &str,
country: &str
) -> Result<(), AppleCodesignError>
fn apple_subject( &mut self, team_id: &str, person_name: &str, country: &str ) -> Result<(), AppleCodesignError>
This functions defines common attributes on the certificate subject.
team_id
is your Apple team id. It is a short alphanumeric string. You
can find this at https://developer.apple.com/account/#/membership/.
sourcefn apple_email_address(
&mut self,
address: &str
) -> Result<(), AppleCodesignError>
fn apple_email_address( &mut self, address: &str ) -> Result<(), AppleCodesignError>
Add an email address to the certificate’s subject name.
sourcefn apple_extended_key_usage(
&mut self,
usage: ExtendedKeyUsagePurpose
) -> Result<(), AppleCodesignError>
fn apple_extended_key_usage( &mut self, usage: ExtendedKeyUsagePurpose ) -> Result<(), AppleCodesignError>
Add an ExtendedKeyUsagePurpose to this certificate.
sourcefn apple_code_signing_certificate_extension(
&mut self,
extension: CodeSigningCertificateExtension
) -> Result<(), AppleCodesignError>
fn apple_code_signing_certificate_extension( &mut self, extension: CodeSigningCertificateExtension ) -> Result<(), AppleCodesignError>
Add a certificate extension as defined by a CodeSigningCertificateExtension instance.
sourcefn apple_certificate_profile(
&mut self,
profile: CertificateProfile
) -> Result<(), AppleCodesignError>
fn apple_certificate_profile( &mut self, profile: CertificateProfile ) -> Result<(), AppleCodesignError>
Add a CertificateProfile to this builder.
All certificate extensions relevant to this profile are added.
This should be the first function you call after creating an instance because other functions rely on the state that it sets.
sourcefn apple_code_signing_extensions(&self) -> Vec<CodeSigningCertificateExtension>
fn apple_code_signing_extensions(&self) -> Vec<CodeSigningCertificateExtension>
Find code signing extensions that are currently registered.