# Change Private Key Usage retroactivly?

**URL:** <https://support.nitrokey.com/t/change-private-key-usage-retroactivly/6003>\
**Category:** HSM\
**Created:** [February 28, 2024, 2:35pm UTC](https://support.nitrokey.com/t/change-private-key-usage-retroactivly/6003 "2024-02-28T14:35:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![saper](https://support.nitrokey.com/user_avatar/support.nitrokey.com/saper/32/493_2.png) [@saper](https://support.nitrokey.com/u/saper)\
**Post date:** [February 28, 2024, 4:23pm UTC](https://support.nitrokey.com/t/change-private-key-usage-retroactivly/6003/2 "2024-02-28T16:23:10Z")

</div>

Normally you cannot change them.

But you might be lucky if you do a low-level manipulation of files on the card, you might succeed in changing the private key information object, which looks roughly like this:

```plaintext
radziecki> /usr/local/bin/opensc-explorer
OpenSC Explorer version 0.23.0
Using reader with a card: Nitrokey Nitrokey HSM (DENK01045710000 ) 00 00
OpenSC [3F00]> cd aid:E82B0601040181C31F0201
OpenSC [E82B/0601/0401/81C3/1F02/01]> cat C401
00000000: A0 2F 30 04 0C 02 45 31 30 1B 04 14 CD 0A 6B 4D ./0...E10.....kM
00000010: C6 2D 12 D8 FF AD 08 CC E8 D0 5D 00 CC 53 7D C7 .-........]..S}.
00000020: 03 03 07 20 80 A1 0A 30 08 30 02 04 00 02 02 01 ... ...0.0......
00000030: 00 .
OpenSC [E82B/0601/0401/81C3/1F02/01]> asn1 C401
A0 Context 0 (47 bytes)
   30 SEQUENCE (4 bytes)
      0C UTF8String (2 bytes): E1
   30 SEQUENCE (27 bytes)
      04 OCTET STRING (20 bytes)
         CD 0A 6B 4D C6 2D 12 D8 FF AD 08 CC E8 D0 5D 00 ..kM.-........].
         CC 53 7D C7 .S}.
      03 BIT STRING (3 bytes): 100000100
   A1 Context 1 (10 bytes)
      30 SEQUENCE (8 bytes)
         30 SEQUENCE (2 bytes)
            04 OCTET STRING (0 bytes)
         02 INTEGER (2 bytes): 256

```

A similar low-level problem has been discussed in the thread linked below, but the solution was a JavaScript code to simplify the update, you might check this out as well:

> [@Nitrokey HSM2 4K: Unwrap not working after firmware update 3.3 to 3.5](https://support.nitrokey.com/t/nitrokey-hsm2-4k-unwrap-not-working-after-firmware-update-3-3-to-3-5/3615):
>
> Hi, I first made a backup with wrap, then updated the Nitrokey HSM2 from firmware 3.3 to 3.5. Then initialized the Nitrokey with: sc-hsm-tool --initialize --so-pin xxxxxxxx --pin yyyyyyy -s 1 sc-hsm-tool --import-dkek-share ..\dkek-share-1.pbe sc-hsm-tool --unwrap-key backup.bin --key-reference 1 Then it shows: Using reader with a card: Nitrokey Nitrokey HSM 0 Wrapped key contains: Key blob Private Key Description (PRKD) Enter User PIN : Key successfully imported After pkcs15-tool -D th…

---

_[View the full topic](https://support.nitrokey.com/t/change-private-key-usage-retroactivly/6003)._
