org.keycloak.models.utils

## Class SHAPasswordEncoder

- java.lang.Object
- - org.keycloak.models.utils.SHAPasswordEncoder

-     public class SHAPasswordEncoder
      extends Object

  Password that uses SHA to encode passwords. You can always change the SHA strength by specifying a valid integer when creating a new instance.

  Passwords are returned with a Base64 encoding.

  Author:
    Pedro Silva

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SHAPasswordEncoder(int strength)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `encode(String rawPassword)`
    `protected MessageDigest` | `getMessageDigest()`
    `int` | `getStrength()`
    `boolean` | `verify(String rawPassword, String encodedPassword)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SHAPasswordEncoder

          public SHAPasswordEncoder(int strength)

  - ### Method Detail

    - #### encode

          public String encode(String rawPassword)

    - #### verify

          public boolean verify(String rawPassword,
                                String encodedPassword)

    - #### getMessageDigest

          protected final MessageDigest getMessageDigest()
                                                  throws IllegalArgumentException

      Throws:
        `IllegalArgumentException`

    - #### getStrength

          public int getStrength()

Copyright © 2021 JBoss by Red Hat. All rights reserved.