I have a private key that I need to load onto the smart card.
The prime P value used being
00CC11DBABBC3648BF4C3800DD73C769580D60B8F45BA41210674FCFB6EDE6C604FD20FBD0EC3125BB9A116238CE4900A0308155971AB606CFB9945551B519ED6F
And the prime Q value being
00DF613AEA2FF8438C58766639DCED24D9BCBAF75926734EAD56ECFF03E7801DF812604926EF03A1A88F38B5B03A8E7A6361258C7A4B84FDA3D2286A50608DC291
The PIV User Guide says PQ = P-1 mod Q
For (P-1) mod Q I arrive at the value
00CC11DBABBC3648BF4C3800DD73C769580D60B8F45BA41210674FCFB6EDE6C604FD20FBD0EC3125BB9A116238CE4900A0308155971AB606CFB9945551B519ED6E
which fails to load into the card. The PQ value for the same private key used
by the PIV demo tool is
C3E06EAC8B7A4A0BB3EF2B0241FCAF74814580579F56EBB36E4035CDEDBDF3252DAE4BFBD83545F91BC3E2C2ED1BE6F2DB01F92B2DC64B96FE74ADAE61FD28EF
I don't know how this value is arrived at. I also tried P - (1 mod Q) and
simply P*Q but these values don't match with the expected value either.
I'm attaching the private key file and the openssl dump for your reference. I
have interchanged the P and Q because according to the card specs, P should be
the smaller prime.
Please advice.
thanks
Kannan
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCyERAVj1p8CGytZXPZqKTlUXT4j4xySOBUL/Mw+ofoAhUAgzOe
PtXrSzeN4pfnEJUFlkuUBRvVflQE+IAB0UNb+BxL5ocJUtfStj7IzjxARiucU82X
OwA4XhZRCRCvgdIbT2be6e1wdC6op5v6QZrlBPOuZF6rDQCjWN+Gn8CZ3wIDAQAB
AoGBAJ7Bs7NlMekvoaUetKE0SH/jlgQeB7vE2ax1a78ZPp5NbOgeEaFeqF61mvw3
L/Nkx1hJ3WxE+cHodYRRAd+c8Q3LF3lfOhEfv88yUs39+0N8BEoqe4FdV0x+w+/3
S8e8YDu8NmHIsD6a+A6M05+FXJMmtyvcNX+9P/3yxkR+EyRBAkEA32E66i/4Q4xY
dmY53O0k2by691kmc06tVuz/A+eAHfgSYEkm7wOhqI84tbA6jnpjYSWMekuE/aPS
KGpQYI3CkQJBAMwR26u8Nki/TDgA3XPHaVgNYLj0W6QSEGdPz7bt5sYE/SD70Owx
JbuaEWI4zkkAoDCBVZcatgbPuZRVUbUZ7W8CQGiIqrZfHnIV4mv96MQfYehXLrOD
z7+UKQANxkVAd68OoSLX+NVPQL6Nz38O6kg0s/8JQFUWtDSyDi4FmnmkvVECQQCI
XCZ9Sva7BZjYkztm8gjiXY4UCLRznd54KkyR38Yk65B5ScsBCJY+FWUoTO0KuvBP
eRzIK4EWbBeFlr1SVlDhAkAI9+Tlp0pjOUPtF9biXf3tdGR+r8lBgguMtyMRbFgt
bfFnfGyPxx55JAGtZx8RJ5ImarJ8EHbvAPJvZl5iC00P
-----END RSA PRIVATE KEY-----
Private-Key: (1024 bit)
modulus:
00:b2:11:10:15:8f:5a:7c:08:6c:ad:65:73:d9:a8:
a4:e5:51:74:f8:8f:8c:72:48:e0:54:2f:f3:30:fa:
87:e8:02:15:00:83:33:9e:3e:d5:eb:4b:37:8d:e2:
97:e7:10:95:05:96:4b:94:05:1b:d5:7e:54:04:f8:
80:01:d1:43:5b:f8:1c:4b:e6:87:09:52:d7:d2:b6:
3e:c8:ce:3c:40:46:2b:9c:53:cd:97:3b:00:38:5e:
16:51:09:10:af:81:d2:1b:4f:66:de:e9:ed:70:74:
2e:a8:a7:9b:fa:41:9a:e5:04:f3:ae:64:5e:ab:0d:
00:a3:58:df:86:9f:c0:99:df
publicExponent: 65537 (0x10001)
privateExponent:
00:9e:c1:b3:b3:65:31:e9:2f:a1:a5:1e:b4:a1:34:
48:7f:e3:96:04:1e:07:bb:c4:d9:ac:75:6b:bf:19:
3e:9e:4d:6c:e8:1e:11:a1:5e:a8:5e:b5:9a:fc:37:
2f:f3:64:c7:58:49:dd:6c:44:f9:c1:e8:75:84:51:
01:df:9c:f1:0d:cb:17:79:5f:3a:11:1f:bf:cf:32:
52:cd:fd:fb:43:7c:04:4a:2a:7b:81:5d:57:4c:7e:
c3:ef:f7:4b:c7:bc:60:3b:bc:36:61:c8:b0:3e:9a:
f8:0e:8c:d3:9f:85:5c:93:26:b7:2b:dc:35:7f:bd:
3f:fd:f2:c6:44:7e:13:24:41
prime1:
00:df:61:3a:ea:2f:f8:43:8c:58:76:66:39:dc:ed:
24:d9:bc:ba:f7:59:26:73:4e:ad:56:ec:ff:03:e7:
80:1d:f8:12:60:49:26:ef:03:a1:a8:8f:38:b5:b0:
3a:8e:7a:63:61:25:8c:7a:4b:84:fd:a3:d2:28:6a:
50:60:8d:c2:91
prime2:
00:cc:11:db:ab:bc:36:48:bf:4c:38:00:dd:73:c7:
69:58:0d:60:b8:f4:5b:a4:12:10:67:4f:cf:b6:ed:
e6:c6:04:fd:20:fb:d0:ec:31:25:bb:9a:11:62:38:
ce:49:00:a0:30:81:55:97:1a:b6:06:cf:b9:94:55:
51:b5:19:ed:6f
exponent1:
68:88:aa:b6:5f:1e:72:15:e2:6b:fd:e8:c4:1f:61:
e8:57:2e:b3:83:cf:bf:94:29:00:0d:c6:45:40:77:
af:0e:a1:22:d7:f8:d5:4f:40:be:8d:cf:7f:0e:ea:
48:34:b3:ff:09:40:55:16:b4:34:b2:0e:2e:05:9a:
79:a4:bd:51
exponent2:
00:88:5c:26:7d:4a:f6:bb:05:98:d8:93:3b:66:f2:
08:e2:5d:8e:14:08:b4:73:9d:de:78:2a:4c:91:df:
c6:24:eb:90:79:49:cb:01:08:96:3e:15:65:28:4c:
ed:0a:ba:f0:4f:79:1c:c8:2b:81:16:6c:17:85:96:
bd:52:56:50:e1
coefficient:
08:f7:e4:e5:a7:4a:63:39:43:ed:17:d6:e2:5d:fd:
ed:74:64:7e:af:c9:41:82:0b:8c:b7:23:11:6c:58:
2d:6d:f1:67:7c:6c:8f:c7:1e:79:24:01:ad:67:1f:
11:27:92:26:6a:b2:7c:10:76:ef:00:f2:6f:66:5e:
62:0b:4d:0f
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQCyERAVj1p8CGytZ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