Class SkillRequestSignatureVerifier

java.lang.Object
io.micronaut.aws.alexa.httpserver.verifiers.SkillRequestSignatureVerifier
All Implemented Interfaces:
SkillServletVerifier

@Requires(property="alexa.verifiers.signature",notEquals="false") @Requires(condition=RequestSignatureCheckSystemPropertyCondition.class) @Singleton public class SkillRequestSignatureVerifier extends Object implements SkillServletVerifier
NOTICE: This class is forked from https://github.com/alexa/alexa-skills-kit-sdk-for-java ask-sdk-servlet-support module Provides a utility method to verify the signature of a skill request.
Since:
2.0.0
Author:
sdelamo
  • Constructor Details

    • SkillRequestSignatureVerifier

      public SkillRequestSignatureVerifier()
      Constructor to build an instance of SkillRequestSignatureVerifier.
    • SkillRequestSignatureVerifier

      public SkillRequestSignatureVerifier(Proxy proxy)
      Parameters:
      proxy - proxy configuration for certificate retrieval
  • Method Details

    • getCertificateFromCache

      public X509Certificate getCertificateFromCache(String url)
      Parameters:
      url - URL where the certificate can be found.
      Returns:
      public key certificate
    • verify

      public void verify(AlexaHttpRequest alexaHttpRequest)
      Verifies the certificate authenticity using the configured TrustStore and the signature of the skill request. This method will throw a SecurityException if the signature does not pass verification. Verifies an incoming request.
      Specified by:
      verify in interface SkillServletVerifier
      Parameters:
      alexaHttpRequest - request performed by Alexa
    • closeQuietly

      public static void closeQuietly(Closeable closeable)
      Close and eats exception if any.
      Parameters:
      closeable - Closeable object.