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