1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /** 19 * @author Vladimir N. Molotkov 20 * @version $Revision$ 21 */ 22 23 package tests.security.spec; 24 25 import junit.framework.TestCase; 26 27 import java.math.BigInteger; 28 import java.security.spec.KeySpec; 29 import java.security.spec.RSAMultiPrimePrivateCrtKeySpec; 30 import java.security.spec.RSAOtherPrimeInfo; 31 import java.security.spec.RSAPrivateKeySpec; 32 33 /** 34 * Tests for <code>RSAMultiPrimePrivateCrtKeySpec</code> class fields and methods. 35 * 36 */ 37 public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase { 38 /** 39 * Reference array of RSAOtherPrimeInfo. DO NOT MODIFY 40 */ 41 private static final RSAOtherPrimeInfo[] opi = new RSAOtherPrimeInfo[] { 42 new RSAOtherPrimeInfo(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE), 43 new RSAOtherPrimeInfo(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE), 44 new RSAOtherPrimeInfo(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE) 45 }; 46 47 // Test-cases: 48 49 /** 50 * Test #1 for 51 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 52 * BigInteger publicExponent, 53 * BigInteger privateExponent, 54 * BigInteger primeP, 55 * BigInteger primeQ, 56 * BigInteger primeExponentP, 57 * BigInteger primeExponentQ, 58 * BigInteger crtCoefficient, 59 * RSAOtherPrimeInfo[] otherPrimeInfo) 60 * </code> ctor<br> 61 * Assertion: constructs <code>RSAMultiPrimePrivateCrtKeySpec</code> 62 * object using valid parameters 63 */ 64 public final void testRSAMultiPrimePrivateCrtKeySpec01() { 65 KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( 66 BigInteger.ONE, 67 BigInteger.ONE, 68 BigInteger.ONE, 69 BigInteger.ONE, 70 BigInteger.ONE, 71 BigInteger.ONE, 72 BigInteger.ONE, 73 BigInteger.ONE, 74 opi); 75 assertTrue(ks instanceof RSAMultiPrimePrivateCrtKeySpec); 76 } 77 78 /** 79 * Test #2 for 80 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 81 * BigInteger publicExponent, 82 * BigInteger privateExponent, 83 * BigInteger primeP, 84 * BigInteger primeQ, 85 * BigInteger primeExponentP, 86 * BigInteger primeExponentQ, 87 * BigInteger crtCoefficient, 88 * RSAOtherPrimeInfo[] otherPrimeInfo) 89 * </code> ctor<br> 90 * Assertion: NullPointerException if modulus is null 91 */ 92 public final void testRSAMultiPrimePrivateCrtKeySpec02() { 93 try { 94 new RSAMultiPrimePrivateCrtKeySpec( 95 null, 96 BigInteger.ONE, 97 BigInteger.ONE, 98 BigInteger.ONE, 99 BigInteger.ONE, 100 BigInteger.ONE, 101 BigInteger.ONE, 102 BigInteger.ONE, 103 opi); 104 fail("Expected NPE not thrown"); 105 } catch (NullPointerException e) { 106 } 107 } 108 109 /** 110 * Test #3 for 111 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 112 * BigInteger publicExponent, 113 * BigInteger privateExponent, 114 * BigInteger primeP, 115 * BigInteger primeQ, 116 * BigInteger primeExponentP, 117 * BigInteger primeExponentQ, 118 * BigInteger crtCoefficient, 119 * RSAOtherPrimeInfo[] otherPrimeInfo) 120 * </code> ctor<br> 121 * Assertion: NullPointerException if publicExponent is null 122 */ 123 public final void testRSAMultiPrimePrivateCrtKeySpec03() { 124 try { 125 new RSAMultiPrimePrivateCrtKeySpec( 126 BigInteger.ONE, 127 null, 128 BigInteger.ONE, 129 BigInteger.ONE, 130 BigInteger.ONE, 131 BigInteger.ONE, 132 BigInteger.ONE, 133 BigInteger.ONE, 134 opi); 135 fail("Expected NPE not thrown"); 136 } catch (NullPointerException e) { 137 } 138 } 139 140 /** 141 * Test #4 for 142 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 143 * BigInteger publicExponent, 144 * BigInteger privateExponent, 145 * BigInteger primeP, 146 * BigInteger primeQ, 147 * BigInteger primeExponentP, 148 * BigInteger primeExponentQ, 149 * BigInteger crtCoefficient, 150 * RSAOtherPrimeInfo[] otherPrimeInfo) 151 * </code> ctor<br> 152 * Assertion: NullPointerException if privateExponent is null 153 */ 154 public final void testRSAMultiPrimePrivateCrtKeySpec04() { 155 try { 156 new RSAMultiPrimePrivateCrtKeySpec( 157 BigInteger.ONE, 158 BigInteger.ONE, 159 null, 160 BigInteger.ONE, 161 BigInteger.ONE, 162 BigInteger.ONE, 163 BigInteger.ONE, 164 BigInteger.ONE, 165 opi); 166 fail("Expected NPE not thrown"); 167 } catch (NullPointerException e) { 168 } 169 } 170 171 /** 172 * Test #5 for 173 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 174 * BigInteger publicExponent, 175 * BigInteger privateExponent, 176 * BigInteger primeP, 177 * BigInteger primeQ, 178 * BigInteger primeExponentP, 179 * BigInteger primeExponentQ, 180 * BigInteger crtCoefficient, 181 * RSAOtherPrimeInfo[] otherPrimeInfo) 182 * </code> ctor<br> 183 * Assertion: NullPointerException if primeP is null 184 */ 185 public final void testRSAMultiPrimePrivateCrtKeySpec05() { 186 try { 187 new RSAMultiPrimePrivateCrtKeySpec( 188 BigInteger.ONE, 189 BigInteger.ONE, 190 BigInteger.ONE, 191 null, 192 BigInteger.ONE, 193 BigInteger.ONE, 194 BigInteger.ONE, 195 BigInteger.ONE, 196 opi); 197 fail("Expected NPE not thrown"); 198 } catch (NullPointerException e) { 199 } 200 } 201 202 /** 203 * Test #6 for 204 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 205 * BigInteger publicExponent, 206 * BigInteger privateExponent, 207 * BigInteger primeP, 208 * BigInteger primeQ, 209 * BigInteger primeExponentP, 210 * BigInteger primeExponentQ, 211 * BigInteger crtCoefficient, 212 * RSAOtherPrimeInfo[] otherPrimeInfo) 213 * </code> ctor<br> 214 * Assertion: NullPointerException if primeQ is null 215 */ 216 public final void testRSAMultiPrimePrivateCrtKeySpec06() { 217 try { 218 new RSAMultiPrimePrivateCrtKeySpec( 219 BigInteger.ONE, 220 BigInteger.ONE, 221 BigInteger.ONE, 222 BigInteger.ONE, 223 null, 224 BigInteger.ONE, 225 BigInteger.ONE, 226 BigInteger.ONE, 227 opi); 228 fail("Expected NPE not thrown"); 229 } catch (NullPointerException e) { 230 } 231 } 232 233 /** 234 * Test #7 for 235 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 236 * BigInteger publicExponent, 237 * BigInteger privateExponent, 238 * BigInteger primeP, 239 * BigInteger primeQ, 240 * BigInteger primeExponentP, 241 * BigInteger primeExponentQ, 242 * BigInteger crtCoefficient, 243 * RSAOtherPrimeInfo[] otherPrimeInfo) 244 * </code> ctor<br> 245 * Assertion: NullPointerException if primeExponentP is null 246 */ 247 public final void testRSAMultiPrimePrivateCrtKeySpec07() { 248 try { 249 new RSAMultiPrimePrivateCrtKeySpec( 250 BigInteger.ONE, 251 BigInteger.ONE, 252 BigInteger.ONE, 253 BigInteger.ONE, 254 BigInteger.ONE, 255 null, 256 BigInteger.ONE, 257 BigInteger.ONE, 258 opi); 259 fail("Expected NPE not thrown"); 260 } catch (NullPointerException e) { 261 } 262 } 263 264 /** 265 * Test #8 for 266 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 267 * BigInteger publicExponent, 268 * BigInteger privateExponent, 269 * BigInteger primeP, 270 * BigInteger primeQ, 271 * BigInteger primeExponentP, 272 * BigInteger primeExponentQ, 273 * BigInteger crtCoefficient, 274 * RSAOtherPrimeInfo[] otherPrimeInfo) 275 * </code> ctor<br> 276 * Assertion: NullPointerException if primeExponentQ is null 277 */ 278 public final void testRSAMultiPrimePrivateCrtKeySpec08() { 279 try { 280 new RSAMultiPrimePrivateCrtKeySpec( 281 BigInteger.ONE, 282 BigInteger.ONE, 283 BigInteger.ONE, 284 BigInteger.ONE, 285 BigInteger.ONE, 286 BigInteger.ONE, 287 null, 288 BigInteger.ONE, 289 opi); 290 fail("Expected NPE not thrown"); 291 } catch (NullPointerException e) { 292 } 293 } 294 295 /** 296 * Test #9 for 297 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 298 * BigInteger publicExponent, 299 * BigInteger privateExponent, 300 * BigInteger primeP, 301 * BigInteger primeQ, 302 * BigInteger primeExponentP, 303 * BigInteger primeExponentQ, 304 * BigInteger crtCoefficient, 305 * RSAOtherPrimeInfo[] otherPrimeInfo) 306 * </code> ctor<br> 307 * Assertion: NullPointerException if crtCoefficient is null 308 */ 309 public final void testRSAMultiPrimePrivateCrtKeySpec09() { 310 try { 311 new RSAMultiPrimePrivateCrtKeySpec( 312 BigInteger.ONE, 313 BigInteger.ONE, 314 BigInteger.ONE, 315 BigInteger.ONE, 316 BigInteger.ONE, 317 BigInteger.ONE, 318 BigInteger.ONE, 319 null, 320 opi); 321 fail("Expected NPE not thrown"); 322 } catch (NullPointerException e) { 323 } 324 } 325 326 /** 327 * Test #10 for 328 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 329 * BigInteger publicExponent, 330 * BigInteger privateExponent, 331 * BigInteger primeP, 332 * BigInteger primeQ, 333 * BigInteger primeExponentP, 334 * BigInteger primeExponentQ, 335 * BigInteger crtCoefficient, 336 * RSAOtherPrimeInfo[] otherPrimeInfo) 337 * </code> ctor<br> 338 * Assertion: otherPrimeInfo can be null 339 */ 340 public final void testRSAMultiPrimePrivateCrtKeySpec10() { 341 try { 342 new RSAMultiPrimePrivateCrtKeySpec( 343 BigInteger.ONE, 344 BigInteger.ONE, 345 BigInteger.ONE, 346 BigInteger.ONE, 347 BigInteger.ONE, 348 BigInteger.ONE, 349 BigInteger.ONE, 350 BigInteger.ONE, 351 null); 352 } catch (Exception e) { 353 fail("Unexpected exception is thrown"); 354 } 355 } 356 357 /** 358 * Test #11 for 359 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 360 * BigInteger publicExponent, 361 * BigInteger privateExponent, 362 * BigInteger primeP, 363 * BigInteger primeQ, 364 * BigInteger primeExponentP, 365 * BigInteger primeExponentQ, 366 * BigInteger crtCoefficient, 367 * RSAOtherPrimeInfo[] otherPrimeInfo) 368 * </code> ctor<br> 369 * Assertion: IllegalArgumentException if otherPrimeInfo length is 0 370 */ 371 public final void testRSAMultiPrimePrivateCrtKeySpec11() { 372 try { 373 new RSAMultiPrimePrivateCrtKeySpec( 374 BigInteger.ONE, 375 BigInteger.ONE, 376 BigInteger.ONE, 377 BigInteger.ONE, 378 BigInteger.ONE, 379 BigInteger.ONE, 380 BigInteger.ONE, 381 BigInteger.ONE, 382 new RSAOtherPrimeInfo[0]); 383 fail("Expected IAE not thrown"); 384 } catch (IllegalArgumentException e) { 385 } 386 } 387 388 /** 389 * Test #12 for 390 * <code>RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus, 391 * BigInteger publicExponent, 392 * BigInteger privateExponent, 393 * BigInteger primeP, 394 * BigInteger primeQ, 395 * BigInteger primeExponentP, 396 * BigInteger primeExponentQ, 397 * BigInteger crtCoefficient, 398 * RSAOtherPrimeInfo[] otherPrimeInfo) 399 * </code> ctor<br> 400 * Assertion: constructs <code>RSAMultiPrimePrivateCrtKeySpec</code> 401 * object using valid parameters. Constructed object must be 402 * instance of RSAPrivateKeySpec. 403 */ 404 public final void testRSAMultiPrimePrivateCrtKeySpec12() { 405 KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( 406 BigInteger.ONE, 407 BigInteger.ONE, 408 BigInteger.ONE, 409 BigInteger.ONE, 410 BigInteger.ONE, 411 BigInteger.ONE, 412 BigInteger.ONE, 413 BigInteger.ONE, 414 opi); 415 assertTrue(ks instanceof RSAPrivateKeySpec); 416 } 417 418 /** 419 * Test for <code>getCrtCoefficient()</code> method<br> 420 * Assertion: returns crt coefficient 421 */ 422 public final void testGetCrtCoefficient() { 423 RSAMultiPrimePrivateCrtKeySpec ks = 424 new RSAMultiPrimePrivateCrtKeySpec( 425 BigInteger.ONE, 426 BigInteger.ONE, 427 BigInteger.ONE, 428 BigInteger.ONE, 429 BigInteger.ONE, 430 BigInteger.ONE, 431 BigInteger.ONE, 432 BigInteger.ONE, 433 opi); 434 assertTrue(BigInteger.ONE.equals(ks.getCrtCoefficient())); 435 } 436 437 /** 438 * Test for <code>getPrimeExponentP()</code> method<br> 439 * Assertion: returns prime exponent P 440 */ 441 public final void testGetPrimeExponentP() { 442 RSAMultiPrimePrivateCrtKeySpec ks = 443 new RSAMultiPrimePrivateCrtKeySpec( 444 BigInteger.ONE, 445 BigInteger.ONE, 446 BigInteger.ONE, 447 BigInteger.ONE, 448 BigInteger.ONE, 449 BigInteger.ONE, 450 BigInteger.ONE, 451 BigInteger.ONE, 452 opi); 453 assertTrue(BigInteger.ONE.equals(ks.getPrimeExponentP())); 454 } 455 456 /** 457 * Test for <code>getPrimeExponentQ()</code> method<br> 458 * Assertion: returns prime exponent Q 459 */ 460 public final void testGetPrimeExponentQ() { 461 RSAMultiPrimePrivateCrtKeySpec ks = 462 new RSAMultiPrimePrivateCrtKeySpec( 463 BigInteger.ONE, 464 BigInteger.ONE, 465 BigInteger.ONE, 466 BigInteger.ONE, 467 BigInteger.ONE, 468 BigInteger.ONE, 469 BigInteger.ONE, 470 BigInteger.ONE, 471 opi); 472 assertTrue(BigInteger.ONE.equals(ks.getPrimeExponentQ())); 473 } 474 475 /** 476 * Test for <code>getPrimeP()</code> method<br> 477 * Assertion: returns prime P 478 */ 479 public final void testGetPrimeP() { 480 RSAMultiPrimePrivateCrtKeySpec ks = 481 new RSAMultiPrimePrivateCrtKeySpec( 482 BigInteger.ONE, 483 BigInteger.ONE, 484 BigInteger.ONE, 485 BigInteger.ONE, 486 BigInteger.ONE, 487 BigInteger.ONE, 488 BigInteger.ONE, 489 BigInteger.ONE, 490 opi); 491 assertTrue(BigInteger.ONE.equals(ks.getPrimeP())); 492 } 493 494 /** 495 * Test for <code>getPrimeQ()</code> method<br> 496 * Assertion: returns prime Q 497 */ 498 public final void testGetPrimeQ() { 499 RSAMultiPrimePrivateCrtKeySpec ks = 500 new RSAMultiPrimePrivateCrtKeySpec( 501 BigInteger.ONE, 502 BigInteger.ONE, 503 BigInteger.ONE, 504 BigInteger.ONE, 505 BigInteger.ONE, 506 BigInteger.ONE, 507 BigInteger.ONE, 508 BigInteger.ONE, 509 opi); 510 assertTrue(BigInteger.ONE.equals(ks.getPrimeQ())); 511 } 512 513 /** 514 * Test for <code>getPublicExponent()</code> method<br> 515 * Assertion: returns public exponent 516 */ 517 public final void testGetPublicExponent() { 518 RSAMultiPrimePrivateCrtKeySpec ks = 519 new RSAMultiPrimePrivateCrtKeySpec( 520 BigInteger.ONE, 521 BigInteger.ONE, 522 BigInteger.ONE, 523 BigInteger.ONE, 524 BigInteger.ONE, 525 BigInteger.ONE, 526 BigInteger.ONE, 527 BigInteger.ONE, 528 opi); 529 assertTrue(BigInteger.ONE.equals(ks.getPublicExponent())); 530 } 531 532 /** 533 * Test #1 for <code>getOtherPrimeInfo()</code> method<br> 534 * Assertion: returns array of RSAOtherPrimeInfo 535 */ 536 public final void testGetOtherPrimeInfo01() { 537 RSAMultiPrimePrivateCrtKeySpec ks = 538 new RSAMultiPrimePrivateCrtKeySpec( 539 BigInteger.ONE, 540 BigInteger.ONE, 541 BigInteger.ONE, 542 BigInteger.ONE, 543 BigInteger.ONE, 544 BigInteger.ONE, 545 BigInteger.ONE, 546 BigInteger.ONE, 547 opi); 548 assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo())); 549 } 550 551 /** 552 * Test #2 for <code>getOtherPrimeInfo()</code> method<br> 553 * Assertion: returns null if null has been passed to the 554 * constructor as otherPrimeInfo parameter 555 */ 556 public final void testGetOtherPrimeInfo02() { 557 RSAMultiPrimePrivateCrtKeySpec ks = 558 new RSAMultiPrimePrivateCrtKeySpec( 559 BigInteger.ONE, 560 BigInteger.ONE, 561 BigInteger.ONE, 562 BigInteger.ONE, 563 BigInteger.ONE, 564 BigInteger.ONE, 565 BigInteger.ONE, 566 BigInteger.ONE, 567 null); 568 assertNull(ks.getOtherPrimeInfo()); 569 } 570 571 // 572 // immutability tests 573 // 574 575 /** 576 * Tests that internal state of the object 577 * can not be modified by modifying initial array 578 */ 579 public final void testIsStatePreserved1() { 580 // Create initial array 581 RSAOtherPrimeInfo[] opi1 = opi.clone(); 582 583 RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( 584 BigInteger.ONE, 585 BigInteger.ONE, 586 BigInteger.ONE, 587 BigInteger.ONE, 588 BigInteger.ONE, 589 BigInteger.ONE, 590 BigInteger.ONE, 591 BigInteger.ONE, 592 opi1); 593 594 // Modify initial array 595 opi1[2] = new RSAOtherPrimeInfo(BigInteger.ZERO, 596 BigInteger.ZERO, 597 BigInteger.ZERO); 598 599 // Check that above modification 600 // does not affect internal state 601 assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo())); 602 } 603 604 /** 605 * Tests that internal state of the object 606 * can not be modified using array reference 607 * returned by <code>getOtherPrimeInfo()</code> 608 * method 609 */ 610 public final void testIsStatePreserved2() { 611 // Create initial array 612 RSAOtherPrimeInfo[] opi1 = opi.clone(); 613 614 RSAMultiPrimePrivateCrtKeySpec ks = new RSAMultiPrimePrivateCrtKeySpec( 615 BigInteger.ONE, 616 BigInteger.ONE, 617 BigInteger.ONE, 618 BigInteger.ONE, 619 BigInteger.ONE, 620 BigInteger.ONE, 621 BigInteger.ONE, 622 BigInteger.ONE, 623 opi1); 624 625 RSAOtherPrimeInfo[] ret = ks.getOtherPrimeInfo(); 626 627 // Modify returned array 628 ret[2] = new RSAOtherPrimeInfo(BigInteger.ZERO, 629 BigInteger.ZERO, 630 BigInteger.ZERO); 631 632 // Check that above modification 633 // does not affect internal state 634 assertTrue(checkOtherPrimeInfo(ks.getOtherPrimeInfo())); 635 } 636 637 // 638 // Tests for inherited methods 639 // 640 641 /** 642 * Test for <code>getModulus()</code> method<br> 643 * Assertion: returns modulus 644 */ 645 public final void testGetModulus() { 646 RSAMultiPrimePrivateCrtKeySpec ks = 647 new RSAMultiPrimePrivateCrtKeySpec( 648 BigInteger.ONE, 649 BigInteger.ONE, 650 BigInteger.ONE, 651 BigInteger.ONE, 652 BigInteger.ONE, 653 BigInteger.ONE, 654 BigInteger.ONE, 655 BigInteger.ONE, 656 opi); 657 assertTrue(BigInteger.ONE.equals(ks.getModulus())); 658 } 659 660 /** 661 * Test for <code>getPrivateExponent()</code> method<br> 662 * Assertion: returns private exponent 663 */ 664 public final void testGetPrivateExponent() { 665 RSAMultiPrimePrivateCrtKeySpec ks = 666 new RSAMultiPrimePrivateCrtKeySpec( 667 BigInteger.ONE, 668 BigInteger.ONE, 669 BigInteger.ONE, 670 BigInteger.ONE, 671 BigInteger.ONE, 672 BigInteger.ONE, 673 BigInteger.ONE, 674 BigInteger.ONE, 675 opi); 676 assertTrue(BigInteger.ONE.equals(ks.getPrivateExponent())); 677 } 678 679 // private stuff 680 // 681 /** 682 * Compares array passed as a parameter with reference one<br> 683 * 684 * <code>private static final RSAOtherPrimeInfo[] opi</code> 685 * 686 * @param toBeChecked 687 * Array to be compared 688 * @return 689 * true if arrays are equal 690 */ 691 private boolean checkOtherPrimeInfo(RSAOtherPrimeInfo[] toBeChecked) { 692 if (toBeChecked == null || toBeChecked.length != opi.length) { 693 return false; 694 } 695 for (int i=0; i<opi.length; i++) { 696 if (opi[i].getPrime().equals(toBeChecked[i].getPrime()) && 697 opi[i].getExponent().equals(toBeChecked[i].getExponent()) && 698 opi[i].getCrtCoefficient().equals(toBeChecked[i].getCrtCoefficient())) { 699 continue; 700 } 701 return false; 702 } 703 return true; 704 } 705 706 } 707