Struct SignedDataVerifier

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

A verifier for signed data, commonly used for verifying and decoding signed Apple server notifications and transactions.

Implementations§

Source§

impl SignedDataVerifier

Source

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

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.
§Returns

A new SignedDataVerifier instance.

Source§

impl SignedDataVerifier

Source

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

Verifies and decodes a signed renewal info.

This method takes a signed renewal info string, verifies its authenticity and integrity, and returns the decoded payload as a JWSRenewalInfoDecodedPayload if the verification is successful.

§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 signed transaction.

This method takes a signed transaction string, verifies its authenticity and integrity, and returns the decoded payload as a JWSTransactionDecodedPayload if the verification is successful.

§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 a signed notification.

This method takes a signed notification string, verifies its authenticity and integrity, and returns the decoded payload as a ResponseBodyV2DecodedPayload if the verification is successful.

§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 notification.

This method takes a signed notification string, verifies its authenticity and integrity, and returns the decoded payload as a ResponseBodyV2DecodedPayload if the verification is successful.

§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.

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.