List of usage examples for org.bouncycastle.pkcs PKCS8EncryptedPrivateKeyInfoBuilder PKCS8EncryptedPrivateKeyInfoBuilder
public PKCS8EncryptedPrivateKeyInfoBuilder(PrivateKeyInfo privateKeyInfo)
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*/ }