A class providing utility methods for verifying and decoding App Store signed data.

Example Usage:

const verifier = new SignedDataVerifier([appleRoot, appleRoot2], true, Environment.SANDBOX, "com.example")

try {
const decodedNotification = verifier.verifyAndDecodeNotification("ey...")
console.log(decodedNotification)
} catch (e) {
console.error(e)
}

Constructors

  • Parameters

    • appleRootCertificates: Buffer[]

      A list of DER-encoded root certificates

    • enableOnlineChecks: boolean

      Whether to enable revocation checking and check expiration using the current date

    • environment: Environment

      The App Store environment to target for checks

    • bundleId: string

      The app's bundle identifier

    • OptionalappAppleId: number

      The app's identifier, ommitted in the sandbox environment

    Returns SignedDataVerifier

Properties

appAppleId?: number
bundleId: string
enableOnlineChecks: boolean
environment: Environment
rootCertificates: X509Certificate[]

Methods

  • Parameters

    • cert: X509Certificate
    • issuer: X509Certificate

    Returns Promise<void>

  • Verifies and decodes a signed AppTransaction See AppTransaction

    Parameters

    • signedAppTransaction: string

      The signed AppTransaction

    Returns Promise<AppTransaction>

    The decoded AppTransaction after validation

    VerificationException Thrown if the data could not be verified

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

    Parameters

    • signedRenewalInfo: string

      The signedRenewalInfo field

    Returns Promise<JWSRenewalInfoDecodedPayload>

    The decoded renewal info after verification

    VerificationException Thrown if the data could not be verified

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

    Parameters

    • signedTransactionInfo: string

    Returns Promise<JWSTransactionDecodedPayload>

    The decoded transaction info after verification

    VerificationException Thrown if the data could not be verified

  • Parameters

    • trustedRoots: X509Certificate[]
    • leaf: X509Certificate
    • intermediate: X509Certificate
    • effectiveDate: Date

    Returns Promise<KeyObject>

  • Type Parameters

    • T

    Parameters

    • jwt: string
    • validator: Validator<T>
    • signedDateExtractor: ((decodedJWT: T) => Date)
        • (decodedJWT): Date
        • Parameters

          • decodedJWT: T

          Returns Date

    Returns Promise<T>

  • Parameters

    • OptionalbundleId: string
    • OptionalappAppleId: number
    • Optionalenvironment: string

    Returns void