Class DeedAuthenticationProvider

  • All Implemented Interfaces:
    org.springframework.security.authentication.AuthenticationProvider

    @Component
    public class DeedAuthenticationProvider
    extends Object
    implements org.springframework.security.authentication.AuthenticationProvider
    • Constructor Detail

      • DeedAuthenticationProvider

        public DeedAuthenticationProvider()
    • Method Detail

      • authenticate

        public org.springframework.security.core.Authentication authenticate​(org.springframework.security.core.Authentication authentication)
                                                                      throws org.springframework.security.core.AuthenticationException
        Specified by:
        authenticate in interface org.springframework.security.authentication.AuthenticationProvider
        Throws:
        org.springframework.security.core.AuthenticationException
      • supports

        public boolean supports​(Class<?> authentication)
        Specified by:
        supports in interface org.springframework.security.authentication.AuthenticationProvider
      • validateSignedMessage

        public boolean validateSignedMessage​(String walletAddress,
                                             String rawMessage,
                                             String signedMessage)
                                      throws UnsupportedEncodingException,
                                             SignatureException
        Parameters:
        walletAddress - wallet Address (wallet public key)
        rawMessage - raw signed message
        signedMessage - encrypted message
        Returns:
        true if the message has been decrypted successfully, else false
        Throws:
        UnsupportedEncodingException - when UTF-8 isn't recognized as Encoding Charset
        SignatureException - when an error occurs while decrypting signed message