All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arangodb.shaded.vertx.ext.auth.HashingAlgorithm Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
/*
 * Copyright 2014 Red Hat, Inc.
 *
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  and Apache License v2.0 which accompanies this distribution.
 *
 *  The Eclipse Public License is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  The Apache License v2.0 is available at
 *  http://www.opensource.org/licenses/apache2.0.php
 *
 *  You may elect to redistribute this code under either of these licenses.
 */
package com.arangodb.shaded.vertx.ext.auth;

import com.arangodb.shaded.vertx.codegen.annotations.GenIgnore;
import com.arangodb.shaded.vertx.codegen.annotations.VertxGen;

import java.util.Collections;
import java.util.Set;

/**
 * Hashing Algorithm. A common interface to interact with any system provided algorithms.
 *
 * @author Paulo Lopes
 */
@VertxGen
public interface HashingAlgorithm {

  /**
   * return the symbolic name for the algorithm
   *
   * @return short id e.g.: sha512.
   */
  String id();

  /**
   * return the list of param names required for this algorithm.
   *
   * @return set of param names.
   */
  default Set params()  {
    return Collections.emptySet();
  }

  /**
   * Algorithm specific implementation.
   *
   * @return the hashed digest.
   */
  @GenIgnore
  String hash(HashString hashString, String password);

  /**
   * Should the encoded string use the default separator to split fields.
   * @return true by default.
   */
  default boolean needsSeparator() {
    return true;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy