• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

KeyStore Algorithm & Cipher Algorithm

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic