This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Web Services and the fly likes while I am converting .ts certificate file into .crt file by using open ssl tool am getting  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "while I am converting .ts certificate file into .crt file by using open ssl tool am getting  "keytoo" Watch "while I am converting .ts certificate file into .crt file by using open ssl tool am getting  "keytoo" New topic
Author

while I am converting .ts certificate file into .crt file by using open ssl tool am getting "keytoo

Indira chandragiri
Greenhorn

Joined: Sep 04, 2012
Posts: 2
while I am converting .ts certificate file into .crt file by using open ssl tool am getting "keytool error: java.lang.Exception: Input not an X.509 certificate"
can any one help me inthis isseue?
Madhu sudana
Greenhorn

Joined: May 21, 2015
Posts: 1
bash$ keytool -keystore foo.jks -genkeypair -alias foo \
-dname 'CN=foo.example.com,L=Melbourne,ST=Victoria,C=AU'
Enter keystore password:
Re-enter new password:
Enter key password for
(RETURN if same as keystore password):
bash$ keytool -keystore foo.jks -exportcert -alias foo | \
openssl x509 -inform der -text
Enter keystore password: asdasd
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1237334757 (0x49c03ae5)
Signature Algorithm: dsaWithSHA1
Issuer: C=AU, ST=Victoria, L=Melbourne, CN=foo.example.com
Validity
Not Before: Mar 18 00:05:57 2009 GMT
Not After : Jun 16 00:05:57 2009 GMT
Subject: C=AU, ST=Victoria, L=Melbourne, CN=foo.example.com
Subject Public Key Info:
Public Key Algorithm: dsaEncryption
DSA Public Key:
pub:
00:e2:66:5c:e0:2e:da:e0:6b:a6:aa:97:64:59:14:
7e:a6:2e:5a:45:f9:2f:b5:2d:f4:34:27:e6:53:c7:


bash$ keytool -importkeystore -srckeystore foo.jks \
-destkeystore foo.p12 \
-srcstoretype jks \
-deststoretype pkcs12
Enter destination keystore password:
Re-enter new password:
Enter source keystore password:
Entry for alias foo successfully imported.
Import command completed: 1 entries successfully imported, 0 entries failed or cancelled

bash$ openssl pkcs12 -in foo.p12 -out foo.pem
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:

bash$ openssl x509 -text -in foo.pem
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 1237334757 (0x49c03ae5)
Signature Algorithm: dsaWithSHA1
Issuer: C=AU, ST=Victoria, L=Melbourne, CN=foo.example.com
Validity
Not Before: Mar 18 00:05:57 2009 GMT
Not After : Jun 16 00:05:57 2009 GMT
Subject: C=AU, ST=Victoria, L=Melbourne, CN=foo.example.com
Subject Public Key Info:
Public Key Algorithm: dsaEncryption
DSA Public Key:
pub:
00:e2:66:5c:e0:2e:da:e0:6b:a6:aa:97:64:59:14:
7e:a6:2e:5a:45:f9:2f:b5:2d:f4:34:27:e6:53:c7:


bash$ openssl dsa -text -in foo.pem
read DSA key
Enter PEM pass phrase:
Private-Key: (1024 bit)
priv:
00:8f:b1:af:55:63:92:7c:d2:0f:e6:f3:a2:f5:ff:
1a:7a:fe:8c:39:dd
pub:
00:e2:66:5c:e0:2e:da:e0:6b:a6:aa:97:64:59:14:
7e:a6:2e:5a:45:f9:2f:b5:2d:f4:34:27:e6:53:c7:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: while I am converting .ts certificate file into .crt file by using open ssl tool am getting "keytoo
 
It's not a secret anymore!