com.adobe.flashaccess.sdk.rights
Class SWFHash

java.lang.Object
  extended by com.adobe.flashaccess.sdk.rights.SWFHash

public class SWFHash
extends java.lang.Object

Represents the hash of a SWF used in SWFApplicationIdentifier


Constructor Summary
SWFHash(byte[] digestValue, int maxTimeToVerify)
          Specifies the hash computed on the SWF.
SWFHash(java.io.InputStream swfInputStream, int maxTimeToVerify)
          Computes the hash of the SWF application in the specified input stream.
 
Method Summary
 byte[] getDigestValue()
          Retrieves the hash of the SWF application.
 int getMaxTimeToVerify()
          Retrieves maximum time (in seconds) within which the client must download and verify the SWF.
 void setMaxTimeToVerify(int maxTimeToVerify)
          Retrieves maximum time (in seconds) within which the client must download and verify the SWF.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWFHash

public SWFHash(byte[] digestValue,
               int maxTimeToVerify)
Specifies the hash computed on the SWF. Use SWFHash(InputStream, int) to compute the digest value the first time.

Parameters:
digestValue - The SWF digest value.
maxTimeToVerify - Maximum time (in seconds) within which the client must download and verify the SWF.

SWFHash

public SWFHash(java.io.InputStream swfInputStream,
               int maxTimeToVerify)
        throws java.io.IOException
Computes the hash of the SWF application in the specified input stream.

Parameters:
swfInputStream - The contents of the SWF.
maxTimeToVerify - Maximum time (in seconds) within which the client must download and verify the SWF.
Throws:
java.io.IOException - if a problem occurs while reading the input stream
Method Detail

getMaxTimeToVerify

public int getMaxTimeToVerify()
Retrieves maximum time (in seconds) within which the client must download and verify the SWF. This is to safeguard against attacks where rogue servers can work around SWF verification by not providing non-critical pieces of SWF to the user agent in a timely manner.

Returns:
maximum time (in seconds) allocated for SWF verification

setMaxTimeToVerify

public void setMaxTimeToVerify(int maxTimeToVerify)
Retrieves maximum time (in seconds) within which the client must download and verify the SWF. If the client cannot complete SWF verification in the allotted time, the client will not be able to continue playing content. This is to safeguard against attacks where rogue servers can work around SWF verification by not providing non-critical pieces of SWF to the user agent in a timely manner.

Parameters:
maxTimeToVerify - maximum time (in seconds) allocated for SWF verification

getDigestValue

public byte[] getDigestValue()
Retrieves the hash of the SWF application. The hash value is computed using the SHA-256 algorithm.

Returns:
The SWF application hash.


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