Class Webhook.Signature

java.lang.Object
com.stripe.net.Webhook.Signature
Enclosing class:
Webhook

public static final class Webhook.Signature extends Object
  • Field Details

  • Constructor Details

    • Signature

      public Signature()
  • Method Details

    • verifyHeader

      public static boolean verifyHeader(String payload, String sigHeader, String secret, long tolerance) throws SignatureVerificationException
      Verifies the signature header sent by Stripe. Throws a SignatureVerificationException if the verification fails for any reason.
      Parameters:
      payload - the payload sent by Stripe.
      sigHeader - the contents of the signature header sent by Stripe.
      secret - secret used to generate the signature.
      tolerance - maximum difference allowed between the header's timestamp and the current time
      Throws:
      SignatureVerificationException - if the verification fails.
    • verifyHeader

      public static boolean verifyHeader(String payload, String sigHeader, String secret, long tolerance, Clock clock) throws SignatureVerificationException
      Verifies the signature header sent by Stripe. Throws a SignatureVerificationException if the verification fails for any reason.
      Parameters:
      payload - the payload sent by Stripe.
      sigHeader - the contents of the signature header sent by Stripe.
      secret - secret used to generate the signature.
      tolerance - maximum difference allowed between the header's timestamp and the current time
      clock - instance of clock if you want to use custom time instance
      Throws:
      SignatureVerificationException - if the verification fails.