Example usage for org.bouncycastle.pkcs PKCS8EncryptedPrivateKeyInfoBuilder PKCS8EncryptedPrivateKeyInfoBuilder

List of usage examples for org.bouncycastle.pkcs PKCS8EncryptedPrivateKeyInfoBuilder PKCS8EncryptedPrivateKeyInfoBuilder

Introduction

In this page you can find the example usage for org.bouncycastle.pkcs PKCS8EncryptedPrivateKeyInfoBuilder PKCS8EncryptedPrivateKeyInfoBuilder.

Prototype

public PKCS8EncryptedPrivateKeyInfoBuilder(PrivateKeyInfo privateKeyInfo) 

Source Link

Usage

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

License:Open Source License

PKCS8EncryptedPrivateKeyInfo encrypt(final PrivateKey privateKey) {
    ParamUtil.requireNonNull("privateKey", privateKey);
    PrivateKeyInfo privateKeyInfo = PrivateKeyInfo.getInstance(privateKey.getEncoded());
    PKCS8EncryptedPrivateKeyInfoBuilder builder = new PKCS8EncryptedPrivateKeyInfoBuilder(privateKeyInfo);
    synchronized (encryptor) {
        return builder.build(encryptor);
    }/*from ww  w.ja v a  2s.  c  o  m*/
}