String[] fields = StringUtils.split(token, ':');
if (fields.length != 2) {
throw new SecurityTokenException("Invalid security token " + token);
}
String container = fields[0];
BlobCrypter crypter = crypters.get(container);
if (crypter == null) {
throw new SecurityTokenException("Unknown container " + token);
}
String domain = domains.get(container);
String activeUrl = tokenParameters.get(SecurityTokenCodec.ACTIVE_URL_NAME);
String crypted = fields[1];
try {
BlobCrypterSecurityToken st = new BlobCrypterSecurityToken(container, domain, activeUrl,
crypter.unwrap(crypted));
return st.enforceNotExpired();
} catch (BlobCrypterException e) {
throw new SecurityTokenException(e);
}
}