org.apache.shindig.common.crypto
Interface BlobCrypter

All Known Implementing Classes:
BasicBlobCrypter

public interface BlobCrypter

Utility interface for managing signed, encrypted, and time stamped blobs. Blobs are made up of name/value pairs. Time stamps are automatically included and checked. Thread safe.


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.
 

Method Detail

wrap

String wrap(Map<String,String> in)
            throws BlobCrypterException
Time stamps, encrypts, and signs a blob.

Parameters:
in - name/value pairs to encrypt
Returns:
a base64 encoded blob
Throws:
BlobCrypterException - when crypto errors occur

unwrap

Map<String,String> unwrap(String in,
                          int maxAgeSec)
                          throws BlobCrypterException
Unwraps a blob.

Parameters:
in - blob
maxAgeSec - maximum age for the blob
Returns:
the name/value pairs, including the origin timestamp.
Throws:
BlobExpiredException - if the blob is too old to be accepted.
BlobCrypterException - if the blob can't be decoded.


Copyright © 2007-2012. All Rights Reserved.