pub struct ApiKey { /* private fields */ }Expand description
An App Store Connect API key: the (key ID, issuer ID, private key) triple from App Store Connect → Users and Access → Integrations → App Store Connect API. Signs the short-lived ES256 JWTs the API requires as a bearer token on every request.
Implementations§
Source§impl ApiKey
impl ApiKey
Sourcepub fn from_p8_file(
key_id: impl Into<String>,
issuer_id: impl Into<String>,
p8_path: impl AsRef<Path>,
) -> Result<Self>
pub fn from_p8_file( key_id: impl Into<String>, issuer_id: impl Into<String>, p8_path: impl AsRef<Path>, ) -> Result<Self>
Load a key from a PEM-encoded .p8 private key file — the file App
Store Connect lets you download once, at key-creation time.
Sourcepub fn from_p8_pem(
key_id: impl Into<String>,
issuer_id: impl Into<String>,
pem: &str,
) -> Result<Self>
pub fn from_p8_pem( key_id: impl Into<String>, issuer_id: impl Into<String>, pem: &str, ) -> Result<Self>
Load a key from an already-in-memory PEM string.
Sourcepub fn with_lifetime_secs(self, secs: u64) -> Self
pub fn with_lifetime_secs(self, secs: u64) -> Self
Override the token lifetime in seconds. Values above Apple’s 20 minute ceiling are clamped down to it.
pub fn key_id(&self) -> &str
pub fn lifetime_secs(&self) -> u64
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiKey
impl RefUnwindSafe for ApiKey
impl Send for ApiKey
impl Sync for ApiKey
impl Unpin for ApiKey
impl UnsafeUnpin for ApiKey
impl UnwindSafe for ApiKey
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