static
byte
[][] a(RSAPrivateCrtKey rsaprivatecrtkey)
{
byte
abyte0[][];
int
i1;
int
k1;
abyte0
=
new
byte
[
8
][
0
];
i1
=
(i1
=
rsaprivatecrtkey.getModulus().bitLength())
+
(i1
&
1
);
Object obj
=
null
;
boolean
flag
=
false
;
k1
=
i1
>>
3
;
abyte0[
0
]
=
new
byte
[k1];
byte
abyte1[];
int
j1;
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getModulus().toByteArray()).length)
!=
k1
+
1
)
goto
_L2;
else
goto
_L1
_L1:
abyte1;
true
;
abyte0[
0
];
0
;
k1;
goto
_L3
_L2:
abyte1;
0
;
abyte0[
0
];
k1
-
j1;
j1;
_L3:
System.arraycopy();
abyte0[
1
]
=
new
byte
[k1];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getPrivateExponent().toByteArray()).length)
!=
k1
+
1
)
goto
_L5;
else
goto
_L4
_L4:
abyte1;
true
;
abyte0[
1
];
0
;
k1;
goto
_L6
_L5:
abyte1;
0
;
abyte0[
1
];
k1
-
j1;
j1;
_L6:
System.arraycopy();
k1
=
i1
>>
4
;
abyte0[
2
]
=
new
byte
[k1];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getCrtCoefficient().toByteArray()).length)
!=
k1
+
1
)
goto
_L8;
else
goto
_L7
_L7:
abyte1;
true
;
abyte0[
2
];
0
;
k1;
goto
_L9
_L8:
abyte1;
0
;
abyte0[
2
];
k1
-
j1;
j1;
_L9:
System.arraycopy();
abyte0[
3
]
=
new
byte
[k1];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getPrimeExponentP().toByteArray()).length)
!=
k1
+
1
)
goto
_L11;
else
goto
_L10
_L10:
abyte1;
true
;
abyte0[
3
];
0
;
k1;
goto
_L12
_L11:
abyte1;
0
;
abyte0[
3
];
k1
-
j1;
j1;
_L12:
System.arraycopy();
abyte0[
4
]
=
new
byte
[k1];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getPrimeExponentQ().toByteArray()).length)
!=
k1
+
1
)
goto
_L14;
else
goto
_L13
_L13:
abyte1;
true
;
abyte0[
4
];
0
;
k1;
goto
_L15
_L14:
abyte1;
0
;
abyte0[
4
];
k1
-
j1;
j1;
_L15:
System.arraycopy();
abyte0[
5
]
=
new
byte
[k1];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getPrimeP().toByteArray()).length)
!=
k1
+
1
)
goto
_L17;
else
goto
_L16
_L16:
abyte1;
true
;
abyte0[
5
];
0
;
k1;
goto
_L18
_L17:
abyte1;
0
;
abyte0[
5
];
k1
-
j1;
j1;
_L18:
System.arraycopy();
abyte0[
6
]
=
new
byte
[k1];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getPrimeQ().toByteArray()).length)
!=
k1
+
1
)
goto
_L20;
else
goto
_L19
_L19:
abyte1;
true
;
abyte0[
6
];
0
;
k1;
goto
_L21
_L20:
abyte1;
0
;
abyte0[
6
];
k1
-
j1;
j1;
_L21:
System.arraycopy();
abyte0[
7
]
=
new
byte
[
4
];
if
((j1
=
(abyte1
=
rsaprivatecrtkey.getPublicExponent().toByteArray()).length)
<=
4
)
goto
_L23;
else
goto
_L22
_L22:
abyte1;
false
;
abyte0[
7
];
0
;
4
;
goto
_L24
_L23:
abyte1;
0
;
abyte0[
7
];
4
-
j1;
j1;
_L24:
System.arraycopy();
return
abyte0;
}
本文介绍了一种将RSA私钥中的各个组成部分转换为字节数组的方法。该方法首先计算密钥长度,然后根据需要创建不同大小的字节数组来容纳模数、私钥指数等关键数据。通过对比原始数据与目标数组的长度,确保数据能够正确填充到新的字节数组中。
1万+

被折叠的 条评论
为什么被折叠?



