Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## vut.msa.security
Class MessageHash

    java.lang.Object
      vut.msa.security.MessageHash

    public class MessageHash

extends java.lang.Object

Method Summary
`java.lang.String` | `encrypt(java.lang.String plaintext)` Metoda vytvori hash (SHA-256) zo zadaneho retazca.
`static MessageHash` | `getInstance()` Funkcia vráti inštanciu triedy.
`boolean` | `validateMessage(java.lang.String message, java.lang.String digest)` Metoda sluzi na overenie zadaneho retazca s hash kodom (SHA-256).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static MessageHash getInstance()

  Funkcia vráti inštanciu triedy. V prípade, že inštancia neexistuje, tak ju vytvorí zavolaním konštruktora.

  Returns:
    inštancia triedy

### encrypt

    public java.lang.String encrypt(java.lang.String plaintext)

  Metoda vytvori hash (SHA-256) zo zadaneho retazca.

  Parameters:
    `plaintext` - retazec s textom, ktory sa ma zahashovat
  Returns:
    hash zo zadaneho retazca

### validateMessage

    public boolean validateMessage(java.lang.String message,
                                   java.lang.String digest)

  Metoda sluzi na overenie zadaneho retazca s hash kodom (SHA-256). Metoda predpoklada, ze retazec bude uzivatelsky vstup (zadanie hesla) a hash bude nacitany z databazy. Metoda potom porovna, ci uzivatel zadal spravne heslo.

  Parameters:
    `message` - textovy retazec
    `digest` - hash kod
  Returns:
    pravda, ak bol hash vytvoreny zo zadaneho retazca. Nepravda, ak nebol.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD