001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2008 Sun Microsystems, Inc. 025 */ 026package org.opends.server.admin.std.meta; 027 028 029 030import java.util.Collection; 031import java.util.SortedSet; 032import org.opends.server.admin.AdministratorAction; 033import org.opends.server.admin.AliasDefaultBehaviorProvider; 034import org.opends.server.admin.BooleanPropertyDefinition; 035import org.opends.server.admin.client.AuthorizationException; 036import org.opends.server.admin.client.CommunicationException; 037import org.opends.server.admin.client.ConcurrentModificationException; 038import org.opends.server.admin.client.ManagedObject; 039import org.opends.server.admin.client.MissingMandatoryPropertiesException; 040import org.opends.server.admin.client.OperationRejectedException; 041import org.opends.server.admin.DefaultBehaviorProvider; 042import org.opends.server.admin.DefinedDefaultBehaviorProvider; 043import org.opends.server.admin.IntegerPropertyDefinition; 044import org.opends.server.admin.ManagedObjectAlreadyExistsException; 045import org.opends.server.admin.ManagedObjectDefinition; 046import org.opends.server.admin.PropertyOption; 047import org.opends.server.admin.PropertyProvider; 048import org.opends.server.admin.server.ConfigurationChangeListener; 049import org.opends.server.admin.server.ServerManagedObject; 050import org.opends.server.admin.std.client.CryptoManagerCfgClient; 051import org.opends.server.admin.std.server.CryptoManagerCfg; 052import org.opends.server.admin.StringPropertyDefinition; 053import org.opends.server.admin.Tag; 054import org.opends.server.admin.TopCfgDefn; 055import org.opends.server.types.DN; 056 057 058 059/** 060 * An interface for querying the Crypto Manager managed object 061 * definition meta information. 062 * <p> 063 * The Crypto Manager provides a common interface for performing 064 * compression, decompression, hashing, encryption and other kinds of 065 * cryptographic operations. 066 */ 067public final class CryptoManagerCfgDefn extends ManagedObjectDefinition<CryptoManagerCfgClient, CryptoManagerCfg> { 068 069 // The singleton configuration definition instance. 070 private static final CryptoManagerCfgDefn INSTANCE = new CryptoManagerCfgDefn(); 071 072 073 074 // The "cipher-key-length" property definition. 075 private static final IntegerPropertyDefinition PD_CIPHER_KEY_LENGTH; 076 077 078 079 // The "cipher-transformation" property definition. 080 private static final StringPropertyDefinition PD_CIPHER_TRANSFORMATION; 081 082 083 084 // The "digest-algorithm" property definition. 085 private static final StringPropertyDefinition PD_DIGEST_ALGORITHM; 086 087 088 089 // The "key-wrapping-transformation" property definition. 090 private static final StringPropertyDefinition PD_KEY_WRAPPING_TRANSFORMATION; 091 092 093 094 // The "mac-algorithm" property definition. 095 private static final StringPropertyDefinition PD_MAC_ALGORITHM; 096 097 098 099 // The "mac-key-length" property definition. 100 private static final IntegerPropertyDefinition PD_MAC_KEY_LENGTH; 101 102 103 104 // The "ssl-cert-nickname" property definition. 105 private static final StringPropertyDefinition PD_SSL_CERT_NICKNAME; 106 107 108 109 // The "ssl-cipher-suite" property definition. 110 private static final StringPropertyDefinition PD_SSL_CIPHER_SUITE; 111 112 113 114 // The "ssl-encryption" property definition. 115 private static final BooleanPropertyDefinition PD_SSL_ENCRYPTION; 116 117 118 119 // The "ssl-protocol" property definition. 120 private static final StringPropertyDefinition PD_SSL_PROTOCOL; 121 122 123 124 // Build the "cipher-key-length" property definition. 125 static { 126 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "cipher-key-length"); 127 builder.setOption(PropertyOption.ADVANCED); 128 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "cipher-key-length")); 129 DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("128"); 130 builder.setDefaultBehaviorProvider(provider); 131 PD_CIPHER_KEY_LENGTH = builder.getInstance(); 132 INSTANCE.registerPropertyDefinition(PD_CIPHER_KEY_LENGTH); 133 } 134 135 136 137 // Build the "cipher-transformation" property definition. 138 static { 139 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "cipher-transformation"); 140 builder.setOption(PropertyOption.ADVANCED); 141 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "cipher-transformation")); 142 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("AES/CBC/PKCS5Padding"); 143 builder.setDefaultBehaviorProvider(provider); 144 PD_CIPHER_TRANSFORMATION = builder.getInstance(); 145 INSTANCE.registerPropertyDefinition(PD_CIPHER_TRANSFORMATION); 146 } 147 148 149 150 // Build the "digest-algorithm" property definition. 151 static { 152 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "digest-algorithm"); 153 builder.setOption(PropertyOption.ADVANCED); 154 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "digest-algorithm")); 155 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("SHA-1"); 156 builder.setDefaultBehaviorProvider(provider); 157 PD_DIGEST_ALGORITHM = builder.getInstance(); 158 INSTANCE.registerPropertyDefinition(PD_DIGEST_ALGORITHM); 159 } 160 161 162 163 // Build the "key-wrapping-transformation" property definition. 164 static { 165 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "key-wrapping-transformation"); 166 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "key-wrapping-transformation")); 167 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("RSA/ECB/OAEPWITHSHA-1ANDMGF1PADDING"); 168 builder.setDefaultBehaviorProvider(provider); 169 PD_KEY_WRAPPING_TRANSFORMATION = builder.getInstance(); 170 INSTANCE.registerPropertyDefinition(PD_KEY_WRAPPING_TRANSFORMATION); 171 } 172 173 174 175 // Build the "mac-algorithm" property definition. 176 static { 177 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "mac-algorithm"); 178 builder.setOption(PropertyOption.ADVANCED); 179 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mac-algorithm")); 180 DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("HmacSHA1"); 181 builder.setDefaultBehaviorProvider(provider); 182 PD_MAC_ALGORITHM = builder.getInstance(); 183 INSTANCE.registerPropertyDefinition(PD_MAC_ALGORITHM); 184 } 185 186 187 188 // Build the "mac-key-length" property definition. 189 static { 190 IntegerPropertyDefinition.Builder builder = IntegerPropertyDefinition.createBuilder(INSTANCE, "mac-key-length"); 191 builder.setOption(PropertyOption.ADVANCED); 192 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "mac-key-length")); 193 DefaultBehaviorProvider<Integer> provider = new DefinedDefaultBehaviorProvider<Integer>("128"); 194 builder.setDefaultBehaviorProvider(provider); 195 PD_MAC_KEY_LENGTH = builder.getInstance(); 196 INSTANCE.registerPropertyDefinition(PD_MAC_KEY_LENGTH); 197 } 198 199 200 201 // Build the "ssl-cert-nickname" property definition. 202 static { 203 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-cert-nickname"); 204 builder.setOption(PropertyOption.MULTI_VALUED); 205 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "ssl-cert-nickname")); 206 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cert-nickname")); 207 PD_SSL_CERT_NICKNAME = builder.getInstance(); 208 INSTANCE.registerPropertyDefinition(PD_SSL_CERT_NICKNAME); 209 } 210 211 212 213 // Build the "ssl-cipher-suite" property definition. 214 static { 215 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-cipher-suite"); 216 builder.setOption(PropertyOption.MULTI_VALUED); 217 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-cipher-suite")); 218 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-cipher-suite")); 219 PD_SSL_CIPHER_SUITE = builder.getInstance(); 220 INSTANCE.registerPropertyDefinition(PD_SSL_CIPHER_SUITE); 221 } 222 223 224 225 // Build the "ssl-encryption" property definition. 226 static { 227 BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "ssl-encryption"); 228 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-encryption")); 229 DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false"); 230 builder.setDefaultBehaviorProvider(provider); 231 PD_SSL_ENCRYPTION = builder.getInstance(); 232 INSTANCE.registerPropertyDefinition(PD_SSL_ENCRYPTION); 233 } 234 235 236 237 // Build the "ssl-protocol" property definition. 238 static { 239 StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "ssl-protocol"); 240 builder.setOption(PropertyOption.MULTI_VALUED); 241 builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "ssl-protocol")); 242 builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<String>(INSTANCE, "ssl-protocol")); 243 PD_SSL_PROTOCOL = builder.getInstance(); 244 INSTANCE.registerPropertyDefinition(PD_SSL_PROTOCOL); 245 } 246 247 248 249 // Register the tags associated with this managed object definition. 250 static { 251 INSTANCE.registerTag(Tag.valueOf("security")); 252 } 253 254 255 256 /** 257 * Get the Crypto Manager configuration definition singleton. 258 * 259 * @return Returns the Crypto Manager configuration definition 260 * singleton. 261 */ 262 public static CryptoManagerCfgDefn getInstance() { 263 return INSTANCE; 264 } 265 266 267 268 /** 269 * Private constructor. 270 */ 271 private CryptoManagerCfgDefn() { 272 super("crypto-manager", TopCfgDefn.getInstance()); 273 } 274 275 276 277 /** 278 * {@inheritDoc} 279 */ 280 public CryptoManagerCfgClient createClientConfiguration( 281 ManagedObject<? extends CryptoManagerCfgClient> impl) { 282 return new CryptoManagerCfgClientImpl(impl); 283 } 284 285 286 287 /** 288 * {@inheritDoc} 289 */ 290 public CryptoManagerCfg createServerConfiguration( 291 ServerManagedObject<? extends CryptoManagerCfg> impl) { 292 return new CryptoManagerCfgServerImpl(impl); 293 } 294 295 296 297 /** 298 * {@inheritDoc} 299 */ 300 public Class<CryptoManagerCfg> getServerConfigurationClass() { 301 return CryptoManagerCfg.class; 302 } 303 304 305 306 /** 307 * Get the "cipher-key-length" property definition. 308 * <p> 309 * Specifies the key length in bits for the preferred cipher. 310 * 311 * @return Returns the "cipher-key-length" property definition. 312 */ 313 public IntegerPropertyDefinition getCipherKeyLengthPropertyDefinition() { 314 return PD_CIPHER_KEY_LENGTH; 315 } 316 317 318 319 /** 320 * Get the "cipher-transformation" property definition. 321 * <p> 322 * Specifies the cipher for the directory server using the syntax 323 * algorithm/mode/padding. 324 * <p> 325 * The full transformation is required: specifying only an algorithm 326 * and allowing the cipher provider to supply the default mode and 327 * padding is not supported, because there is no guarantee these 328 * default values are the same among different implementations. Some 329 * cipher algorithms, including RC4 and ARCFOUR, do not have a mode 330 * or padding, and hence must be specified using NONE for the mode 331 * field and NoPadding for the padding field. For example, 332 * RC4/NONE/NoPadding. 333 * 334 * @return Returns the "cipher-transformation" property definition. 335 */ 336 public StringPropertyDefinition getCipherTransformationPropertyDefinition() { 337 return PD_CIPHER_TRANSFORMATION; 338 } 339 340 341 342 /** 343 * Get the "digest-algorithm" property definition. 344 * <p> 345 * Specifies the preferred message digest algorithm for the 346 * directory server. 347 * 348 * @return Returns the "digest-algorithm" property definition. 349 */ 350 public StringPropertyDefinition getDigestAlgorithmPropertyDefinition() { 351 return PD_DIGEST_ALGORITHM; 352 } 353 354 355 356 /** 357 * Get the "key-wrapping-transformation" property definition. 358 * <p> 359 * The preferred key wrapping transformation for the directory 360 * server. This value must be the same for all server instances in a 361 * replication topology. 362 * 363 * @return Returns the "key-wrapping-transformation" property definition. 364 */ 365 public StringPropertyDefinition getKeyWrappingTransformationPropertyDefinition() { 366 return PD_KEY_WRAPPING_TRANSFORMATION; 367 } 368 369 370 371 /** 372 * Get the "mac-algorithm" property definition. 373 * <p> 374 * Specifies the preferred MAC algorithm for the directory server. 375 * 376 * @return Returns the "mac-algorithm" property definition. 377 */ 378 public StringPropertyDefinition getMacAlgorithmPropertyDefinition() { 379 return PD_MAC_ALGORITHM; 380 } 381 382 383 384 /** 385 * Get the "mac-key-length" property definition. 386 * <p> 387 * Specifies the key length in bits for the preferred MAC algorithm. 388 * 389 * @return Returns the "mac-key-length" property definition. 390 */ 391 public IntegerPropertyDefinition getMacKeyLengthPropertyDefinition() { 392 return PD_MAC_KEY_LENGTH; 393 } 394 395 396 397 /** 398 * Get the "ssl-cert-nickname" property definition. 399 * <p> 400 * Specifies the nicknames (also called the aliases) of the 401 * certificates that the Crypto Manager should use when performing 402 * SSL communication. The property can be used multiple times 403 * (referencing different nicknames) when an RSA, a DSA, and an ECC 404 * based server certificate is used in parallel. 405 * <p> 406 * This is only applicable when the Crypto Manager is configured to 407 * use SSL. 408 * 409 * @return Returns the "ssl-cert-nickname" property definition. 410 */ 411 public StringPropertyDefinition getSSLCertNicknamePropertyDefinition() { 412 return PD_SSL_CERT_NICKNAME; 413 } 414 415 416 417 /** 418 * Get the "ssl-cipher-suite" property definition. 419 * <p> 420 * Specifies the names of the SSL cipher suites that are allowed for 421 * use in SSL or TLS communication. 422 * 423 * @return Returns the "ssl-cipher-suite" property definition. 424 */ 425 public StringPropertyDefinition getSSLCipherSuitePropertyDefinition() { 426 return PD_SSL_CIPHER_SUITE; 427 } 428 429 430 431 /** 432 * Get the "ssl-encryption" property definition. 433 * <p> 434 * Specifies whether SSL/TLS is used to provide encrypted 435 * communication between two OpenDJ server components. 436 * 437 * @return Returns the "ssl-encryption" property definition. 438 */ 439 public BooleanPropertyDefinition getSSLEncryptionPropertyDefinition() { 440 return PD_SSL_ENCRYPTION; 441 } 442 443 444 445 /** 446 * Get the "ssl-protocol" property definition. 447 * <p> 448 * Specifies the names of the SSL protocols that are allowed for use 449 * in SSL or TLS communication. 450 * 451 * @return Returns the "ssl-protocol" property definition. 452 */ 453 public StringPropertyDefinition getSSLProtocolPropertyDefinition() { 454 return PD_SSL_PROTOCOL; 455 } 456 457 458 459 /** 460 * Managed object client implementation. 461 */ 462 private static class CryptoManagerCfgClientImpl implements 463 CryptoManagerCfgClient { 464 465 // Private implementation. 466 private ManagedObject<? extends CryptoManagerCfgClient> impl; 467 468 469 470 // Private constructor. 471 private CryptoManagerCfgClientImpl( 472 ManagedObject<? extends CryptoManagerCfgClient> impl) { 473 this.impl = impl; 474 } 475 476 477 478 /** 479 * {@inheritDoc} 480 */ 481 public int getCipherKeyLength() { 482 return impl.getPropertyValue(INSTANCE.getCipherKeyLengthPropertyDefinition()); 483 } 484 485 486 487 /** 488 * {@inheritDoc} 489 */ 490 public void setCipherKeyLength(Integer value) { 491 impl.setPropertyValue(INSTANCE.getCipherKeyLengthPropertyDefinition(), value); 492 } 493 494 495 496 /** 497 * {@inheritDoc} 498 */ 499 public String getCipherTransformation() { 500 return impl.getPropertyValue(INSTANCE.getCipherTransformationPropertyDefinition()); 501 } 502 503 504 505 /** 506 * {@inheritDoc} 507 */ 508 public void setCipherTransformation(String value) { 509 impl.setPropertyValue(INSTANCE.getCipherTransformationPropertyDefinition(), value); 510 } 511 512 513 514 /** 515 * {@inheritDoc} 516 */ 517 public String getDigestAlgorithm() { 518 return impl.getPropertyValue(INSTANCE.getDigestAlgorithmPropertyDefinition()); 519 } 520 521 522 523 /** 524 * {@inheritDoc} 525 */ 526 public void setDigestAlgorithm(String value) { 527 impl.setPropertyValue(INSTANCE.getDigestAlgorithmPropertyDefinition(), value); 528 } 529 530 531 532 /** 533 * {@inheritDoc} 534 */ 535 public String getKeyWrappingTransformation() { 536 return impl.getPropertyValue(INSTANCE.getKeyWrappingTransformationPropertyDefinition()); 537 } 538 539 540 541 /** 542 * {@inheritDoc} 543 */ 544 public void setKeyWrappingTransformation(String value) { 545 impl.setPropertyValue(INSTANCE.getKeyWrappingTransformationPropertyDefinition(), value); 546 } 547 548 549 550 /** 551 * {@inheritDoc} 552 */ 553 public String getMacAlgorithm() { 554 return impl.getPropertyValue(INSTANCE.getMacAlgorithmPropertyDefinition()); 555 } 556 557 558 559 /** 560 * {@inheritDoc} 561 */ 562 public void setMacAlgorithm(String value) { 563 impl.setPropertyValue(INSTANCE.getMacAlgorithmPropertyDefinition(), value); 564 } 565 566 567 568 /** 569 * {@inheritDoc} 570 */ 571 public int getMacKeyLength() { 572 return impl.getPropertyValue(INSTANCE.getMacKeyLengthPropertyDefinition()); 573 } 574 575 576 577 /** 578 * {@inheritDoc} 579 */ 580 public void setMacKeyLength(Integer value) { 581 impl.setPropertyValue(INSTANCE.getMacKeyLengthPropertyDefinition(), value); 582 } 583 584 585 586 /** 587 * {@inheritDoc} 588 */ 589 public SortedSet<String> getSSLCertNickname() { 590 return impl.getPropertyValues(INSTANCE.getSSLCertNicknamePropertyDefinition()); 591 } 592 593 594 595 /** 596 * {@inheritDoc} 597 */ 598 public void setSSLCertNickname(Collection<String> values) { 599 impl.setPropertyValues(INSTANCE.getSSLCertNicknamePropertyDefinition(), values); 600 } 601 602 603 604 /** 605 * {@inheritDoc} 606 */ 607 public SortedSet<String> getSSLCipherSuite() { 608 return impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 609 } 610 611 612 613 /** 614 * {@inheritDoc} 615 */ 616 public void setSSLCipherSuite(Collection<String> values) { 617 impl.setPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition(), values); 618 } 619 620 621 622 /** 623 * {@inheritDoc} 624 */ 625 public boolean isSSLEncryption() { 626 return impl.getPropertyValue(INSTANCE.getSSLEncryptionPropertyDefinition()); 627 } 628 629 630 631 /** 632 * {@inheritDoc} 633 */ 634 public void setSSLEncryption(Boolean value) { 635 impl.setPropertyValue(INSTANCE.getSSLEncryptionPropertyDefinition(), value); 636 } 637 638 639 640 /** 641 * {@inheritDoc} 642 */ 643 public SortedSet<String> getSSLProtocol() { 644 return impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 645 } 646 647 648 649 /** 650 * {@inheritDoc} 651 */ 652 public void setSSLProtocol(Collection<String> values) { 653 impl.setPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition(), values); 654 } 655 656 657 658 /** 659 * {@inheritDoc} 660 */ 661 public ManagedObjectDefinition<? extends CryptoManagerCfgClient, ? extends CryptoManagerCfg> definition() { 662 return INSTANCE; 663 } 664 665 666 667 /** 668 * {@inheritDoc} 669 */ 670 public PropertyProvider properties() { 671 return impl; 672 } 673 674 675 676 /** 677 * {@inheritDoc} 678 */ 679 public void commit() throws ManagedObjectAlreadyExistsException, 680 MissingMandatoryPropertiesException, ConcurrentModificationException, 681 OperationRejectedException, AuthorizationException, 682 CommunicationException { 683 impl.commit(); 684 } 685 686 687 688 /** {@inheritDoc} */ 689 public String toString() { 690 return impl.toString(); 691 } 692 } 693 694 695 696 /** 697 * Managed object server implementation. 698 */ 699 private static class CryptoManagerCfgServerImpl implements 700 CryptoManagerCfg { 701 702 // Private implementation. 703 private ServerManagedObject<? extends CryptoManagerCfg> impl; 704 705 // The value of the "cipher-key-length" property. 706 private final int pCipherKeyLength; 707 708 // The value of the "cipher-transformation" property. 709 private final String pCipherTransformation; 710 711 // The value of the "digest-algorithm" property. 712 private final String pDigestAlgorithm; 713 714 // The value of the "key-wrapping-transformation" property. 715 private final String pKeyWrappingTransformation; 716 717 // The value of the "mac-algorithm" property. 718 private final String pMacAlgorithm; 719 720 // The value of the "mac-key-length" property. 721 private final int pMacKeyLength; 722 723 // The value of the "ssl-cert-nickname" property. 724 private final SortedSet<String> pSSLCertNickname; 725 726 // The value of the "ssl-cipher-suite" property. 727 private final SortedSet<String> pSSLCipherSuite; 728 729 // The value of the "ssl-encryption" property. 730 private final boolean pSSLEncryption; 731 732 // The value of the "ssl-protocol" property. 733 private final SortedSet<String> pSSLProtocol; 734 735 736 737 // Private constructor. 738 private CryptoManagerCfgServerImpl(ServerManagedObject<? extends CryptoManagerCfg> impl) { 739 this.impl = impl; 740 this.pCipherKeyLength = impl.getPropertyValue(INSTANCE.getCipherKeyLengthPropertyDefinition()); 741 this.pCipherTransformation = impl.getPropertyValue(INSTANCE.getCipherTransformationPropertyDefinition()); 742 this.pDigestAlgorithm = impl.getPropertyValue(INSTANCE.getDigestAlgorithmPropertyDefinition()); 743 this.pKeyWrappingTransformation = impl.getPropertyValue(INSTANCE.getKeyWrappingTransformationPropertyDefinition()); 744 this.pMacAlgorithm = impl.getPropertyValue(INSTANCE.getMacAlgorithmPropertyDefinition()); 745 this.pMacKeyLength = impl.getPropertyValue(INSTANCE.getMacKeyLengthPropertyDefinition()); 746 this.pSSLCertNickname = impl.getPropertyValues(INSTANCE.getSSLCertNicknamePropertyDefinition()); 747 this.pSSLCipherSuite = impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 748 this.pSSLEncryption = impl.getPropertyValue(INSTANCE.getSSLEncryptionPropertyDefinition()); 749 this.pSSLProtocol = impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 750 } 751 752 753 754 /** 755 * {@inheritDoc} 756 */ 757 public void addChangeListener( 758 ConfigurationChangeListener<CryptoManagerCfg> listener) { 759 impl.registerChangeListener(listener); 760 } 761 762 763 764 /** 765 * {@inheritDoc} 766 */ 767 public void removeChangeListener( 768 ConfigurationChangeListener<CryptoManagerCfg> listener) { 769 impl.deregisterChangeListener(listener); 770 } 771 772 773 774 /** 775 * {@inheritDoc} 776 */ 777 public int getCipherKeyLength() { 778 return pCipherKeyLength; 779 } 780 781 782 783 /** 784 * {@inheritDoc} 785 */ 786 public String getCipherTransformation() { 787 return pCipherTransformation; 788 } 789 790 791 792 /** 793 * {@inheritDoc} 794 */ 795 public String getDigestAlgorithm() { 796 return pDigestAlgorithm; 797 } 798 799 800 801 /** 802 * {@inheritDoc} 803 */ 804 public String getKeyWrappingTransformation() { 805 return pKeyWrappingTransformation; 806 } 807 808 809 810 /** 811 * {@inheritDoc} 812 */ 813 public String getMacAlgorithm() { 814 return pMacAlgorithm; 815 } 816 817 818 819 /** 820 * {@inheritDoc} 821 */ 822 public int getMacKeyLength() { 823 return pMacKeyLength; 824 } 825 826 827 828 /** 829 * {@inheritDoc} 830 */ 831 public SortedSet<String> getSSLCertNickname() { 832 return pSSLCertNickname; 833 } 834 835 836 837 /** 838 * {@inheritDoc} 839 */ 840 public SortedSet<String> getSSLCipherSuite() { 841 return pSSLCipherSuite; 842 } 843 844 845 846 /** 847 * {@inheritDoc} 848 */ 849 public boolean isSSLEncryption() { 850 return pSSLEncryption; 851 } 852 853 854 855 /** 856 * {@inheritDoc} 857 */ 858 public SortedSet<String> getSSLProtocol() { 859 return pSSLProtocol; 860 } 861 862 863 864 /** 865 * {@inheritDoc} 866 */ 867 public Class<? extends CryptoManagerCfg> configurationClass() { 868 return CryptoManagerCfg.class; 869 } 870 871 872 873 /** 874 * {@inheritDoc} 875 */ 876 public DN dn() { 877 return impl.getDN(); 878 } 879 880 881 882 /** {@inheritDoc} */ 883 public String toString() { 884 return impl.toString(); 885 } 886 } 887}