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

public Class EncryptedValueParser

extends Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, org.bouncycastle.asn1.crmf.EncryptedValue, org.bouncycastle.asn1.pkcs.PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .Certificate, org.bouncycastle.cert.X509CertificateHolder, org.bouncycastle.operator.InputDecryptor, org.bouncycastle.util.Strings, org.bouncycastle.util.io.Streams

Parser for EncryptedValue structures.

Field Summary

Modifier and TypeField and Description
private EncryptedValuePadder
private EncryptedValue

Constructor Summary

AccessConstructor and Description
public
EncryptedValueParser(EncryptedValue
the value to be parsed.
value
)

Basic constructor - create a parser to read the passed in value.

public
EncryptedValueParser(EncryptedValue
the value to be parsed.
value
,
EncryptedValuePadder
the padder to be used to remove padding from the decrypted value..
padder
)

Create a parser to read the passed in value, assuming the padder was applied to the data prior to encryption.

Method Summary

Modifier and TypeMethod and Description
private byte[]
public AlgorithmIdentifier
public X509CertificateHolder

Returns:

an X509CertificateHolder containing the certificate read.
readCertificateHolder
(ValueDecryptorGenerator
the decryptor generator to decrypt the encrypted value.
decGen
)

Read a X.509 certificate.

public char[]

Returns:

a pass phrase as recovered from the encrypted value.
readPassphrase
(ValueDecryptorGenerator
the decryptor generator to decrypt the encrypted value.
decGen
)

Read a pass phrase.

public PrivateKeyInfo

Returns:

an PrivateKeyInfo containing the private key that was read.
readPrivateKeyInfo
(ValueDecryptorGenerator
the decryptor generator to decrypt the encrypted value.
decGen
)

Read a PKCS#8 PrivateKeyInfo.

private byte[]
unpadData(byte[] data)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

padderback to summary
private EncryptedValuePadder padder
valueback to summary
private EncryptedValue value

Constructor Detail

EncryptedValueParserback to summary
public EncryptedValueParser(EncryptedValue value)

Basic constructor - create a parser to read the passed in value.

Parameters
value:EncryptedValue

the value to be parsed.

EncryptedValueParserback to summary
public EncryptedValueParser(EncryptedValue value, EncryptedValuePadder padder)

Create a parser to read the passed in value, assuming the padder was applied to the data prior to encryption.

Parameters
value:EncryptedValue

the value to be parsed.

padder:EncryptedValuePadder

the padder to be used to remove padding from the decrypted value..

Method Detail

decryptValueback to summary
private byte[] decryptValue(ValueDecryptorGenerator decGen) throws CRMFException
getIntendedAlgback to summary
public AlgorithmIdentifier getIntendedAlg()
readCertificateHolderback to summary
public X509CertificateHolder readCertificateHolder(ValueDecryptorGenerator decGen) throws CRMFException

Read a X.509 certificate.

Parameters
decGen:ValueDecryptorGenerator

the decryptor generator to decrypt the encrypted value.

Returns:X509CertificateHolder

an X509CertificateHolder containing the certificate read.

Exceptions
CRMFException:
if the decrypted data cannot be parsed, or a decryptor cannot be generated.
readPassphraseback to summary
public char[] readPassphrase(ValueDecryptorGenerator decGen) throws CRMFException

Read a pass phrase.

Parameters
decGen:ValueDecryptorGenerator

the decryptor generator to decrypt the encrypted value.

Returns:char[]

a pass phrase as recovered from the encrypted value.

Exceptions
CRMFException:
if the decrypted data cannot be parsed, or a decryptor cannot be generated.
readPrivateKeyInfoback to summary
public PrivateKeyInfo readPrivateKeyInfo(ValueDecryptorGenerator decGen) throws CRMFException

Read a PKCS#8 PrivateKeyInfo.

Parameters
decGen:ValueDecryptorGenerator

the decryptor generator to decrypt the encrypted value.

Returns:PrivateKeyInfo

an PrivateKeyInfo containing the private key that was read.

Exceptions
CRMFException:
if the decrypted data cannot be parsed, or a decryptor cannot be generated.
unpadDataback to summary
private byte[] unpadData(byte[] data)