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
impl SignedDataVerifier
Sourcepub fn new(
root_certificates: Vec<Vec<u8>>,
environment: Environment,
bundle_id: String,
app_apple_id: Option<i64>,
enable_online_checks: bool,
) -> Result<Self, SignedDataVerifierError>
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::PRODUCTIONorEnvironment::SANDBOX).bundle_id- The bundle ID associated with the application.app_apple_id- An optional Apple ID associated with the application. Required whenenvironmentisEnvironment::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)ifenvironmentisEnvironment::Productionandapp_apple_idisNone.
Source§impl SignedDataVerifier
impl SignedDataVerifier
Sourcepub fn verify_and_decode_renewal_info(
&self,
signed_renewal_info: &str,
) -> Result<JWSRenewalInfoDecodedPayload, SignedDataVerifierError>
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.
Sourcepub fn verify_and_decode_signed_transaction(
&self,
signed_transaction: &str,
) -> Result<JWSTransactionDecodedPayload, SignedDataVerifierError>
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.
Sourcepub fn verify_and_decode_notification(
&self,
signed_payload: &str,
) -> Result<ResponseBodyV2DecodedPayload, SignedDataVerifierError>
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.
Sourcepub fn verify_and_decode_app_transaction(
&self,
signed_app_transaction: &str,
) -> Result<AppTransaction, SignedDataVerifierError>
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.
Sourcepub fn verify_and_decode_realtime_request(
&self,
signed_payload: &str,
) -> Result<DecodedRealtimeRequestBody, SignedDataVerifierError>
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§
impl !Freeze for SignedDataVerifier
impl RefUnwindSafe for SignedDataVerifier
impl Send for SignedDataVerifier
impl Sync for SignedDataVerifier
impl Unpin for SignedDataVerifier
impl UnsafeUnpin for SignedDataVerifier
impl UnwindSafe for SignedDataVerifier
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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