I basically need to create a self signed certificate and then sign a binary stream with it to create a signature. I tried searching Google but i can't seem to get the right keywords for related results. Any help is appreciated.
+1
A:
You need to use the private key, not the certificate to sign a stream. Since you tagged this with Java, I am assuming you want to use the JCA.
Check out this example: http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html#SigEx
Dean Povey
2009-07-09 22:23:46
i finally understand what exactly i needed to do, i was supposed to create a PEM certificate so that it has both the rsa private key and the certficate in the .pem file (http://usefulfor.com/nothing/2009/06/10/x509-certificate-basics/)adn then i wsa supposed to read in the file as a binary stream and make a Certficate block with it (http://clarens.sourceforge.net/docs/jclarens_apidoc/pk/edu/niit/clarens/util/CertificateBlock.html)from there i can get the privatekey out and then use it as the privatekey as shown above.Thx again, i thought i would just come back and add my full solution
ChronoXIII
2009-07-10 17:45:41