B
bcr666
I need to write a ftp/ssl program (done actually) but I need to secure
it, and I was provided 2 files from the destination (keycert.txt &
trusted.txt).
The keycert.txt has the following in it:
-----BEGIN ENCRYPTED PRIVATE KEY-----
MII ...snip...
-----END ENCRYPTED PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MII ...snip...
-----END CERTIFICATE-----
The trusted.txt has the following in it:
-----BEGIN CERTIFICATE-----
MII ...snip...
-----END CERTIFICATE-----=
Notice the MII in the certificate/key areas. I suspect that it is RSA.
I guess I'm supposed to import these into a keystore then use
.....
KeyManager keyManager = null;
TrustManager trustManager = null;
try {
keyManager = getKeyManagers()[0];
trustManager = getTrustManagers()[0];
}
catch (Exception ex) {
ex.printStackTrace();
}
ftps.setControlEncoding("UTF-8");
ftps.setKeyManager(keyManager);
ftps.setTrustManager(trustManager);
.....
Can someone tell me if I'm on the right track, and how to import the
files into a keystore?
it, and I was provided 2 files from the destination (keycert.txt &
trusted.txt).
The keycert.txt has the following in it:
-----BEGIN ENCRYPTED PRIVATE KEY-----
MII ...snip...
-----END ENCRYPTED PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MII ...snip...
-----END CERTIFICATE-----
The trusted.txt has the following in it:
-----BEGIN CERTIFICATE-----
MII ...snip...
-----END CERTIFICATE-----=
Notice the MII in the certificate/key areas. I suspect that it is RSA.
I guess I'm supposed to import these into a keystore then use
.....
KeyManager keyManager = null;
TrustManager trustManager = null;
try {
keyManager = getKeyManagers()[0];
trustManager = getTrustManagers()[0];
}
catch (Exception ex) {
ex.printStackTrace();
}
ftps.setControlEncoding("UTF-8");
ftps.setKeyManager(keyManager);
ftps.setTrustManager(trustManager);
.....
Can someone tell me if I'm on the right track, and how to import the
files into a keystore?