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

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

Introduction

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

Prototype

public JcePKCSPBEOutputEncryptorBuilder setProvider(String providerName) 

Source Link

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 {//  w  w  w  .  j a  v  a 2 s. c  om
        encryptor = eb.build(password);
    } catch (OperatorCreationException ex) {
        throw new P11TokenException(ex.getMessage(), ex);
    }

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