• 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

Problem following bouncy castle example

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I am following an example to implement bouncy castle to encrypt data coming out of a midp to servlet.

On the servlet I have the following line: Digest digest = new SHA1Digest();
I cannot compile because i get the following error: type mismatch cannot convert from SHA1Digest to Digest.

Digest is an interface and not a class. How can I go around this?

Les
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


On the servlet I have the following line: Digest digest = new SHA1Digest();
I cannot compile because i get the following error: type mismatch cannot convert from SHA1Digest to Digest.



The SHA1Digest is a BC specific class. If you are going to use the light-weight library on both ends, then you can either import the correct Digest class or use the JCE equivalent ;

MessageDigest digest = MessageDigest.getInstance("SHA1", "BC");
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic