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