Package fr.jayasoft.crypto.encoder

Examples of fr.jayasoft.crypto.encoder.RSAEncoder


   
    public static Encoder createRSAEncoder(String dir, String fileName) throws IOException {
        return createRSAEncoder(new File(dir, fileName));
    }
    public static Encoder createRSAEncoder(File f) throws IOException {
        return new RSAEncoder((RSAPublicKey)RSAHelper.readPublicKeyFile(f));
    }
View Full Code Here


import fr.jayasoft.crypto.encoder.RSAEncoder;

public class RSATester {
  public static void main(String[] args) {
    KeyPair kp = RSAHelper.generateKeyPair();
        RSAEncoder encoder = new RSAEncoder((RSAPublicKey)kp.getPublic());
        RSADecoder decoder = new RSADecoder((RSAPrivateKey)kp.getPrivate());
       
        byte[] src = "test".getBytes();
        byte[] enc;
        byte[] dec;
       
        enc = encoder.encode(src);
        dec = decoder.decode(enc);
        System.out.println("done");
  }
View Full Code Here

TOP

Related Classes of fr.jayasoft.crypto.encoder.RSAEncoder

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.