public class BasicBlobCrypter extends Object implements BlobCrypter
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
BasicBlobCrypter(byte[] masterKey)
Builds a BlobCrypter from the specified master key
|
BasicBlobCrypter(File keyfile)
Creates a crypter based on a key in a file.
|
public static final String TIMESTAMP_KEY
public static final int MASTER_KEY_MIN_LEN
public TimeSource timeSource
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 - public String wrap(Map<String,String> in) throws BlobCrypterException
BlobCrypterwrap in interface BlobCrypterin - name/value pairs to encryptBlobCrypterException - when crypto errors occurpublic Map<String,String> unwrap(String in, int maxAgeSec) throws BlobCrypterException
BlobCrypterunwrap in interface BlobCrypterin - blobmaxAgeSec - maximum age for the blobBlobExpiredException - if the blob is too old to be accepted.BlobCrypterException - if the blob can't be decoded.Copyright © 2007-2012. All Rights Reserved.