I've been trying to make sense of the BouncyCastle cryptography APIs for Java. Unfortunately, I'm finding Java cryptography in general to be so obscured by service provider interfaces and jargon that I can't wrap my head around what anything actually does. I've tried reading the necessary documentation repeatedly but it just stays incomprehensible, introducing many concepts far beyond what I think should be needed.
All I really want is a class that does the following:
public class KeyPair {
public byte[] public;
public byte[] private;
}
public class RSACrypto {
public static KeyPair generateRSAKeyPair() { /*implementation*/}
public static byte[] encrypt(byte[] data, byte[] publicKey) { /*impl*/}
public static byte[] decrypt(byte[] encryptedData, byte[] privateKey) { /*impl*/ }
}
Apologies if this is an incredibly complicated question to ask as "all I really want". Any pointers on where to read up on Java cryptography and BouncyCastle are very welcome. Any overviews of how the Java crypto systems actually are laid out are extremely welcome.
hmm, have you tried the O'Reilly book on Java Cryptography? (can't vouch for it personally)