Package fr.jayasoft.crypto

Source Code of fr.jayasoft.crypto.RSATester

package fr.jayasoft.crypto;

import java.security.KeyPair;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;

import fr.jayasoft.crypto.decoder.RSADecoder;
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");
  }
}
TOP

Related Classes of fr.jayasoft.crypto.RSATester

TOP
Copyright © 2018 www.massapi.com. 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.