Discussion:
[Ejbca-develop] Extracting private key from keystore
pradeepreddy
2010-10-07 17:42:28 UTC
Permalink
Hi,

I am trying to extract private key from keystore.jks for AdminCA1
certificate in jboss-4.2.3.GA\server\default\conf\keystore, with the
following command.

C:\My Documents\Downloads>java ExportPriv ejbca_3_10_5\p12\truststore.jks
key "\0"

But failing with below output:

Exception in thread "main" java.io.IOException: Keystore was tampered with,
or p
assword was incorrect
at
sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
at
sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:3
8)
at java.security.KeyStore.load(KeyStore.java:1185)
at ExportPriv.doit(ExportPriv.java:33)
at ExportPriv.main(ExportPriv.java:22)
Caused by: java.security.UnrecoverableKeyException: Password verification
failed

at
sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769)
... 4 more


I have given default NULL for password while "ant install".
I have no idea, why it is failing now with this command.

Please let me know how to retrieve the AdminCA1 password from keystore.Is
this the correct way, I am doing?
--
View this message in context: http://old.nabble.com/Extracting-private-key-from-keystore-tp29908752p29908752.html
Sent from the EjbCA - Dev mailing list archive at Nabble.com.
Matt Walsh
2010-10-07 17:56:55 UTC
Permalink
I followed these instructions: http://ejbca.sourceforge.net/installation.html

The only place I deviated was to change the HSQLDB connection to a
MySql connection.

I'm trying to deploy the EAR to Glassfish and get the following errors:

Any idea what's going on?

[#|2010-10-07T12:51:10.942-0500|SEVERE|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=31;_ThreadName=Thread-3622;javax.naming.NameAlreadyBoundException
[Root exception is
org.omg.CosNaming.NamingContextPackage.AlreadyBound:
IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0];_RequestID=fffdcdcb-25b3-4ee3-96a3-274e3bf199eb;|EJB5090:
Exception in creating EJB container
[javax.naming.NameAlreadyBoundException [Root exception is
org.omg.CosNaming.NamingContextPackage.AlreadyBound:
IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0]]|#]

[#|2010-10-07T12:51:10.942-0500|SEVERE|sun-appserver2.1|javax.enterprise.system.container.ejb|_ThreadID=31;_ThreadName=Thread-3622;_RequestID=fffdcdcb-25b3-4ee3-96a3-274e3bf199eb;|appId=ejbca1
moduleName=ejbca-ejb_jar ejbName=CertificateRequestSession|#]

[#|2010-10-07T12:51:10.943-0500|SEVERE|sun-appserver2.1|javax.enterprise.system.core.classloading|_ThreadID=31;_ThreadName=Thread-3622;ejbca1;CertificateRequestSession;CertificateRequestSession;_RequestID=fffdcdcb-25b3-4ee3-96a3-274e3bf199eb;|LDR5012:
Jndi name conflict found in [ejbca1]. Jndi name
[CertificateRequestSession] for bean [CertificateRequestSession] is
already in use.|#]

[#|2010-10-07T12:51:10.943-0500|SEVERE|sun-appserver2.1|javax.enterprise.system.core.classloading|_ThreadID=31;_ThreadName=Thread-3622;_RequestID=fffdcdcb-25b3-4ee3-96a3-274e3bf199eb;|LDR5013:
Naming exception while creating EJB container:
javax.naming.NameAlreadyBoundException [Root exception is
org.omg.CosNaming.NamingContextPackage.AlreadyBound:
IDL:omg.org/CosNaming/NamingContext/AlreadyBound:1.0]
at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:75)
at com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:595)
at com.sun.jndi.cosnaming.CNCtx.bind(CNCtx.java:620)
at javax.naming.InitialContext.bind(InitialContext.java:404)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:220)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:190)
at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:938)
at com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:232)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:345)
at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:529)
at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:191)
at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
at com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(ExtendedApplicationLoader.java:134)
at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:240)
at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:959)
at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:943)
at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:467)
at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:182)
at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:231)
at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:966)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:609)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:653)
at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:773)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:390)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:373)
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:477)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:170)
at com.sun.enterprise.deployment.client.DeploymentClientUtils.startApplication(DeploymentClientUtils.java:159)
at com.sun.enterprise.deployment.client.DeployAction.run(DeployAction.java:538)
at java.lang.Thread.run(Thread.java:619)

---
Matt Walsh
***@gmail.com
pradeepreddy
2010-10-07 19:37:19 UTC
Permalink
Hi,
Tomas Gustavsson
2010-10-08 06:34:44 UTC
Permalink
Hi,

It seems you are mixing several issues in the same thread right?

I'll concentrate on this one.

The CAs private key is not stored in truststore.jks, it is as simple as
that. Truststore.jks only contains trusted CA certificates for the SSL
server, no private keys.

The CAs private key is stored in an encrypted keystore in the database.
You can use the exportca functions, from web GUI or from command line,
to extract that keystore.

Cheers,
Tomas
-----
PrimeKey Solutions offers commercial EJBCA and SignServer support
subscriptions and training courses. Please see www.primekey.se or
contact ***@primekey.se for more information.
http://www.primekey.se/Services/Support/
http://www.primekey.se/Services/Training/
Hi,
Loading...