public final class PublicKeyHexEncryptor extends Object
PublicKeyHexEncryptor can encrypt characters with his public key.| Constructor and Description |
|---|
PublicKeyHexEncryptor(PublicKey publicKey)
Instantiates a new
PublicKeyHexEncryptor object with the given PublicKey |
| Modifier and Type | Method and Description |
|---|---|
String |
encrypt(String string)
Encrypt the given
String object |
public PublicKeyHexEncryptor(@NonNull
PublicKey publicKey)
PublicKeyHexEncryptor object with the given PublicKeypublicKey - the public keypublic String encrypt(String string) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, IOException
String objectstring - The String to encryptStringInvalidKeyException - the invalid key exception is thrown if initialization of the cypher object fails.NoSuchAlgorithmException - is thrown if instantiation of the cypher object fails.NoSuchPaddingException - is thrown if instantiation of the cypher object fails.IllegalBlockSizeException - is thrown if Cipher.doFinal(byte[]) fails.BadPaddingException - is thrown if Cipher.doFinal(byte[]) fails.InvalidKeySpecException - is thrown if generation of the SecretKey object fails.IOException - Signals that an I/O exception has occurred.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.