Skip to main content

SignedDataVerifier

Struct SignedDataVerifier 

Source
pub struct SignedDataVerifier { /* private fields */ }
Expand description

A verifier and decoder class designed to decode signed data from the App Store.

Implementations§

Source§

impl SignedDataVerifier

Source

pub fn new( root_certificates: Vec<Vec<u8>>, environment: Environment, bundle_id: String, app_apple_id: Option<i64>, enable_online_checks: bool, ) -> Result<Self, SignedDataVerifierError>

Creates a new SignedDataVerifier instance with the specified parameters.

§Arguments
  • root_certificates - A vector of DER-encoded root certificates used for verification.
  • environment - The environment (e.g., Environment::PRODUCTION or Environment::SANDBOX).
  • bundle_id - The bundle ID associated with the application.
  • app_apple_id - An optional Apple ID associated with the application. Required when environment is Environment::Production.
  • enable_online_checks - Whether to check certificate expiration against the current date rather than the JWS’s signed date, and cache the verified public key.
§Returns
  • Ok(SignedDataVerifier) on success.
  • Err(SignedDataVerifierError::InvalidAppAppleId) if environment is Environment::Production and app_apple_id is None.
Source§

impl SignedDataVerifier

Source

pub fn verify_and_decode_renewal_info( &self, signed_renewal_info: &str, ) -> Result<JWSRenewalInfoDecodedPayload, SignedDataVerifierError>

Verifies and decodes a signedRenewalInfo obtained from the App Store Server API, an App Store Server Notification, or from a device See JWSRenewalInfo

§Arguments
  • signed_renewal_info - The signed renewal info string to verify and decode.
§Returns
  • Ok(JWSRenewalInfoDecodedPayload) if verification and decoding are successful.
  • Err(SignedDataVerifierError) if verification or decoding fails, with error details.
Source

pub fn verify_and_decode_signed_transaction( &self, signed_transaction: &str, ) -> Result<JWSTransactionDecodedPayload, SignedDataVerifierError>

Verifies and decodes a signedTransaction obtained from the App Store Server API, an App Store Server Notification, or from a device See JWSTransaction

§Arguments
  • signed_transaction - The signed transaction string to verify and decode.
§Returns
  • Ok(JWSTransactionDecodedPayload) if verification and decoding are successful.
  • Err(SignedDataVerifierError) if verification or decoding fails, with error details.
Source

pub fn verify_and_decode_notification( &self, signed_payload: &str, ) -> Result<ResponseBodyV2DecodedPayload, SignedDataVerifierError>

Verifies and decodes an App Store Server Notification signedPayload See signedPayload

§Arguments
  • signed_payload - The signed notification string to verify and decode.
§Returns
  • Ok(ResponseBodyV2DecodedPayload) if verification and decoding are successful.
  • Err(SignedDataVerifierError) if verification or decoding fails, with error details.
Source

pub fn verify_and_decode_app_transaction( &self, signed_app_transaction: &str, ) -> Result<AppTransaction, SignedDataVerifierError>

Verifies and decodes a signed AppTransaction See AppTransaction

§Arguments
  • signed_app_transaction - The signed app transaction string to verify and decode.
§Returns
  • Ok(AppTransaction) if verification and decoding are successful.
  • Err(SignedDataVerifierError) if verification or decoding fails, with error details.
Source

pub fn verify_and_decode_realtime_request( &self, signed_payload: &str, ) -> Result<DecodedRealtimeRequestBody, SignedDataVerifierError>

Verifies and decodes a realtime request the App Store sends to your Get Retention Message endpoint.

§Arguments
  • signed_payload - The payload the App Store server sends to your server.
§Returns
  • Ok(DecodedRealtimeRequestBody) if verification and decoding are successful.
  • Err(SignedDataVerifierError) if verification or decoding fails, with error details.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.