All Packages Class Hierarchy This Package Previous Next Index
Class iaik.pkcs.EncryptedContentInfo
java.lang.Object
|
+----iaik.pkcs.EncryptedContentInfo
- public class EncryptedContentInfo
- extends Object
This class implements the PKCS#7 EncryptedContentInfo type.
-
EncryptedContentInfo(ASN1Object)
- Create an EncryptedContentInfo from an ASN1Object.
-
EncryptedContentInfo(ObjectID, AlgorithmID)
- Create an EncryptedContentInfo with a content type and an encryption algorithm.
-
EncryptedContentInfo(ObjectID, AlgorithmID, byte[])
- Create an EncryptedContentInfo form already encrypted data.
-
EncryptedContentInfo(PKCS7ContentInfo)
- Creates an EncryptedContentInfo from a ContentInfo and an AlgorithmID.
-
decrypt(Key)
- Use the specified key to decrypt the content of this object.
-
encrypt()
- Create a new randon key and encrypt the content of this object.
-
encrypt(Key, AlgorithmID)
- Use the specified key to encrypt the content of this object.
-
getContentEncryptionAlgorithm()
-
-
getContentType()
-
-
getEncryptedContent()
-
-
hasContent()
-
-
toASN1Object()
- Returns the EncryptedContentInfo as ASN1Object.
-
toString()
- Returns a string that represents the contents of the extensions.
EncryptedContentInfo
public EncryptedContentInfo(PKCS7ContentInfo contentInfo) throws PKCSException
- Creates an EncryptedContentInfo from a ContentInfo and an AlgorithmID.
To finish the creation one of the encrypt methods must be called.
- Parameters:
- contentInfo - the PKCS#7 ContentInfo to encrypt
EncryptedContentInfo
public EncryptedContentInfo(ObjectID contentType,
AlgorithmID contentEncAlg,
byte encryptedContent[])
- Create an EncryptedContentInfo form already encrypted data.
The content is already encrypted and this class is only used for
doing the ASN.1 encoding.
- Parameters:
- contentType - the type of the encrypted content
- contentEncAlg - the algorithm used to encrypt the content
- encryptedContent - the encrypted content as byte array
EncryptedContentInfo
public EncryptedContentInfo(ObjectID contentType,
AlgorithmID contentEncAlg)
- Create an EncryptedContentInfo with a content type and an encryption algorithm.
The encrypted data is transported in another way.
- Parameters:
- contentType - the type of the encrypted content
- contentEncAlg - the algorithm used to encrypt the content
EncryptedContentInfo
public EncryptedContentInfo(ASN1Object obj) throws CodingException
- Create an EncryptedContentInfo from an ASN1Object.
- Parameters:
- obj - the ASN1Object of ASN.1 type EncryptedContentInfo
- Throws: CodingException
- if the ASN.1 object could not be parsed
decrypt
public PKCS7ContentInfo decrypt(Key key) throws NoSuchAlgorithmException, KeyException, PKCSException
- Use the specified key to decrypt the content of this object.
- Parameters:
- key - the key to decrypt the content
- Returns:
- the decrypted content
- Throws: NoSuchAlgorithmException
- if there is no implementation for the contentEncryptionAlg
- Throws: KeyException
- if there is a problem with the key
- Throws: PKCSException
- if there is problem with the PKCS#7 format, ...
encrypt
public void encrypt(Key key,
AlgorithmID contentEncryptionAlg) throws NoSuchAlgorithmException, KeyException
- Use the specified key to encrypt the content of this object.
- Parameters:
- key - the key to decrypt the content
- contentEncAlg - the algorithm to encrypt the content
- Throws: NoSuchAlgorithmException
- if there is no implementation for the contentEncryptionAlg
- Throws: KeyException
- if there is a problem with the key
encrypt
public Key encrypt()
- Create a new randon key and encrypt the content of this object.
- Returns:
- the created key
toASN1Object
public ASN1Object toASN1Object()
- Returns the EncryptedContentInfo as ASN1Object.
- Returns:
- the EncryptedContentInfo as ASN1Object
getContentType
public ObjectID getContentType()
getContentEncryptionAlgorithm
public AlgorithmID getContentEncryptionAlgorithm()
getEncryptedContent
public byte[] getEncryptedContent()
hasContent
public boolean hasContent()
toString
public String toString()
- Returns a string that represents the contents of the extensions.
- Returns:
- the string representation
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index