public class UnknownOtherRecipientInfoValue extends OtherRecipientInfoValue
An Unknown OtherRecipientInfo value is a OtherRecipientInfo value for which there
exists no registered
implementation.
When decoding a the OtherRecipientInfo value contained in an OtherRecipientInfo
from its ASN.1 representation
a descendant of OtherRecipientInfoValue
is created
if there exists a registered
implementation of the OtherRecipientInfo value identified by the
key manegement type
OID. If no implementation exists, an
UnknownOtherRecipientInfoValue
is returned allowing to get
and parse the ASN.1 representation of the OtherRecipientInfo
value. Any other methods like encryptKey
or decryptKey
inherited
from class RecipientInfo
are implemented as dummys
since it cannot be supported by this general unknown OtherRecipientInfo.
RecipientInfo
,
OtherRecipientInfo
keyEncryptionAlgorithm_, securityProvider_
Constructor and Description |
---|
UnknownOtherRecipientInfoValue(iaik.asn1.ObjectID type)
Creates a new unknown OtherRecipientInfo value from the given object identifier.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(iaik.asn1.ASN1Object obj)
Reads the ASN.1 representation of the unknown OtherRecipientInfo value.
|
javax.crypto.SecretKey |
decryptKey(java.security.Key key,
KeyIdentifier recipientIdentifier,
java.lang.String cekAlgName)
Attention!
|
void |
encryptKey(javax.crypto.SecretKey cek)
Attention!
|
byte[] |
getEncryptedKey(KeyIdentifier recipientIdentifier)
Attention!
|
KeyIdentifier[] |
getRecipientIdentifiers()
Attention!
|
iaik.asn1.ObjectID |
getType()
Returns the OtherRecipientInfo type the unknown OtherRecipientInfo value belongs to.
|
boolean |
isRecipientInfoFor(KeyIdentifier recipientIdentifier)
Attention!
|
CertificateIdentifier |
isRecipientInfoFor(iaik.x509.X509Certificate recipientCertificate)
Attention!
|
iaik.asn1.ASN1Object |
toASN1Object()
Returns an ASN1Object representing this unknown OtherRecipientInfo value.
|
java.lang.String |
toString()
Returns a string that represents the contents of this unknown OtherRecipientInfo value.
|
getKeyEncryptionAlgorithm, getName, getSecurityProvider, setSecurityProvider
public UnknownOtherRecipientInfoValue(iaik.asn1.ObjectID type)
type
- the OID identifying the type the unknown OtherRecipientInfo value belongs topublic iaik.asn1.ObjectID getType()
getType
in class OtherRecipientInfoValue
public void decode(iaik.asn1.ASN1Object obj)
obj
- the ASN1Object representing the unknown OtherRecipientInfo valuepublic iaik.asn1.ASN1Object toASN1Object()
public void encryptKey(javax.crypto.SecretKey cek) throws CMSException
encryptKey
in class OtherRecipientInfoValue
cek
- the symmetric content encryption key to encryptCMSException
- if the key encryption process fails for some
reason (e.g. the key-encryption algortihm used
by this RecipientInfo
is not implemented,
or the recipient key is invalid, ...)public javax.crypto.SecretKey decryptKey(java.security.Key key, KeyIdentifier recipientIdentifier, java.lang.String cekAlgName)
null
in any case.decryptKey
in class OtherRecipientInfoValue
key
- the recipient key used to decrypt the encrypted content-encryption key.recipientIdentifier
- information to be used for getting the right encrypted content
encryption key for the right recipientcekAlgName
- the name of the content encryption key (e.g. "AES") to be set for the
SecretKey object created by this methodnull
public byte[] getEncryptedKey(KeyIdentifier recipientIdentifier) throws CMSException
null
in any case.getEncryptedKey
in class OtherRecipientInfoValue
recipientIdentifier
- information to be used for getting the right encrypted content
encryption key for the right recipient; may be required if this
RecipientInfo holds content encryption keys for more than one
recipient (see KeyAgreeRecipientInfo
)null
CMSException
- if no recipient with this key identifier is includedpublic KeyIdentifier[] getRecipientIdentifiers()
getRecipientIdentifiers
in class OtherRecipientInfoValue
public boolean isRecipientInfoFor(KeyIdentifier recipientIdentifier)
false
in any case.isRecipientInfoFor
in class OtherRecipientInfoValue
recipientIdentifier
- the key identifier belonging to the recipient
we are searching forfalse
public CertificateIdentifier isRecipientInfoFor(iaik.x509.X509Certificate recipientCertificate)
null
in any case.isRecipientInfoFor
in class OtherRecipientInfoValue
recipientCertificate
- the certificate of the recipientnull
public java.lang.String toString()
toString
in class java.lang.Object