Passay 简明教程

Passay - Overview

Passay 是一个基于 Java 的密码生成和验证库。它在验证/生成密码时提供全面的功能列表,并且具有高度的可配置性。

Passay is a Java based Password generation and validation library. It provides comprehensive features list in order to validate/generate passwords and is highly configurable.

Passay Components

Passay API 具有 3 个核心组件。

Passay API has 3 core components.

  1. Rule − one or more rules which define a password policy rule set.

  2. PasswordValidator − A validator component which validates a password against a given rule set.

  3. PasswordGenerator − A generator component which produces passwords to satisfy a given rule set.

Rule overview

规则是密码验证和生成的基础模块。规则主要有两大类:

Rules are the foundation blocks for both password validation and generation. There are two broad categories of rules:

  1. Positive match require that passwords satisfy a rule.

  2. Negative match reject passwords that satisfy a rule.

Features

以下是 Passay 库提供的部分功能。

Following are some of the features that Passay library provides.

  1. Password Validation − Passay library helps in enforcing a password policy by validating passwords against a configurable rule set. It has a rich set of existing rules for common use-cases. For additional cases, it provides a simple Rule interface to implement the custom rule.

  2. Password Generation − It provides a configurable rule set which can be used to generate passwords as well.

  3. Command Line Tools − It provides tools to automate password policy enforcement.

  4. convenient − Easy to use.

  5. Extensible − All Passay components are extensible.

  6. Supports Internalization - Passay components are internationalization ready.