File tree Expand file tree Collapse file tree
java/org/bouncycastle/jcajce/provider/asymmetric
jdk1.1/org/bouncycastle/jcajce/provider/asymmetric/ecgost
jdk1.4/org/bouncycastle/jcajce/provider/asymmetric Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
2- release.suffix : 152b01
3- release.name : 1.52b01
4- release.version : 1.52.0.1
5- release.debug : false
2+ release.suffix : 152b06
3+ release.name : 1.52b06
4+ release.version : 1.52.0.6
5+ release.debug : true
66
77mail.jar.home : /opt/javamail/mail.jar
88activation.jar.home : /opt/jaf/activation.jar
9+ # junit.jar.home: /opt/junit4.8.1/junit-4.8.1.jar
910junit.jar.home : /opt/junit/junit.jar
11+
Original file line number Diff line number Diff line change 4343import org .bouncycastle .jcajce .provider .asymmetric .util .ECUtil ;
4444import org .bouncycastle .jcajce .provider .asymmetric .util .IESUtil ;
4545import org .bouncycastle .jce .interfaces .ECKey ;
46- import org .bouncycastle .jce .interfaces .ECPrivateKey ;
47- import org .bouncycastle .jce .interfaces .ECPublicKey ;
4846import org .bouncycastle .jce .interfaces .IESKey ;
4947import org .bouncycastle .jce .provider .BouncyCastleProvider ;
5048import org .bouncycastle .jce .spec .IESParameterSpec ;
@@ -284,7 +282,7 @@ else if (nonce.length != ivLength)
284282 // Parse the recipient's key
285283 if (opmode == Cipher .ENCRYPT_MODE || opmode == Cipher .WRAP_MODE )
286284 {
287- if (key instanceof ECPublicKey )
285+ if (key instanceof PublicKey )
288286 {
289287 this .key = ECUtil .generatePublicKeyParameter ((PublicKey )key );
290288 }
@@ -302,7 +300,7 @@ else if (key instanceof IESKey)
302300 }
303301 else if (opmode == Cipher .DECRYPT_MODE || opmode == Cipher .UNWRAP_MODE )
304302 {
305- if (key instanceof ECPrivateKey )
303+ if (key instanceof PrivateKey )
306304 {
307305 this .key = ECUtil .generatePrivateKeyParameter ((PrivateKey )key );
308306 }
Original file line number Diff line number Diff line change @@ -58,14 +58,7 @@ else if (publicKey instanceof GOST3410Key)
5858
5959 publicKey = BouncyCastleProvider .getPublicKey (SubjectPublicKeyInfo .getInstance (bytes ));
6060
61- if (publicKey instanceof ECPublicKey )
62- {
63- param = ECUtil .generatePublicKeyParameter (publicKey );
64- }
65- else
66- {
67- throw new InvalidKeyException ("can't recognise key type in DSA based signer" );
68- }
61+ param = ECUtil .generatePublicKeyParameter (publicKey );
6962 }
7063 catch (Exception e )
7164 {
Original file line number Diff line number Diff line change 1313import javax .crypto .IllegalBlockSizeException ;
1414import javax .crypto .NoSuchPaddingException ;
1515import javax .crypto .interfaces .DHPrivateKey ;
16+ import javax .crypto .interfaces .DHPublicKey ;
1617
1718import org .bouncycastle .crypto .CipherParameters ;
1819import org .bouncycastle .crypto .InvalidCipherTextException ;
@@ -183,15 +184,16 @@ else if (!(params instanceof IESParameterSpec))
183184 CipherParameters pubKey ;
184185 CipherParameters privKey ;
185186
186- if (ieKey .getPublic () instanceof ECPublicKey )
187+ if (ieKey .getPublic () instanceof DHPublicKey )
187188 {
188- pubKey = ECUtil .generatePublicKeyParameter (ieKey .getPublic ());
189- privKey = ECUtil .generatePrivateKeyParameter (ieKey .getPrivate ());
189+ pubKey = DHUtil .generatePublicKeyParameter (ieKey .getPublic ());
190+ privKey = DHUtil .generatePrivateKeyParameter (ieKey .getPrivate ());
191+
190192 }
191193 else
192194 {
193- pubKey = DHUtil .generatePublicKeyParameter (ieKey .getPublic ());
194- privKey = DHUtil .generatePrivateKeyParameter (ieKey .getPrivate ());
195+ pubKey = ECUtil .generatePublicKeyParameter (ieKey .getPublic ());
196+ privKey = ECUtil .generatePrivateKeyParameter (ieKey .getPrivate ());
195197 }
196198
197199 this .engineParams = (IESParameterSpec )params ;
Original file line number Diff line number Diff line change @@ -61,14 +61,7 @@ else if (publicKey instanceof GOST3410Key)
6161
6262 publicKey = BouncyCastleProvider .getPublicKey (SubjectPublicKeyInfo .getInstance (bytes ));
6363
64- if (publicKey instanceof ECPublicKey )
65- {
66- param = ECUtil .generatePublicKeyParameter (publicKey );
67- }
68- else
69- {
70- throw new InvalidKeyException ("can't recognise key type in DSA based signer" );
71- }
64+ param = ECUtil .generatePublicKeyParameter (publicKey );
7265 }
7366 catch (Exception e )
7467 {
Original file line number Diff line number Diff line change @@ -86,14 +86,7 @@ protected void doEngineInitSign(
8686 {
8787 CipherParameters param ;
8888
89- if (privateKey instanceof ECKey )
90- {
91- param = ECUtil .generatePrivateKeyParameter (privateKey );
92- }
93- else
94- {
95- throw new InvalidKeyException ("can't recognise key type in ECDSA based signer" );
96- }
89+ param = ECUtil .generatePrivateKeyParameter (privateKey );
9790
9891 digest .reset ();
9992
Original file line number Diff line number Diff line change @@ -59,14 +59,7 @@ else if (publicKey instanceof GOST3410Key)
5959
6060 publicKey = BouncyCastleProvider .getPublicKey (SubjectPublicKeyInfo .getInstance (bytes ));
6161
62- if (publicKey instanceof ECPublicKey )
63- {
64- param = ECUtil .generatePublicKeyParameter (publicKey );
65- }
66- else
67- {
68- throw new InvalidKeyException ("can't recognise key type in DSA based signer" );
69- }
62+ param = ECUtil .generatePublicKeyParameter (publicKey );
7063 }
7164 catch (Exception e )
7265 {
You can’t perform that action at this time.
0 commit comments