Package com.drighetto.essai.bouncycastle.signature

Examples of com.drighetto.essai.bouncycastle.signature.CustomSigner


   * @param args
   */
  public static void main(String[] args) {
    byte[] msg = "Dominiqu".getBytes();
    byte[] signBytes = null;
    CustomSigner customSigner = null;
    /*
     * Sample : Sign a message and check message signature after with
     * asymmetric key algorithm
     */
    System.out.println("---[Bouncy Castle Sample]---");
    try {
      /* Signer Sample */
      System.out.println("[Signer Sample]");
      customSigner = new CustomSigner();
      System.out.printf("Sign message : [%s]\n", new String(msg));
      signBytes = customSigner.signMessage(msg);
      System.out
          .println("Sign message OK, check now signature validty...");
      if (customSigner.isValid(msg, signBytes)) {
        System.out.println("OK - Message signature is valid !");
      } else {
        System.err.println("KO - Message signature is not valid ");
      }
      System.out.println(".:ALL IS OK:.");
View Full Code Here

TOP

Related Classes of com.drighetto.essai.bouncycastle.signature.CustomSigner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.