com.adobe.flashaccess.sdk.media.drm.format.flv
Class FLVEncrypter

java.lang.Object
  extended by com.adobe.flashaccess.sdk.media.drm.MediaEncrypter
      extended by com.adobe.flashaccess.sdk.media.drm.format.flv.FLVEncrypter

public class FLVEncrypter
extends MediaEncrypter

Encrypter for FLV content.


Field Summary
static java.lang.String MEDIA_TYPE
          Identifier for FLV media.
static java.lang.String WARN_SOURCE
          Source used for WarningMessage instances originating from FLVEncrypter.
static int WARN_UNRECOGNIZED_FLV_TAGS
          WarningMessage code indicating the FLV contains tags that are not recognized by FLVEncrypter.
 
Constructor Summary
FLVEncrypter()
          Creates a MediaEncrypter for FLV content.
 
Method Summary
 FLVDRMParameters createEncrypterParameters()
          Creates parameters for specifying FLV encryption options.
 FLVEncrypterResult encryptContent(java.io.File in, java.io.File out, DRMParameters params)
          Encrypts the content in the specified file.
 FLVEncrypterResult encryptContent(java.io.InputStream in, java.io.OutputStream out, DRMParameters params)
          Encrypts the content in the specified file.
 KeyMetaData examineEncryptedContent(java.io.File in)
          Examines content that has already been encrypted by the MediaEncrypter and returns information about the key used to protect the content.
 KeyMetaData examineEncryptedContent(java.io.InputStream in)
          Examines content that has already been encrypted by the MediaEncrypter and returns information about the key used to protect the content.
 
Methods inherited from class com.adobe.flashaccess.sdk.media.drm.MediaEncrypter
createKeyParameters, createSignatureParameters, getMediaType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WARN_SOURCE

public static final java.lang.String WARN_SOURCE
Source used for WarningMessage instances originating from FLVEncrypter.

See Also:
Constant Field Values

WARN_UNRECOGNIZED_FLV_TAGS

public static final int WARN_UNRECOGNIZED_FLV_TAGS
WarningMessage code indicating the FLV contains tags that are not recognized by FLVEncrypter. Data in these tags will not be encrypted.

See Also:
Constant Field Values

MEDIA_TYPE

public static final java.lang.String MEDIA_TYPE
Identifier for FLV media.

See Also:
Constant Field Values
Constructor Detail

FLVEncrypter

public FLVEncrypter()
Creates a MediaEncrypter for FLV content.

Method Detail

createEncrypterParameters

public FLVDRMParameters createEncrypterParameters()
Creates parameters for specifying FLV encryption options.

Specified by:
createEncrypterParameters in class MediaEncrypter
Returns:
Parameters for specifying FLV encryption options.

encryptContent

public FLVEncrypterResult encryptContent(java.io.File in,
                                         java.io.File out,
                                         DRMParameters params)
                                  throws KeyRetrievalException,
                                         java.io.IOException,
                                         ServerCredentialException
Encrypts the content in the specified file. The source and destination must be files, not directories, and they must be different; otherwise an 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.

Specified by:
encryptContent in class MediaEncrypter
Parameters:
in - The file containing the content to be encrypted.
out - The file to which to write encrypted content.
params - The encryption options.
Returns:
An object containing information about the encrypted content.
Throws:
ServerCredentialException
KeyRetrievalException
java.io.IOException
java.lang.IllegalArgumentException - if the parameters are not FLVDRMParameters.
See Also:
MediaEncrypter.encryptContent(File, File, DRMParameters)

encryptContent

public FLVEncrypterResult encryptContent(java.io.InputStream in,
                                         java.io.OutputStream out,
                                         DRMParameters params)
                                  throws KeyRetrievalException,
                                         java.io.IOException,
                                         ServerCredentialException
Encrypts the content in the specified file.

If this FLVEncrypter was obtained by calling MediaEncrypterFactory.getMediaEncrypter() and you used a wrapper input stream, such as BufferedInputStream, use the same wrapper input stream here. Do not use the underlying InputStream here, as some data will have already been read from the stream by MediaEncrypterFactory.getMediaEncrypter().

Parameters:
in - The file containing the content to be encrypted.
out - The file to which to write encrypted content.
params - Encryption options.
Returns:
Information about the encrypted content.
Throws:
ServerCredentialException
KeyRetrievalException
java.io.IOException
java.lang.IllegalArgumentException - if the parameters are not FLVDRMParameters.

examineEncryptedContent

public KeyMetaData examineEncryptedContent(java.io.File in)
                                    throws java.io.IOException
Examines content that has already been encrypted by the MediaEncrypter and returns information about the key used to protect the content.

Specified by:
examineEncryptedContent in class MediaEncrypter
Parameters:
in - The file containing the content to be encrypted.
Returns:
Key information or null if no key information was found.
Throws:
java.io.IOException
See Also:
MediaEncrypter.examineEncryptedContent(File)

examineEncryptedContent

public KeyMetaData examineEncryptedContent(java.io.InputStream in)
                                    throws java.io.IOException
Examines content that has already been encrypted by the MediaEncrypter and returns information about the key used to protect the content.

If this FLVEncrypter was obtained by calling MediaEncrypterFactory.getMediaEncrypter() and you used a wrapper input stream, such as BufferedInputStream, use the same wrapper input stream here. Do not use the underlying InputStream here, as some data will have already been read from the stream by MediaEncrypterFactory.getMediaEncrypter().

Parameters:
in - The file containing the content to be encrypted.
Returns:
Key information, or null if no key information was found.
Throws:
java.io.IOException


[an error occurred while processing this directive] [an error occurred while processing this directive]