org.erights.e.elib.sealing
Class Unsealer

java.lang.Object
  |
  +--org.erights.e.elib.sealing.Unsealer
All Implemented Interfaces:
Marker, PassByProxy, Persistent, Serializable

public final class Unsealer
extends Object
implements PassByProxy, Persistent

Untamed: Corresponds to a decrypting or signature-verifying key

Author:
Mark S. Miller
See Also:
Serialized Form

Field Summary
private  Brand myBrand
           
(package private) static long serialVersionUID
           
 
Fields inherited from interface org.erights.e.elib.serial.PassByProxy
HONORARY, HONORED_NAMES
 
Fields inherited from interface org.erights.e.elib.serial.Persistent
HONORARY, HONORED_NAMES
 
Constructor Summary
(package private) Unsealer(Brand brand)
           
 
Method Summary
 void __printOn(TextWriter out)
          Enabled: Prints using the Brand's name
 Object[] amplify(Object specimen)
          Enabled: Used in an Unsealer's role as a ValueGuard.
 Brand getBrand()
          Enabled: The Brand of this Sealer/Unsealer pair.
 Object optUnseal(SealedBox optBox, Class type)
          Enabled: If 'optBox' isn't null, it unseals with this sealer, and it's contents is of type 'type', then return those contents; otherwise return null.
 Object unseal(SealedBox box)
          Enabled: If box was sealed by the Sealer of the same Brand, return its contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID

myBrand

private final Brand myBrand
Constructor Detail

Unsealer

Unsealer(Brand brand)
Parameters:
brand -
Method Detail

getBrand

public Brand getBrand()
Enabled: The Brand of this Sealer/Unsealer pair.


unseal

public Object unseal(SealedBox box)
              throws UnsealingException
Enabled: If box was sealed by the Sealer of the same Brand, return its contents. Otherwise throw UnsealingException.

UnsealingException

optUnseal

public Object optUnseal(SealedBox optBox,
                        Class type)
Enabled: If 'optBox' isn't null, it unseals with this sealer, and it's contents is of type 'type', then return those contents; otherwise return null.


amplify

public Object[] amplify(Object specimen)
                 throws UnsealingException
Enabled: Used in an Unsealer's role as a ValueGuard.

A specimen is amplified to the contents of the SealedBox it offers for being unsealed by this sealer.

Returns:
Either null, to indicate that no box was offered, or a singleton list containing the contents of the box. The contents are enclosed in a list so that null can be used to indicate lack of match, without being confused with null as the box contents.
Throws:
UnsealingException - If optBox isn't null but fails to unseal, that's a thrown exception rather than a polite report of failure.

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled: Prints using the Brand's name

IOException


comments?