posted 20 years ago
Hi,
Generated the KeyStore using the keytool using Default KeyStrore Type & KeyStore = User, Password=password
With keystore am able to retrieve the both Private & Public Keys by making use of KeyStore.getDefaultType())
When i tried 2 encrypt the message using the params Cipher, PublicKey, MESSAGE, Cipher.ENCRYPT_MODE
As above cipher is initialized with "RSA" & meantime the KeyStore is also created by "RSA"
But when program is executed, getting an error "java.security.InvalidKeyException: Could not initialize for signing with the given key"
Kindly inform me what must be the [-keyalg <keyalg>] used for both KeyStore & initialization of Cipher
NOTE: am using the JDK1.4
Cordially