org.abora.gold.lock
Class Encrypter

java.lang.Object
  |
  +--org.abora.gold.java.AboraHeaper
        |
        +--org.abora.gold.xpp.basic.Heaper
              |
              +--org.abora.gold.lock.Encrypter
Direct Known Subclasses:
NoEncrypter

public class Encrypter
extends Heaper

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.xpp.basic.Heaper
abstractDeclarationFor, abstractTypeFor, addMethodAttributeToInOf, addPackage, addPackageCategory, allClientProtocolOn, argumentTypesFor, arrow, blast, blast, BLAST, cachePromiseNameTable, cachePromiseNameTableIn, canYouBecome, cast, cleanPromiseClasses, cleanupGarbage, clientClassesDo, clientFunctionsOn, clientMethodsOn, clientProtocol, clientProtocolDo, clientProtocolOn, clientProtocolOn, collectibleClasses, compare, compileClientSubclasses, compileConstantPromiseMethods, compileCreateFromRcvr, compileEQ, compileGeneratedClassMethod, compileGeneratedMethod, compileHook, compilePromise, compilePromiseDefaultMethods, compilePromiseFluidDeclarations, compilePromiseHandlers, compilePromiseMethods, compileRequestCreateMsgInArguments, compileRequestEvaluateMsgInReturningArguments, compileRPCSpecialistEvaluateMsgForReturningArguments, compileSendSelfTo, compileSendSelfToSendHook, compileStubbleMethods, compileSubclassStubbleMethods, computeMangle, computePreorder, constantTypeValue, convert, convertCopyDeclarations, convertDeferredDeclarations, convertProxyDeclarations, convertSubclassCopyDeclarations, convertSubclassDeferredDeclarations, convertSubclassProxyDeclarations, copyReferencesToType, create, create, create, create, create, create, create, create, create, create, createRequestClassArguments, definesProxyMethods, delete, deref, destroy, destruct, destructor, enum, enumFlags, equals, exportName, fetchAttribute, fetchPackage, fetchSuperCategory, fileOutClientProtocol, findCategory, findSenderAndReceiverMethods, findTailInto, flushPromiseNameTable, foo, freezeClientClasses, freezeClientProtocol, freezeStProtocol, frozenClasses, garbageCollect, garbageCollectFrom, gcOpportunity, gcOpportunity, generatedCategory, generatePromiseNames, getCategory, getOrMakePackage, getSuperCategory, handlerSignaturesFrom, hash, hashForEqual, hasProxyMethods, info_clientClasses, info_clientSideClasses, info_promiseClasses, info_stProtocol, inGC, initializedClasses, initializingClasses, initPackages, initStringHashSBoxes, inspectPieces, instanceSize, IntegerVar, isByProxy, isConstructed, isDestructed, isEqual, isEqualOrSubclassOf, isGenerated, isIntType, isKindOf, isRawType, isUnlocked, make, makeClassTable, makeFillTable, makeRequestTable, mangle, markChildren, markCount, markInstances, mayBecome, mayBecomeAnySubclassOf, new1, newX, nonCopyVariables, notWorking, pack, packageClasses, packagingCategory, parseExportName, passe, pointerToStaticMember, pointerToStaticMember, pointerToVirtualMember, preorderMax, preorderNumber, printOn, PROBLEM, problems, promiseClass, promiseDefaultValue, promiseName, promiseNameTable, promiseToAbstract, registerPackageCategory, removeGeneratedCode, removeStubbleMethods, removeSubclassGeneratedCode, removeSubclassStubbleMethods, requestProcedure, requestProceduresFrom, returnTypeFor, rootName, scheduleTermination, sendProxyTo, sendSelfTo, serverNameFor, setGC, signal, signals, smalltalkSelector, stClientProtocol, stubbleSelectorTokenReturnsArguments, subclassNonCopyVariables, takeOop, togglePromiseName, togglePromiseOfParse, unimplemented, unmangle, verifyFreeze, wipeStubble
 
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

myPublicKey

protected UInt8Array myPublicKey

myPrivateKey

protected UInt8Array myPrivateKey

AllEncrypterMakers

protected static MuTable AllEncrypterMakers
Constructor Detail

Encrypter

public Encrypter(UInt8Array publicKey,
                 UInt8Array privateKey)
Method Detail

decrypt

public UInt8Array decrypt(UInt8Array encrypted)
Decrypt data with the current private key.


encrypt

public UInt8Array encrypt(UInt8Array clear)
Encrypt the given data with the current public key.


privateKey

public UInt8Array privateKey()

publicKey

public UInt8Array publicKey()

randomizeKeys

public void randomizeKeys(UInt8Array seed)
Generate a new pair of public and private keys using the given data as a random seed.


setPrivateKey

public void setPrivateKey(UInt8Array newKey)
Change the private key.


setPublicKey

public void setPublicKey(UInt8Array newKey)
Change the public key.


actualHashForEqual

public int actualHashForEqual()
Overrides:
actualHashForEqual in class Heaper

isEqual

public boolean isEqual(java.lang.Object other)

make

public static Heaper make(Sequence identifier,
                          UInt8Array publicKey,
                          UInt8Array privateKey)
Make an encrypter of the given type with the given public and private keys. Gets the
requested EncrypterMaker out of the table and then asks it to make an encrypter with the
given key. Fails with
BLAST(NoSuchEncrypter) if it is not found.


DECLARE

public static void DECLARE(Symbol className)
Only applies in C++


DEFINE

public static void DEFINE(java.lang.String identifier,
                          Symbol className)

invokeFunction

public static Encrypter invokeFunction(Sequence publicKey,
                                       Sequence privateKey)
In Smalltalk, the Encrypter class is used in place of the function pointer.


remember

public static void remember(Sequence identifier,
                            EncrypterConstructor constructor)

make

public static Heaper make(Sequence identifier)

make

public static Heaper make(Sequence identifier,
                          Sequence publicKey)

initTimeNonInherited

public static void initTimeNonInherited()

linkTimeNonInherited

public static void linkTimeNonInherited()


Translation - Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.