nana99
Messages postés61Date d'inscriptionlundi 11 mai 2009StatutMembreDernière intervention 9 août 2009
-
14 mai 2009 à 14:24
Bonjour,
j'ai trouvé ce code: Java Source Code Example - Sign and Verify Document with expired certifi
*
*
* SignVerifyDoc.java
*
* This program
*
* - sign and verify with digital certificate which in PEM format, and
* private key in PKCS8, DER format, no matter certificate is validated
* or has been expired... if you don't use Java KeyStore
*
* Original:
*
* Tip: openssl pkcs8 -topk8 -nocrypt -in U.KEY -out U.KEY.der -outform DER
*
* Date: July 2006
*
* Author: Terrence Miao
*
* Version: 1.0
*/
/*
* Creates an InputStream from a file, and fills it with the complete
* file. Thus, available () on the returned InputStream will return the
* full number of bytes the file contains
*
* @param fname The filename
* @return The filled InputStream
* @exception IOException, if the Streams couldn't be created.
*/
private static InputStream fullStream (String fname) throws IOException {
FileInputStream fis = new FileInputStream (fname);
DataInputStream dis = new DataInputStream (fis);
byte[] bytes = new byte[dis.available ()];
out.close();
}
else {
FileInputStream sigIn = new FileInputStream (signaturefile);
byte[] raw = new byte[sigIn.available ()];
sigIn.read (raw);
sigIn.close ();
String rawInString = new String (raw);
System.out.println ("The signature is:");
System.out.println (rawInString.replaceAll ("\n", ""));
// if (signature.verify(raw))
if (signature.verify (Base64.decode (rawInString.replaceAll ("\n", ""))))
System.out.println("The signature is good.");
else
System.out.println("The signature is bad.");
}
}
}
*/
avec la description : il permet de signer digitalement un texte puis de vérifier sa signature.
ma question est :
svp comment je peut utilisé ce programme de tel sort que je donne comme entré mon fichier et il me donne comme sortié un fichier signé .
s'il y'a d'autre outils ou méthodes ou solution j'espère que vous me donner, Merci