|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.BasicRequest
|
+--webfunds.sox.EncryptedRequest
An EncryptedRequest is a "basic" request, that encapsulates a (signable) Request. This class can be thought of as the "gateway" between the basic transport layer and the (signable) Request layer
| Field Summary | |
protected byte[] |
data
The (encrypted) payload |
protected int |
encType
The type of encryption used |
protected byte[] |
inner
The inner packet within the encrypted payload, to be made into a request. |
protected java.security.Key |
key
The key used for encrypting and decrypting the payload. |
static int |
NONE
Definitions for the various encryption methods |
protected byte[] |
plaintext
The (decrypted) payload |
static int |
PUBLIC
|
protected Request |
req
|
static int |
SECRET
|
protected java.lang.String |
type
|
int |
version
|
static int |
VERSION
The version number of the encrypted request packet. |
| Constructor Summary | |
EncryptedRequest(byte[] data)
|
|
EncryptedRequest(EncryptedRequest req)
Extend this to convert these into application requests. |
|
EncryptedRequest(java.io.InputStream is)
|
|
EncryptedRequest(Request req)
Construct a null-encrypted request (type "none"). |
|
EncryptedRequest(Request req,
java.security.Key key,
byte[] data)
Construct an encrypted request (type secret). |
|
EncryptedRequest(Request req,
java.security.Key key,
java.security.PublicKey pub)
Construct an encrypted request (type public). |
|
| Method Summary | |
EncryptedReply |
createReply(Reply reply)
|
EncryptedReply |
createReply(Reply reply,
java.security.Key sessionKey)
|
void |
decode(java.io.InputStream is)
|
Request |
decodeApplicationRequest(java.lang.String type,
byte[] encoded)
Extend this class to use SOX for something else. |
java.lang.String |
decodeHeader()
Now it is decrypted, we can decode the plaintext payload. |
void |
decryptPacket(java.security.PrivateKey key)
Decrypt this packet. |
void |
encode(java.io.OutputStream os)
|
byte[] |
encodeRequest(Request request)
|
byte[] |
getInner()
|
Request |
getRequest()
Packet Factory method to decode the inner request, according to type. |
Request |
getRequest(java.security.PrivateKey key)
Decrypt this packet and return the request within. |
java.lang.String |
getType()
|
boolean |
isEncrypted()
|
boolean |
isStandardSOX()
|
java.lang.String |
toString()
|
| Methods inherited from class webfunds.sox.Encodable |
decode,
encode,
main,
readByteArray,
readCertificate,
readProperties,
readString,
writeByteArray,
writeCertificate,
writeProperties,
writeString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int VERSION
public int version
public static final int NONE
public static final int PUBLIC
public static final int SECRET
protected byte[] data
protected byte[] plaintext
protected byte[] inner
protected java.security.Key key
protected int encType
protected java.lang.String type
protected Request req
| Constructor Detail |
public EncryptedRequest(Request req)
throws SOXPacketException
req - The request to be encrypted
public EncryptedRequest(Request req,
java.security.Key key,
java.security.PublicKey pub)
throws SOXKeyException,
SOXPacketException
req - The request to be encryptedkey - The key with which to encrypt the request datacert - The certificate with which to encrypt the key
public EncryptedRequest(Request req,
java.security.Key key,
byte[] data)
throws SOXKeyException,
SOXPacketException
req - The request to be encryptedkey - The key with which to encrypt the request datacert - The certificate with which to encrypt the key
public EncryptedRequest(byte[] data)
throws SOXPacketException,
UnknownRequestException
public EncryptedRequest(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
public EncryptedRequest(EncryptedRequest req)
| Method Detail |
public boolean isEncrypted()
public java.lang.String getType()
public byte[] getInner()
public void encode(java.io.OutputStream os)
throws java.io.IOException
public void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
public byte[] encodeRequest(Request request)
throws SOXPacketException
public void decryptPacket(java.security.PrivateKey key)
throws SOXKeyException
public Request getRequest(java.security.PrivateKey key)
throws SOXPacketException,
SOXKeyException
public java.lang.String decodeHeader()
throws SOXPacketException
public Request decodeApplicationRequest(java.lang.String type,
byte[] encoded)
throws SOXPacketException
public Request getRequest()
throws SOXPacketException
public boolean isStandardSOX()
public EncryptedReply createReply(Reply reply)
throws SOXKeyException
public EncryptedReply createReply(Reply reply,
java.security.Key sessionKey)
throws SOXKeyException
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||