|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.gold.java.AboraHeaper
|
+--org.abora.gold.xpp.basic.Heaper
|
+--org.abora.gold.lock.Encrypter
An Encrypter is an instantiation of some public-key encryption algorithm, along with
optional public and private keys. Each subclass implements a particular algorithm, such as
Rivest-Shamir-Adelman, in response to the encryption, decryption, and key generation
protocol.
** obsolete documentation **
The algorithm is identified by a Sequence naming it. Each concrete subclass must register
itself during initialization time. This is handled by two macros, DECLARE_ENCRYPTER and
DEFINE_ENCRYPTER. DECLARE_ENCRYPTER(AClassName) defines a function that can be used to
create an instance. DEFINE_ENCRYPTER("identifier",AClassName) creates an EncrypterMaker
parametrized with that "constructor" function pointer, and stores it in the system-wide
table of EncrypterMakers. DECLARE_ENCRYPTER should be invoked in function scope (i.e.
inside a linkTimeNonInherited class method) and DEFINE_ENCRYPTER should be invoked inside
an Initializer (i.e. inside an initTimeNonInherited class method).
The pseudo-constructor to make an Encrypter takes the PackOBits identifying the algorithm,
and looks for a corresponding EncrypterMaker in the table. It then asks that
EncrypterMaker to create an instance, with the given public and private keys.
Encrypters are mutable objects. This allows you to create an Encrypter, generate new
random keys for it, make a copy, remove its private key, and pass that out for public use.
| Field Summary | |
protected static MuTable |
AllEncrypterMakers
|
protected UInt8Array |
myPrivateKey
|
protected UInt8Array |
myPublicKey
|
| Fields inherited from class org.abora.gold.xpp.basic.Heaper |
AllBlasts, BecomeMap, GarbageCount, InGC, InitializedClasses, InitializingClasses, LastMemory, NextClientRequestNumber, NotOneElementSignal, PackageTable, PromiseNameTable, StringHashSBoxes |
| Fields inherited from class org.abora.gold.java.AboraHeaper |
ActiveClubs, CurrentAuthor, CurrentBertCanopyCache, CurrentBertCrum, CurrentChunk, CurrentGrandMap, CurrentKeyMaster, CurrentPacker, CurrentSensorCanopyCache, CurrentServer, CurrentSession, CurrentSessions, CurrentTrace, InitialEditClub, InitialOwner, InitialReadClub, InitialSponsor, InsideTransactionFlag |
| Constructor Summary | |
Encrypter(UInt8Array publicKey,
UInt8Array privateKey)
|
|
| Method Summary | |
int |
actualHashForEqual()
|
static void |
DECLARE(Symbol className)
Only applies in C++ |
UInt8Array |
decrypt(UInt8Array encrypted)
Decrypt data with the current private key. |
static void |
DEFINE(java.lang.String identifier,
Symbol className)
|
UInt8Array |
encrypt(UInt8Array clear)
Encrypt the given data with the current public key. |
static void |
initTimeNonInherited()
|
static Encrypter |
invokeFunction(Sequence publicKey,
Sequence privateKey)
In Smalltalk, the Encrypter class is used in place of the function pointer. |
boolean |
isEqual(java.lang.Object other)
|
static void |
linkTimeNonInherited()
|
static Heaper |
make(Sequence identifier)
|
static Heaper |
make(Sequence identifier,
Sequence publicKey)
|
static Heaper |
make(Sequence identifier,
UInt8Array publicKey,
UInt8Array privateKey)
Make an encrypter of the given type with the given public and private keys. |
UInt8Array |
privateKey()
|
UInt8Array |
publicKey()
|
void |
randomizeKeys(UInt8Array seed)
Generate a new pair of public and private keys using the given data as a random seed. |
static void |
remember(Sequence identifier,
EncrypterConstructor constructor)
|
void |
setPrivateKey(UInt8Array newKey)
Change the private key. |
void |
setPublicKey(UInt8Array newKey)
Change the public key. |
| Methods inherited from class org.abora.gold.java.AboraHeaper |
asOop, basicInspect, displayString, error, hack, halt, inspect, knownBug, mightNotImplement, REQUIRES, shouldImplement, shouldNotImplement, stubbleForSubclassResponsibility, thingToDo, willNotImplement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected UInt8Array myPublicKey
protected UInt8Array myPrivateKey
protected static MuTable AllEncrypterMakers
| Constructor Detail |
public Encrypter(UInt8Array publicKey,
UInt8Array privateKey)
| Method Detail |
public UInt8Array decrypt(UInt8Array encrypted)
public UInt8Array encrypt(UInt8Array clear)
public UInt8Array privateKey()
public UInt8Array publicKey()
public void randomizeKeys(UInt8Array seed)
public void setPrivateKey(UInt8Array newKey)
public void setPublicKey(UInt8Array newKey)
public int actualHashForEqual()
actualHashForEqual in class Heaperpublic boolean isEqual(java.lang.Object other)
public static Heaper make(Sequence identifier,
UInt8Array publicKey,
UInt8Array privateKey)
public static void DECLARE(Symbol className)
public static void DEFINE(java.lang.String identifier,
Symbol className)
public static Encrypter invokeFunction(Sequence publicKey,
Sequence privateKey)
public static void remember(Sequence identifier,
EncrypterConstructor constructor)
public static Heaper make(Sequence identifier)
public static Heaper make(Sequence identifier,
Sequence publicKey)
public static void initTimeNonInherited()
public static void linkTimeNonInherited()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||