|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.adobe.flashaccess.sdk.media.drm.MediaEncrypter
public abstract class MediaEncrypter
Abstract base class for encrypting media content. Subclasses will handle specific file formats.
An instance of this class may be used to encrypt multiple files, but should only be accessed from a single thread.
Use MediaEncrypterFactory.getMediaEncrypter()
to get an instance of a MediaEncrypter
if you do
not know the type of the content. Otherwise, you can use the constructors for the subclasses.
After creating the MediaEncrypter
instance, call MediaEncrypter.createEncrypterParameters()
,
MediaEncrypter.createSignatureParameters()
, and
MediaEncrypter.createKeyParameters(Class)
and fill in the encryption options. Then, pass the parameters to MediaEncrypter.encryptContent(File, File, DRMParameters)
.
If you pass the same KeyParameters
object
in multiple calls to MediaEncrypter.encryptContent(File, File, DRMParameters)
, the same key will
be used to protect all the content; this situation is typically not recommended.
Method Summary | |
---|---|
abstract DRMParameters |
createEncrypterParameters()
(abstract method) Gets a DRMParameters object to set encryption options. |
static KeyParameters |
createKeyParameters(java.lang.Class keyParamsType)
Gets a KeyParameters object to set options for retrieving encryption keys. |
static SignatureParameters |
createSignatureParameters()
Gets a SignatureParameters object to set signature options. |
abstract MediaEncrypterResult |
encryptContent(java.io.File in,
java.io.File out,
DRMParameters params)
(abstract method) Encrypts the content in the specified file. |
abstract KeyMetaData |
examineEncryptedContent(java.io.File in)
(abstract method) Examines content that has already been encrypted by the MediaEncrypter and returns
information about the key used to protect the content. |
java.lang.String |
getMediaType()
Gets the file type handled by this MediaEncrypter . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getMediaType()
MediaEncrypter
.
public abstract DRMParameters createEncrypterParameters()
DRMParameters
object to set encryption options. Be sure to use
DRMParameters.setSignatureParameters()
and DRMParameters.setKeyParameters()
to set these options.
A DRMParameters
instance can be reused to use the same options for protecting multiple pieces of content,
but should only be used by one thread at a time.
DRMParameters
object used to set encryption options.public static SignatureParameters createSignatureParameters()
SignatureParameters
object to set signature options. Use
DRMParameters.setSignatureParameters()
to add to the DRMParameters
instance.
A SignatureParameters
instance can be re-used to use the same options for protecting multiple pieces of content,
but should only be used by one thread at a time.
SignatureParameters
object used to set signature options.public static KeyParameters createKeyParameters(java.lang.Class keyParamsType)
KeyParameters
object to set options for retrieving encryption keys. Use
DRMParameters.setKeyParameters()
to add to the DRMParameters
instance.
A KeyParameters
instance can be reused to use the same options for protecting multiple pieces of content,
but should only be used by one thread at a time. If you reuse the same KeyParameters
object in multiple
calls to MediaEncrypter.encryptContent(File, File, DRMParameters)
, exactly the same key will be used to protect all the content; this situation is typically not recommended.
keyParamsType
- Indicates the type of key (it must be a sub-interface of KeyParameters
).
KeyParameters
object used to set options for retrieving encryption keys.
java.lang.IllegalArgumentException
- if an invalid key parameter class is specified.public abstract MediaEncrypterResult encryptContent(java.io.File in, java.io.File out, DRMParameters params) throws KeyRetrievalException, java.io.IOException, ServerCredentialException
IllegalArgumentException
will be thrown. This method will attempt to lock the destination file before writing
any data; if the file cannot be locked because another process is editing it,
an IOException
will be thrown.
If the destination file already exists, the contents will be overwritten.
If an error occurs, the destination file may be invalid, so the caller should delete it.
in
- The file containing the content to be encrypted.out
- The file to which to write encrypted content.params
- The encryption options.
ServerCredentialException
KeyRetrievalException
java.io.IOException
public abstract KeyMetaData examineEncryptedContent(java.io.File in) throws java.io.IOException
MediaEncrypter
and returns
information about the key used to protect the content.
in
- The file containing the content to be encrypted.
null
if no key information was found.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |