Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

KeyStore Algorithm & Cipher Algorithm

 
H.C. Satish
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic