List of usage examples for org.bouncycastle.pkcs PKCS8EncryptedPrivateKeyInfoBuilder build
public PKCS8EncryptedPrivateKeyInfo build(OutputEncryptor encryptor)
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 w w w .j a va2s. co m }