public class PublicKeyHexEncryptor extends Object
PublicKeyHexEncryptor can encrypt characters with his public key.| Constructor and Description |
|---|
PublicKeyHexEncryptor(PublicKey publicKey)
Instantiates a new
PublicKeyHexEncryptor with the given PublicKey. |
public PublicKeyHexEncryptor(PublicKey publicKey)
PublicKeyHexEncryptor with the given PublicKey.publicKey - The public key.public String encrypt(String string) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidKeySpecException, IOException
string - The String to encrypt.InvalidKeyException - 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.