Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.rgw.crypt
Class SAT

java.lang.Object
  extended by ch.rgw.crypt.SAT

public class SAT
extends java.lang.Object

Secure Authenticated Transmission The Transmitter stores a hashtable in an encrypted and signed wrapper.

Author:
Gerry

Field Summary
static java.lang.String ADM_PAYLOAD
           
static java.lang.String ADM_SIGNATURE
           
static java.lang.String ADM_SIGNED_BY
           
static java.lang.String ADM_TIMESTAMP
           
static java.lang.String ERR_DECRYPT
           
static java.lang.String ERR_SERVER
           
static java.lang.String KEY_ERROR
          A key to store error conditions
static java.lang.String KEY_RESULT
          A key to store the return value of a call
static java.lang.String RESULT_BAD_SIGNATURE
           
static java.lang.String USER_UNKNOWN
           
 
Constructor Summary
SAT(Cryptologist c)
          Create a new SAT actor
SAT(java.lang.String creator, java.lang.String provider, Cryptologist c)
           
 
Method Summary
 byte[] sendRequest(java.lang.String hostaddress, byte[] request)
           
 java.lang.String sendRequest(java.lang.String hostaddress, java.lang.String request)
          Deprecated. 
 java.util.Map<java.lang.String,java.io.Serializable> unwrap(byte[] encrypted, boolean bCheckSignature)
          Decrypt, and verify a packet (using our preconfigured Cryptologist)
 byte[] wrap(java.util.Map<java.lang.String,java.io.Serializable> var, java.lang.String dest)
          Sign and encrypt a HashMap.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_RESULT

public static final java.lang.String KEY_RESULT
A key to store the return value of a call

See Also:
Constant Field Values

KEY_ERROR

public static final java.lang.String KEY_ERROR
A key to store error conditions

See Also:
Constant Field Values

USER_UNKNOWN

public static final java.lang.String USER_UNKNOWN
See Also:
Constant Field Values

RESULT_BAD_SIGNATURE

public static final java.lang.String RESULT_BAD_SIGNATURE
See Also:
Constant Field Values

ADM_TIMESTAMP

public static final java.lang.String ADM_TIMESTAMP
See Also:
Constant Field Values

ADM_SIGNED_BY

public static final java.lang.String ADM_SIGNED_BY
See Also:
Constant Field Values

ADM_PAYLOAD

public static final java.lang.String ADM_PAYLOAD
See Also:
Constant Field Values

ADM_SIGNATURE

public static final java.lang.String ADM_SIGNATURE
See Also:
Constant Field Values

ERR_SERVER

public static final java.lang.String ERR_SERVER
See Also:
Constant Field Values

ERR_DECRYPT

public static final java.lang.String ERR_DECRYPT
See Also:
Constant Field Values
Constructor Detail

SAT

public SAT(Cryptologist c)
Create a new SAT actor

Parameters:
c - a fully configured Cryptologist

SAT

public SAT(java.lang.String creator,
           java.lang.String provider,
           Cryptologist c)
Method Detail

unwrap

public java.util.Map<java.lang.String,java.io.Serializable> unwrap(byte[] encrypted,
                                                                   boolean bCheckSignature)
                                                            throws CryptologistException
Decrypt, and verify a packet (using our preconfigured Cryptologist)

Parameters:
encrypted - the encrypted packet
Returns:
a hashmap with the Parameters and an additional parameter "ADM_SIGNED_BY" containing the sender's ID
Throws:
CryptologistException

wrap

public byte[] wrap(java.util.Map<java.lang.String,java.io.Serializable> var,
                   java.lang.String dest)
            throws CryptologistException
Sign and encrypt a HashMap. We sign the unencrypted data and encrypt later. This imposes more load on verifying (since it must be decrypted prior to verify the signature) but improves stability against replay attacks.

Parameters:
hash - a hashtable containing arbitrary String/Object pairs. All objects must be Serializables. Keynames starting with ADM_ are reserved and must not be used.
dest - the receiver. The Object will be encoded with the receiver's public key
Returns:
a byte array containing the signed and encrypted Hashmap. This will remain valid for 5 Minutes.
Throws:
java.lang.Exception
CryptologistException

sendRequest

@Deprecated
public java.lang.String sendRequest(java.lang.String hostaddress,
                                               java.lang.String request)
Deprecated. 


sendRequest

public byte[] sendRequest(java.lang.String hostaddress,
                          byte[] request)

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis