refactor into PublicKeyCipher class