当前位置: 首页>>代码示例>>Java>>正文


Java PasswordEncryptor类代码示例

本文整理汇总了Java中org.jasypt.util.password.PasswordEncryptor的典型用法代码示例。如果您正苦于以下问题:Java PasswordEncryptor类的具体用法?Java PasswordEncryptor怎么用?Java PasswordEncryptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PasswordEncryptor类属于org.jasypt.util.password包,在下文中一共展示了PasswordEncryptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
@Override
protected void configure() {
    bind(JsonTransformer.class);
    bind(JwtGenerator.class);

    bind(PasswordEncryptor.class).to(RFC2307SMD5PasswordEncryptor.class);

    bind(UserService.class).to(UserServiceImpl.class);
    bind(UsersController.class);

    bind(RoleService.class).to(RoleServiceImpl.class);
    bind(RoleController.class);

    bind(CompanyService.class).to(CompanyServiceImpl.class);
    bind(CompaniesController.class);

    bind(UrlDecoder.class);
    bind(FilterRequestFactory.class);
}
 
开发者ID:CyborTronik,项目名称:fluent-registry,代码行数:20,代码来源:RegistryModule.java

示例2: createAuthenticator

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
/**
 * <p>If a credentialFile is provided, this method will use that file to populate the list of Peers the Authenticator
 * checks during request processing.  If instead the "users" and "passwords" Strings are provided, this method will use
 * those to populate the list of Peers.</p>
 * @return An Authenticator appropriate for registering with Jersey as described
 * https://dropwizard.github.io/dropwizard/manual/auth.html
 */
public Authenticator<BasicCredentials, Peer> createAuthenticator() {
    PasswordEncryptor passwordEncryptor = encryptor.getPasswordEncryptor();
    if (this.credentialFile != null) {
        InputStream allowedPeersResource = this.getClass().getClassLoader().getResourceAsStream(this.credentialFile);
        return new AllowedPeerAuthenticator(new FlatFilePeerDAO(allowedPeersResource),
                                            passwordEncryptor);
    }
    else if (this.users != null && this.passwords != null && this.delimiter != null) {
        return new AllowedPeerAuthenticator(new StringPeerDAO(this.users, this.passwords, this.delimiter),
                                            passwordEncryptor);
    }
    else {
        throw new IllegalStateException("Illegal call to createAuthenticator() when no valid configuration was set");
    }
}
 
开发者ID:washingtonpost,项目名称:dropwizard-peer-authenticator,代码行数:23,代码来源:AllowedPeerConfiguration.java

示例3: main

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
public static void main(String[] args) {
  String password = args.length >= 1 ? args[0] : "strong";
  String text = args.length >= 2 ? args[1] : "i am hero";

  PasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
  String encryptedPassword = passwordEncryptor.encryptPassword(password);

  BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
  textEncryptor.setPassword(encryptedPassword);
  String myEncryptedText = textEncryptor.encrypt(text);

  System.out.println(myEncryptedText);
}
 
开发者ID:jandy-team,项目名称:jandy,代码行数:14,代码来源:Main.java

示例4: getPasswordEncryptor

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
public PasswordEncryptor getPasswordEncryptor() {
    switch (this) {
        case NONE : return null;
        case BASIC : return new BasicPasswordEncryptor();
        case STRONG : return new StrongPasswordEncryptor();
        default : throw new IllegalStateException("No support for encryptor type " + this);
    }
}
 
开发者ID:washingtonpost,项目名称:dropwizard-peer-authenticator,代码行数:9,代码来源:AllowedPeerConfiguration.java

示例5: UserCommandHandler

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
@Autowired
public UserCommandHandler(Repository<UserAggregate> userAggregateRepository,
                          UserRepository userRepository,
                          PasswordEncryptor passwordEncryptor) {
    this.userAggregateRepository = userAggregateRepository;
    this.userRepository = userRepository;
    this.passwordEncryptor = passwordEncryptor;
}
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:9,代码来源:UserCommandHandler.java

示例6: setUp

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    // set up the encryptor here
    PasswordEncryptor passwordEncryptor = new TestPasswordEncryptor();

    fixture = Fixtures.newGivenWhenThenFixture(UserAggregate.class);
    UserCommandHandler commandHandler = new UserCommandHandler(fixture.getRepository(), mock(UserRepository.class), passwordEncryptor);
    fixture.registerAnnotatedCommandHandler(commandHandler);
    fixture.setReportIllegalStateChange(false);
}
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:11,代码来源:UserCommandHandlerTest.java

示例7: AuthenticationService

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
public AuthenticationService(UserRepository userRepository, PasswordEncryptor passwordEncryptor, String secret, Period expiresDuration, Period passwordExpiresDuration, Period passwordReminder) {
    if (secret.length() < SECRET_MIN_LENGTH) {
        throw new IllegalArgumentException("secret must be at least " + SECRET_MIN_LENGTH + " characters long, " +
                "but it was only " + secret.length());
    }
    this.userRepository = userRepository;
    this.passwordEncryptor = passwordEncryptor;
    this.expiresDuration = expiresDuration;
    this.passwordExpiresDuration = passwordExpiresDuration;
    this.passwordReminderDuration = passwordReminder;
    this.base64 = new Base64(-1, null, true);
    this.secret = secret.getBytes(UTF_8);
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:14,代码来源:AuthenticationService.java

示例8: UserServiceImpl

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
@Inject
public UserServiceImpl(UserRepository userRepository, PasswordEncryptor passwordEncryptor) {
    this.userRepository = userRepository;
    this.passwordEncryptor = passwordEncryptor;
}
 
开发者ID:CyborTronik,项目名称:fluent-registry,代码行数:6,代码来源:UserServiceImpl.java

示例9: matchPassword

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
private boolean matchPassword(String password) {
    PasswordEncryptor pe = new BasicPasswordEncryptor();
    return pe.checkPassword(password, encryptedPassword);
}
 
开发者ID:OptimalBI,项目名称:optimal-spyglass-open-source,代码行数:5,代码来源:Main.java

示例10: setPasswordEncryptor

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
public void setPasswordEncryptor(PasswordEncryptor passwordEncryptor)
{
    this.passwordEncryptor = passwordEncryptor;
}
 
开发者ID:alfameCom,项目名称:salasanasiilo,代码行数:5,代码来源:JasyptDigester.java

示例11: AllowedPeerAuthenticator

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
public AllowedPeerAuthenticator(PeerDAO peerDAO, PasswordEncryptor passwordEncryptor) {
    this.allPeers = peerDAO.findAll();
    this.passwordEncryptor = passwordEncryptor;
    LOGGER.info("Constructed Authenticator with {} allowed peers", this.allPeers.size());
}
 
开发者ID:washingtonpost,项目名称:dropwizard-peer-authenticator,代码行数:6,代码来源:AllowedPeerAuthenticator.java

示例12: getEncryptor

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
PasswordEncryptor getEncryptor() {
    return Encryptor.valueOf(type).getPasswordEncryptor();
}
 
开发者ID:washingtonpost,项目名称:dropwizard-peer-authenticator,代码行数:4,代码来源:JasyptEncryptorParams.java

示例13: passwordEncryptor

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
@Bean
public PasswordEncryptor passwordEncryptor() {
    return new StrongPasswordEncryptor();
}
 
开发者ID:bartgerard,项目名称:ubrew_v0.1,代码行数:5,代码来源:CoreServiceConfig.java

示例14: getPasswordEncryptor

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
public PasswordEncryptor getPasswordEncryptor() {
    return passwordEncryptor;
}
 
开发者ID:bartgerard,项目名称:ubrew_v0.1,代码行数:4,代码来源:BuilderContext.java

示例15: encryptor

import org.jasypt.util.password.PasswordEncryptor; //导入依赖的package包/类
private PasswordEncryptor encryptor() {
    return new HexPasswordEncryptor();
}
 
开发者ID:geralddejong,项目名称:darwinathome,代码行数:4,代码来源:Player.java


注:本文中的org.jasypt.util.password.PasswordEncryptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。