org.bouncycastle.cms

Class RecipientInformation

Known Direct Subclasses:
KeyAgreeRecipientInformation, KeyTransRecipientInformation, KEKRecipientInformation

public abstract class RecipientInformation
extends java.lang.Object

Field Summary

protected InputStream
_data
protected AlgorithmIdentifier
_encAlg
protected AlgorithmIdentifier
_keyEncAlg
protected RecipientId
_rid

Constructor Summary

RecipientInformation(AlgorithmIdentifier encAlg, AlgorithmIdentifier keyEncAlg, InputStream data)

Method Summary

byte[]
getContent(Key key, String provider)
protected CMSTypedStream
getContentFromSessionKey(Key sKey, String provider)
abstract CMSTypedStream
getContentStream(Key key, String provider)
protected String
getDataEncryptionAlgorithmName(DERObjectIdentifier oid)
String
getKeyEncryptionAlgOID()
return the object identifier for the key encryption algorithm.
byte[]
getKeyEncryptionAlgParams()
return the ASN.1 encoded key encryption algorithm parameters, or null if there aren't any.
AlgorithmParameters
getKeyEncryptionAlgorithmParameters(String provider)
Return an AlgorithmParameters object giving the encryption parameters used to encrypt the key this recipient holds.
RecipientId
getRID()

Field Details

_data

protected InputStream _data

_encAlg

protected AlgorithmIdentifier _encAlg

_keyEncAlg

protected AlgorithmIdentifier _keyEncAlg

_rid

protected RecipientId _rid

Constructor Details

RecipientInformation

protected RecipientInformation(AlgorithmIdentifier encAlg,
                               AlgorithmIdentifier keyEncAlg,
                               InputStream data)

Method Details

getContent

public byte[] getContent(Key key,
                         String provider)
            throws CMSException,
                   NoSuchProviderException

getContentFromSessionKey

protected CMSTypedStream getContentFromSessionKey(Key sKey,
                                                  String provider)
            throws CMSException,
                   NoSuchProviderException

getContentStream

public abstract CMSTypedStream getContentStream(Key key,
                                                String provider)
            throws CMSException,
                   NoSuchProviderException

getDataEncryptionAlgorithmName

protected String getDataEncryptionAlgorithmName(DERObjectIdentifier oid)

getKeyEncryptionAlgOID

public String getKeyEncryptionAlgOID()
return the object identifier for the key encryption algorithm.

getKeyEncryptionAlgParams

public byte[] getKeyEncryptionAlgParams()
return the ASN.1 encoded key encryption algorithm parameters, or null if there aren't any.

getKeyEncryptionAlgorithmParameters

public AlgorithmParameters getKeyEncryptionAlgorithmParameters(String provider)
            throws CMSException,
                   NoSuchProviderException
Return an AlgorithmParameters object giving the encryption parameters used to encrypt the key this recipient holds.
Parameters:
provider - the provider to generate the parameters for.
Returns:
the parameters object, null if there is not one.
Throws:
CMSException - if the algorithm cannot be found, or the parameters can't be parsed.

getRID

public RecipientId getRID()