Example usage for org.bouncycastle.pkcs.jcajce JcePKCSPBEOutputEncryptorBuilder setIterationCount

List of usage examples for org.bouncycastle.pkcs.jcajce JcePKCSPBEOutputEncryptorBuilder setIterationCount

Introduction

In this page you can find the example usage for org.bouncycastle.pkcs.jcajce JcePKCSPBEOutputEncryptorBuilder setIterationCount.

Prototype

public JcePKCSPBEOutputEncryptorBuilder setIterationCount(int iterationCount) 

Source Link

Document

Set the iteration count for the PBE calculation.

Usage

From source file:org.xipki.commons.security.pkcs11.emulator.PrivateKeyCryptor.java

License:Open Source License

PrivateKeyCryptor(final char[] password) throws P11TokenException {
    ParamUtil.requireNonNull("password", password);
    JcePKCSPBEOutputEncryptorBuilder eb = new JcePKCSPBEOutputEncryptorBuilder(ALGO);
    eb.setProvider("BC");
    eb.setIterationCount(ITERATION_COUNT);
    try {//from  w  w  w . j  a  va  2  s  .c o  m
        encryptor = eb.build(password);
    } catch (OperatorCreationException ex) {
        throw new P11TokenException(ex.getMessage(), ex);
    }

    JcePKCSPBEInputDecryptorProviderBuilder db = new JcePKCSPBEInputDecryptorProviderBuilder();
    decryptorProvider = db.build(password);
}