Writing private key to smart card

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing private key to smart card

Johannes Rath

 

Hi all,

 

I am trying to write a private key to a smart card, but I am always getting an error:

 

jor@jorVirtualUbuntu1404:/mnt/Projects/TestOpenSC$ pkcs11-tool -y privkey  -l -w  private.der

Using slot 0 with a present token (0x0)

Logging in to "JavaCard isoApplet (User PIN)".

Please enter User PIN:

error: PKCS11 function C_CreateObject failed: rv = CKR_GENERAL_ERROR (0x5)

 

Aborting.

jor@jorVirtualUbuntu1404:/mnt/Projects/TestOpenSC$ opensc-tool -i

OpenSC 0.15.0 [gcc  4.8.4]

Enabled features: locking zlib readline openssl pcsc(libpcsclite.so.1)

 

Any ideas?

 

Regards

 

Johannes

 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: Writing private key to smart card

Philip Wendland
Hi,

by default, private key import is not supported by IsoApplet. Did you
enable this feature before building the applet?
See http://pwendland.net/smartcards/2014/12/21/IsoApplet-configuration/

Also, I would recommend using pkcs15-init and -tool for initialization
purposes.

If this does not help, you will need to generate and send an OpenSC log
(e.g. pkcs15-init -vvvvvvvvv --import-key ...). The log will contain
your PIN.

Kind regards,
Philip

On 04/26/2016 09:58 AM, Johannes Rath wrote:

>  
>
> Hi all,
>
>  
>
> I am trying to write a private key to a smart card, but I am always
> getting an error:
>
>  
>
> jor@jorVirtualUbuntu1404:/mnt/Projects/TestOpenSC$ pkcs11-tool -y
> privkey  -l -w  private.der
>
> Using slot 0 with a present token (0x0)
>
> Logging in to "JavaCard isoApplet (User PIN)".
>
> Please enter User PIN:
>
> error: PKCS11 function C_CreateObject failed: rv = CKR_GENERAL_ERROR (0x5)
>
>  
>
> Aborting.
>
> jor@jorVirtualUbuntu1404:/mnt/Projects/TestOpenSC$ opensc-tool -i
>
> OpenSC 0.15.0 [gcc  4.8.4]
>
> Enabled features: locking zlib readline openssl pcsc(libpcsclite.so.1)
>
>  
>
> Any ideas?
>
>  
>
> Regards
>
>  
>
> Johannes
>
>  
>
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>
>
>
> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel
>

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel