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
impl SignedDataVerifier
Sourcepub fn new(
root_certificates: Vec<Vec<u8>>,
environment: Environment,
bundle_id: String,
app_apple_id: Option<i64>,
) -> Self
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::PRODUCTIONorEnvironment::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
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 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.
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 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.
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 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.
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 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.