JWEObject jweObject = new JWEObject(header, payload);
assertEquals("State check", JWEObject.State.UNENCRYPTED, jweObject.getState());
JWEEncrypter encrypter = new RSAEncrypter(publicKey);
encrypter.setKeyEncryptionProvider(BouncyCastleProviderSingleton.getInstance());
jweObject.encrypt(encrypter);
assertEquals("State check", JWEObject.State.ENCRYPTED, jweObject.getState());