Bouncy Castle Cryptography Library 1.85

org.bouncycastle.pkcs
Class PKCS8EncryptedPrivateKeyInfoBuilder

java.lang.Object
  extended byorg.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfoBuilder
Direct Known Subclasses:
JcaPKCS8EncryptedPrivateKeyInfoBuilder

public class PKCS8EncryptedPrivateKeyInfoBuilder
extends java.lang.Object

A class for creating EncryptedPrivateKeyInfo structures. EncryptedPrivateKeyInfo ::= SEQUENCE { encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}}, encryptedData EncryptedData } EncryptedData ::= OCTET STRING KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= { [] -- For local profiles }


Constructor Summary
PKCS8EncryptedPrivateKeyInfoBuilder(byte[] privateKeyInfo)
          Construct a builder around a DER-encoded PrivateKeyInfo.
PKCS8EncryptedPrivateKeyInfoBuilder(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo)
          Construct a builder around a parsed PrivateKeyInfo.
 
Method Summary
 PKCS8EncryptedPrivateKeyInfo build(OutputEncryptor encryptor)
          Encrypt the wrapped private key with .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS8EncryptedPrivateKeyInfoBuilder

public PKCS8EncryptedPrivateKeyInfoBuilder(byte[] privateKeyInfo)
Construct a builder around a DER-encoded PrivateKeyInfo.

Parameters:
privateKeyInfo - the encoded private-key bytes.

PKCS8EncryptedPrivateKeyInfoBuilder

public PKCS8EncryptedPrivateKeyInfoBuilder(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo)
Construct a builder around a parsed PrivateKeyInfo.

Parameters:
privateKeyInfo - the private key to be encrypted.
Method Detail

build

public PKCS8EncryptedPrivateKeyInfo build(OutputEncryptor encryptor)
Encrypt the wrapped private key with .

Parameters:
encryptor - a configured output encryptor.
Returns:
the resulting PKCS8EncryptedPrivateKeyInfo.

Bouncy Castle Cryptography Library 1.85