I am trying to learn how to use Java to do some security stuff. I am taking a security class and I was told I can do some of these things in Java.
1st Question is based around RSA.
I was looking at some youtube videos about how to encrypt and decrypt using RSA Java algorithm
Code:
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(2048);
KeyPair keyPair = keyPairGenerator.generateKeyPair();
PublicKey publicKey = keyPair.getPublic();
PrivateKey privateKey = keyPair.getPrivate();
If I don't want to use a KeyPairGenerator, how do I go about creating a public and private key. Like if I wanted to make my own and not use KeyPairGenerator? Like can I just use KeyPair and create my own hard coded public and private key??
My professor told me if I gave you a certificate, you should be able to get the public key from that. So I him to give me one so I can try and I realize I don't really know what to do lol. I have it but it is encoded, when I open it up in notepad ++.
So my question is do I need to install it and after that do I read in the file line by line to get the public key?
I have been looking for youtube videos online that show me how to use Java to verify a certificate. Like show me how to print it out and get the public key?
Does anybody have any good tutorials on how to do this with Java?
1st Question is based around RSA.
I was looking at some youtube videos about how to encrypt and decrypt using RSA Java algorithm
Code:
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(2048);
KeyPair keyPair = keyPairGenerator.generateKeyPair();
PublicKey publicKey = keyPair.getPublic();
PrivateKey privateKey = keyPair.getPrivate();
If I don't want to use a KeyPairGenerator, how do I go about creating a public and private key. Like if I wanted to make my own and not use KeyPairGenerator? Like can I just use KeyPair and create my own hard coded public and private key??
My professor told me if I gave you a certificate, you should be able to get the public key from that. So I him to give me one so I can try and I realize I don't really know what to do lol. I have it but it is encoded, when I open it up in notepad ++.
So my question is do I need to install it and after that do I read in the file line by line to get the public key?
I have been looking for youtube videos online that show me how to use Java to verify a certificate. Like show me how to print it out and get the public key?
Does anybody have any good tutorials on how to do this with Java?