|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.common.crypto.BasicBlobCrypter
public class BasicBlobCrypter
Simple implementation of BlobCrypter.
| Field Summary | |
|---|---|
static int |
MASTER_KEY_MIN_LEN
minimum length of master key |
TimeSource |
timeSource
|
static String |
TIMESTAMP_KEY
Key used for time stamp (in seconds) of data |
| Constructor Summary | |
|---|---|
BasicBlobCrypter(byte[] masterKey)
Builds a BlobCrypter from the specified master key |
|
BasicBlobCrypter(File keyfile)
Creates a crypter based on a key in a file. |
|
| Method Summary | |
|---|---|
Map<String,String> |
unwrap(String in,
int maxAgeSec)
Unwraps a blob. |
String |
wrap(Map<String,String> in)
Time stamps, encrypts, and signs a blob. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TIMESTAMP_KEY
public static final int MASTER_KEY_MIN_LEN
public TimeSource timeSource
| Constructor Detail |
|---|
public BasicBlobCrypter(File keyfile)
throws IOException
dd if=/dev/random bs=32 count=1 | openssl base64 > /tmp/key.txt
IOException - if the file can't be read.public BasicBlobCrypter(byte[] masterKey)
masterKey - | Method Detail |
|---|
public String wrap(Map<String,String> in)
throws BlobCrypterException
BlobCrypter
wrap in interface BlobCrypterin - name/value pairs to encrypt
BlobCrypterException - when crypto errors occur
public Map<String,String> unwrap(String in,
int maxAgeSec)
throws BlobCrypterException
BlobCrypter
unwrap in interface BlobCrypterin - blobmaxAgeSec - maximum age for the blob
BlobExpiredException - if the blob is too old to be accepted.
BlobCrypterException - if the blob can't be decoded.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||