Class Drupal7Encoder

  • All Implemented Interfaces:
    Encoder

    public class Drupal7Encoder
    extends AbstractPHPHashEncoder
    http://stackoverflow.com/questions/5031662/what-is-drupals-default-password- encryption-method
    • Constructor Detail

      • Drupal7Encoder

        public Drupal7Encoder()
    • Method Detail

      • isOfType

        public boolean isOfType​(byte[] encodedBytes,
                                String charset)
        Description copied from interface: Encoder
        Determine if this encoder may have been used to create the provided encoded bytes. This method should only be used if it is very likely to be the right encoder.
        Specified by:
        isOfType in interface Encoder
        Overrides:
        isOfType in class AbstractEncoder
        Parameters:
        encodedBytes - encoded bytes
        charset - character set
        Returns:
        this almost certainly was encoded with a similar encoder
      • match

        public boolean match​(byte[] encodedData,
                             byte[] unencodedData,
                             byte[] passphrase,
                             String charset)
        Description copied from interface: Encoder
        Check if the provide un-encoded data would match the encoded data if it was encoded.
        Specified by:
        match in interface Encoder
        Overrides:
        match in class AbstractEncoder
        Parameters:
        encodedData - encoded data
        unencodedData - un-encoded data
        passphrase - passphrase if supported
        charset - character set
        Returns:
        matches
      • encode

        public byte[] encode​(byte[] toEncode,
                             byte[] salt,
                             byte[] passphrase,
                             String charset)
                      throws EncoderException
        Description copied from interface: Encoder
        Encode a string
        Parameters:
        toEncode - data to encode
        salt - salt if supported
        passphrase - passphrase if supported
        charset - character set
        Returns:
        encoded bytes
        Throws:
        EncoderException - if encoding fails