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 Summary
ConstructorDescriptionConstructor to build an instance of SkillRequestSignatureVerifier. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeQuietly
(Closeable closeable) Close and eats exception if any.void
verify
(AlexaHttpRequest alexaHttpRequest) Verifies the certificate authenticity using the configured TrustStore and the signature of the skill request.
-
Constructor Details
-
SkillRequestSignatureVerifier
public SkillRequestSignatureVerifier()Constructor to build an instance of SkillRequestSignatureVerifier. -
SkillRequestSignatureVerifier
- Parameters:
proxy
- proxy configuration for certificate retrieval
-
-
Method Details
-
getCertificateFromCache
- Parameters:
url
- URL where the certificate can be found.- Returns:
- public key certificate
-
verify
Verifies the certificate authenticity using the configured TrustStore and the signature of the skill request. This method will throw aSecurityException
if the signature does not pass verification. Verifies an incoming request.- Specified by:
verify
in interfaceSkillServletVerifier
- Parameters:
alexaHttpRequest
- request performed by Alexa
-
closeQuietly
Close and eats exception if any.- Parameters:
closeable
- Closeable object.
-