public abstract class

RecipientInformation

extends Object
java.lang.Object
   ↳ org.bouncycastle.cms.RecipientInformation
Known Direct Subclasses

Summary

Fields
protected AlgorithmIdentifier keyEncAlg
protected AlgorithmIdentifier messageAlgorithm
protected RecipientId rid
Public Methods
byte[] getContent(Key key, Provider provider)
This method is deprecated. use getContent(Recipient)
byte[] getContent(Key key, String provider)
This method is deprecated. use getContent(Recipient)
byte[] getContent(Recipient recipient)
Return the decrypted/encapsulated content in the EnvelopedData after recovering the content encryption/MAC key using the passed in Recipient.
byte[] getContentDigest()
Return the content digest calculated during the read of the content if one has been generated.
CMSTypedStream getContentStream(Recipient recipient)
Return a CMSTypedStream representing the content in the EnvelopedData after recovering the content encryption/MAC key using the passed in Recipient.
abstract CMSTypedStream getContentStream(Key key, Provider provider)
This method is deprecated. use getContentStream(Recipient) method
CMSTypedStream getContentStream(Key key, String provider)
This method is deprecated. use getContentStream(Recipient) method
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.
AlgorithmParameters getKeyEncryptionAlgorithmParameters(Provider provider)
Return an AlgorithmParameters object giving the encryption parameters used to encrypt the key this recipient holds.
byte[] getMac()
Return the MAC calculated for the recipient.
RecipientId getRID()
Protected Methods
CMSTypedStream getContentFromSessionKey(Key sKey, Provider provider)
abstract RecipientOperator getRecipientOperator(Recipient recipient)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected AlgorithmIdentifier keyEncAlg

protected AlgorithmIdentifier messageAlgorithm

protected RecipientId rid

Public Methods

public byte[] getContent (Key key, Provider provider)

This method is deprecated.
use getContent(Recipient)

Throws
CMSException

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

This method is deprecated.
use getContent(Recipient)

public byte[] getContent (Recipient recipient)

Return the decrypted/encapsulated content in the EnvelopedData after recovering the content encryption/MAC key using the passed in Recipient.

Parameters
recipient recipient object to use to recover content encryption key
Returns
  • the content inside the EnvelopedData this RecipientInformation is associated with.
Throws
CMSException if the content-encryption/MAC key cannot be recovered.

public byte[] getContentDigest ()

Return the content digest calculated during the read of the content if one has been generated. This will only happen if we are dealing with authenticated data and authenticated attributes are present.

Returns
  • byte array containing the digest.

public CMSTypedStream getContentStream (Recipient recipient)

Return a CMSTypedStream representing the content in the EnvelopedData after recovering the content encryption/MAC key using the passed in Recipient.

Parameters
recipient recipient object to use to recover content encryption key
Returns
  • the content inside the EnvelopedData this RecipientInformation is associated with.
Throws
CMSException if the content-encryption/MAC key cannot be recovered.
IOException

public abstract CMSTypedStream getContentStream (Key key, Provider provider)

This method is deprecated.
use getContentStream(Recipient) method

decrypt the content and return it

Throws
CMSException

public CMSTypedStream getContentStream (Key key, String provider)

This method is deprecated.
use getContentStream(Recipient) method

decrypt the content and return it

public String getKeyEncryptionAlgOID ()

return the object identifier for the key encryption algorithm.

Returns
  • OID for key encryption algorithm.

public byte[] getKeyEncryptionAlgParams ()

return the ASN.1 encoded key encryption algorithm parameters, or null if there aren't any.

Returns
  • ASN.1 encoding of key encryption algorithm parameters.

public AlgorithmParameters getKeyEncryptionAlgorithmParameters (String provider)

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.
NoSuchProviderException if the provider cannot be found.

public AlgorithmParameters getKeyEncryptionAlgorithmParameters (Provider provider)

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.

public byte[] getMac ()

Return the MAC calculated for the recipient. Note: this call is only meaningful once all the content has been read.

Returns
  • byte array containing the mac.

public RecipientId getRID ()

Protected Methods

protected CMSTypedStream getContentFromSessionKey (Key sKey, Provider provider)

Throws
CMSException

protected abstract RecipientOperator getRecipientOperator (Recipient recipient)