jsonp.writeTo(token, BearerAccessToken.class, new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE,
new MetadataMap<String, Object>(), bos);
String encrypted = EncryptionUtils.encryptSequence(bos.toString(), p.key);
String decrypted = EncryptionUtils.decryptSequence(encrypted, p.key);
ServerAccessToken token2 = jsonp.readFrom(BearerAccessToken.class, BearerAccessToken.class,
new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE,
new MetadataMap<String, String>(),
new ByteArrayInputStream(decrypted.getBytes()));
// compare tokens