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