Top Fields Constructors Methods
org.bouncycastle.cms

public abstract Class RecipientInformation

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.cms.KEKRecipientInformation, org.bouncycastle.cms.KEMRecipientInformation, org.bouncycastle.cms.KeyAgreeRecipientInformation, org.bouncycastle.cms.KeyTransRecipientInformation, org.bouncycastle.cms.PasswordRecipientInformation
Imports
java.io.ByteArrayInputStream, .IOException, org.bouncycastle.asn1.ASN1Encoding, .ASN1ObjectIdentifier, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.util.io.Streams

Field Summary

Modifier and TypeField and Description
protected AlgorithmIdentifier
protected AlgorithmIdentifier
private RecipientOperator
private byte[]
protected RecipientId
protected CMSSecureReadable

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the content inside the EnvelopedData this RecipientInformation is associated with.
getContent
(Recipient
recipient object to use to recover content encryption key
recipient
)

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

public byte[]

Returns:

byte array containing the digest.
getContentDigest
()

Return the content digest calculated during the read of the content if one has been generated.

public CMSTypedStream

Returns:

the content inside the EnvelopedData this RecipientInformation is associated with.
getContentStream
(Recipient
recipient object to use to recover content encryption key
recipient
)

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

public ASN1ObjectIdentifier

Returns:

the content type OID.
getContentType
()

Return the content type of the encapsulated data accessed by this recipient.

public String

Returns:

OID for key encryption algorithm.
getKeyEncryptionAlgOID
()

return the object identifier for the key encryption algorithm.

public AlgorithmIdentifier

Returns:

AlgorithmIdentifier representing the key encryption algorithm.
getKeyEncryptionAlgorithm
()

Return the key encryption algorithm details for the key in this recipient.

public byte[]

Returns:

ASN.1 encoding of key encryption algorithm parameters.
getKeyEncryptionAlgParams
()

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

public byte[]

Returns:

byte array containing the mac.
getMac
()

Return the MAC calculated for the recipient.

protected abstract RecipientOperator
public RecipientId
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyEncAlgback to summary
protected AlgorithmIdentifier keyEncAlg
messageAlgorithmback to summary
protected AlgorithmIdentifier messageAlgorithm
operatorback to summary
private RecipientOperator operator
resultMacback to summary
private byte[] resultMac
ridback to summary
protected RecipientId rid
secureReadableback to summary
protected CMSSecureReadable secureReadable

Constructor Detail

RecipientInformationback to summary
pack-priv RecipientInformation(AlgorithmIdentifier keyEncAlg, AlgorithmIdentifier messageAlgorithm, CMSSecureReadable secureReadable)

Method Detail

getContentback to summary
public byte[] getContent(Recipient recipient) throws CMSException

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

Parameters
recipient:Recipient

recipient object to use to recover content encryption key

Returns:byte[]

the content inside the EnvelopedData this RecipientInformation is associated with.

Exceptions
CMSException:
if the content-encryption/MAC key cannot be recovered.
getContentDigestback to summary
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[]

byte array containing the digest.

getContentStreamback to summary
public CMSTypedStream getContentStream(Recipient recipient) throws CMSException, IOException

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

Parameters
recipient:Recipient

recipient object to use to recover content encryption key

Returns:CMSTypedStream

the content inside the EnvelopedData this RecipientInformation is associated with.

Exceptions
CMSException:
if the content-encryption/MAC key cannot be recovered.
getContentTypeback to summary
public ASN1ObjectIdentifier getContentType()

Return the content type of the encapsulated data accessed by this recipient.

Returns:ASN1ObjectIdentifier

the content type OID.

getKeyEncryptionAlgOIDback to summary
public String getKeyEncryptionAlgOID()

return the object identifier for the key encryption algorithm.

Returns:String

OID for key encryption algorithm.

getKeyEncryptionAlgorithmback to summary
public AlgorithmIdentifier getKeyEncryptionAlgorithm()

Return the key encryption algorithm details for the key in this recipient.

Returns:AlgorithmIdentifier

AlgorithmIdentifier representing the key encryption algorithm.

getKeyEncryptionAlgParamsback to summary
public byte[] getKeyEncryptionAlgParams()

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

Returns:byte[]

ASN.1 encoding of key encryption algorithm parameters.

getMacback to summary
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[]

byte array containing the mac.

getRecipientOperatorback to summary
protected abstract RecipientOperator getRecipientOperator(Recipient recipient) throws CMSException, IOException
getRIDback to summary
public RecipientId getRID()