Class PKCS8EncryptedPrivateKeyInfoBuilder
java.lang.Object
org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfoBuilder
- Direct Known Subclasses:
JcaPKCS8EncryptedPrivateKeyInfoBuilder
A class for creating EncryptedPrivateKeyInfo structures.
EncryptedPrivateKeyInfo ::= SEQUENCE {
encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
encryptedData EncryptedData
}
EncryptedData ::= OCTET STRING
KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
... -- For local profiles
}
-
Constructor Summary
ConstructorsConstructorDescriptionPKCS8EncryptedPrivateKeyInfoBuilder(byte[] privateKeyInfo) Construct a builder around a DER-encodedPrivateKeyInfo.PKCS8EncryptedPrivateKeyInfoBuilder(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) Construct a builder around a parsedPrivateKeyInfo. -
Method Summary
Modifier and TypeMethodDescriptionbuild(OutputEncryptor encryptor) Encrypt the wrapped private key withencryptor.
-
Constructor Details
-
PKCS8EncryptedPrivateKeyInfoBuilder
public PKCS8EncryptedPrivateKeyInfoBuilder(byte[] privateKeyInfo) Construct a builder around a DER-encodedPrivateKeyInfo.- Parameters:
privateKeyInfo- the encoded private-key bytes.
-
PKCS8EncryptedPrivateKeyInfoBuilder
public PKCS8EncryptedPrivateKeyInfoBuilder(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) Construct a builder around a parsedPrivateKeyInfo.- Parameters:
privateKeyInfo- the private key to be encrypted.
-
-
Method Details
-
build
Encrypt the wrapped private key withencryptor.- Parameters:
encryptor- a configured output encryptor.- Returns:
- the resulting
PKCS8EncryptedPrivateKeyInfo.
-