Top Description Fields Constructors Methods
org.bouncycastle.cert.crmf

public Class EncryptedValueBuilder

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.cert.crmf.bc.BcEncryptedValueBuilder, org.bouncycastle.cert.crmf.jcajce.JcaEncryptedValueBuilder
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream, org.bouncycastle.asn1.ASN1OctetString, .DERBitString, org.bouncycastle.asn1.crmf.EncryptedValue, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.cert.X509CertificateHolder, org.bouncycastle.operator.KeyWrapper, .OperatorException, .OutputEncryptor, org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo, .PKCS8EncryptedPrivateKeyInfoBuilder, org.bouncycastle.util.Strings

Builder for EncryptedValue structures.

Field Summary

Modifier and TypeField and Description
private OutputEncryptor
private EncryptedValuePadder
private KeyWrapper

Constructor Summary

AccessConstructor and Description
public
EncryptedValueBuilder(KeyWrapper
a wrapper for key used to encrypt the actual data contained in the EncryptedValue.
wrapper
,
OutputEncryptor
an output encryptor to encrypt the actual data contained in the EncryptedValue.
encryptor
)

Create a builder that makes EncryptedValue structures.

public
EncryptedValueBuilder(KeyWrapper
a wrapper for key used to encrypt the actual data contained in the EncryptedValue.
wrapper
,
OutputEncryptor
an output encryptor to encrypt the actual data contained in the EncryptedValue.
encryptor
,
EncryptedValuePadder
a padder to ensure that the EncryptedValue created will always be a constant length.
padder
)

Create a builder that makes EncryptedValue structures with fixed length blocks padded using the passed in padder.

Method Summary

Modifier and TypeMethod and Description
public EncryptedValue

Returns:

an EncryptedValue containing the encrypted pass phrase.
build
(char[]
a revocation pass phrase.
revocationPassphrase
)

Build an EncryptedValue structure containing the passed in pass phrase.

public EncryptedValue

Returns:

an EncryptedValue containing the encrypted certificate.
build
(X509CertificateHolder
a holder containing a certificate.
holder
)

Build an EncryptedValue structure containing the certificate contained in the passed in holder.

public EncryptedValue

Returns:

an EncryptedValue containing an EncryptedPrivateKeyInfo structure.
build
(PrivateKeyInfo
a PKCS#8 private key info structure.
privateKeyInfo
)

Build an EncryptedValue structure containing the private key contained in the passed info structure.

private EncryptedValue
encryptData(byte[] data)

private byte[]
padData(byte[] data)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encryptorback to summary
private OutputEncryptor encryptor
padderback to summary
private EncryptedValuePadder padder
wrapperback to summary
private KeyWrapper wrapper

Constructor Detail

EncryptedValueBuilderback to summary
public EncryptedValueBuilder(KeyWrapper wrapper, OutputEncryptor encryptor)

Create a builder that makes EncryptedValue structures.

Parameters
wrapper:KeyWrapper

a wrapper for key used to encrypt the actual data contained in the EncryptedValue.

encryptor:OutputEncryptor

an output encryptor to encrypt the actual data contained in the EncryptedValue.

EncryptedValueBuilderback to summary
public EncryptedValueBuilder(KeyWrapper wrapper, OutputEncryptor encryptor, EncryptedValuePadder padder)

Create a builder that makes EncryptedValue structures with fixed length blocks padded using the passed in padder.

Parameters
wrapper:KeyWrapper

a wrapper for key used to encrypt the actual data contained in the EncryptedValue.

encryptor:OutputEncryptor

an output encryptor to encrypt the actual data contained in the EncryptedValue.

padder:EncryptedValuePadder

a padder to ensure that the EncryptedValue created will always be a constant length.

Method Detail

buildback to summary
public EncryptedValue build(char[] revocationPassphrase) throws CRMFException

Build an EncryptedValue structure containing the passed in pass phrase.

Parameters
revocationPassphrase:char[]

a revocation pass phrase.

Returns:EncryptedValue

an EncryptedValue containing the encrypted pass phrase.

Exceptions
CRMFException:
on a failure to encrypt the data, or wrap the symmetric key for this value.
buildback to summary
public EncryptedValue build(X509CertificateHolder holder) throws CRMFException

Build an EncryptedValue structure containing the certificate contained in the passed in holder.

Parameters
holder:X509CertificateHolder

a holder containing a certificate.

Returns:EncryptedValue

an EncryptedValue containing the encrypted certificate.

Exceptions
CRMFException:
on a failure to encrypt the data, or wrap the symmetric key for this value.
buildback to summary
public EncryptedValue build(PrivateKeyInfo privateKeyInfo) throws CRMFException

Build an EncryptedValue structure containing the private key contained in the passed info structure.

Parameters
privateKeyInfo:PrivateKeyInfo

a PKCS#8 private key info structure.

Returns:EncryptedValue

an EncryptedValue containing an EncryptedPrivateKeyInfo structure.

Exceptions
CRMFException:
on a failure to encrypt the data, or wrap the symmetric key for this value.
encryptDataback to summary
private EncryptedValue encryptData(byte[] data) throws CRMFException
padDataback to summary
private byte[] padData(byte[] data)