Class KeyResolverAdapter

    • Constructor Detail

      • KeyResolverAdapter

        public KeyResolverAdapter()
    • Method Detail

      • resolvePublicKey

        public java.security.PublicKey resolvePublicKey​(Version version,
                                                        Purpose purpose,
                                                        FooterClaims footer)
        Description copied from interface: KeyResolver
        Returns the signing key that should be used to validate a digital signature for the paseto token.
        Specified by:
        resolvePublicKey in interface KeyResolver
        Parameters:
        version - the version of the token to be parsed
        purpose - the purpose of the token to be parsed
        footer - the footer containing claims or plain text of the token to be parsed
        Returns:
        the public key that should be used to validate a digital signature for the token.
      • resolveSharedKey

        public javax.crypto.SecretKey resolveSharedKey​(Version version,
                                                       Purpose purpose,
                                                       FooterClaims footer)
        Description copied from interface: KeyResolver
        Returns the signing key that should be used to validate a digital signature for the paseto token.
        Specified by:
        resolveSharedKey in interface KeyResolver
        Parameters:
        version - the version of the token to be parsed
        purpose - the purpose of the token to be parsed
        footer - the footer containing claims or plain text of the token to be parsed
        Returns:
        the shared key that should be used to decrypt the token.
      • resolvePublicKeyBytes

        protected byte[] resolvePublicKeyBytes​(Version version,
                                               Purpose purpose,
                                               FooterClaims footer)
        Convenience method invoked by resolvePublicKey(Version, Purpose, FooterClaims) that obtains the necessary public key bytes. This implementation simply throws an exception: if the paseto token parsed is 'public'.
        Parameters:
        version - the version of the token to be parsed
        purpose - the purpose of the token to be parsed
        footer - the footer containing claims or plain text of the token to be parsed
        Returns:
        the signing key bytes to use to verify the paseto token signature.
      • resolveSharedKeyBytes

        protected byte[] resolveSharedKeyBytes​(Version version,
                                               Purpose purpose,
                                               FooterClaims footer)
        Convenience method invoked by resolveSharedKey(Version, Purpose, FooterClaims) that obtains the necessary signing key bytes. This implementation simply throws an exception: if the paseto token parsed is 'local'.
        Parameters:
        version - the version of the token to be parsed
        purpose - the purpose of the token to be parsed
        footer - the footer containing claims or plain text of the token to be parsed
        Returns:
        the shared key that should be used to decrypt the token.