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.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 /** 277 * {@inheritDoc} 278 */ 279 public CryptoManagerCfgClient createClientConfiguration( 280 ManagedObject<? extends CryptoManagerCfgClient> impl) { 281 return new CryptoManagerCfgClientImpl(impl); 282 } 283 284 285 286 /** 287 * {@inheritDoc} 288 */ 289 public CryptoManagerCfg createServerConfiguration( 290 ServerManagedObject<? extends CryptoManagerCfg> impl) { 291 return new CryptoManagerCfgServerImpl(impl); 292 } 293 294 295 296 /** 297 * {@inheritDoc} 298 */ 299 public Class<CryptoManagerCfg> getServerConfigurationClass() { 300 return CryptoManagerCfg.class; 301 } 302 303 304 305 /** 306 * Get the "cipher-key-length" property definition. 307 * <p> 308 * Specifies the key length in bits for the preferred cipher. 309 * 310 * @return Returns the "cipher-key-length" property definition. 311 */ 312 public IntegerPropertyDefinition getCipherKeyLengthPropertyDefinition() { 313 return PD_CIPHER_KEY_LENGTH; 314 } 315 316 317 318 /** 319 * Get the "cipher-transformation" property definition. 320 * <p> 321 * Specifies the cipher for the directory server using the syntax 322 * algorithm/mode/padding. 323 * <p> 324 * The full transformation is required: specifying only an algorithm 325 * and allowing the cipher provider to supply the default mode and 326 * padding is not supported, because there is no guarantee these 327 * default values are the same among different implementations. Some 328 * cipher algorithms, including RC4 and ARCFOUR, do not have a mode 329 * or padding, and hence must be specified using NONE for the mode 330 * field and NoPadding for the padding field. For example, 331 * RC4/NONE/NoPadding. 332 * 333 * @return Returns the "cipher-transformation" property definition. 334 */ 335 public StringPropertyDefinition getCipherTransformationPropertyDefinition() { 336 return PD_CIPHER_TRANSFORMATION; 337 } 338 339 340 341 /** 342 * Get the "digest-algorithm" property definition. 343 * <p> 344 * Specifies the preferred message digest algorithm for the 345 * directory server. 346 * 347 * @return Returns the "digest-algorithm" property definition. 348 */ 349 public StringPropertyDefinition getDigestAlgorithmPropertyDefinition() { 350 return PD_DIGEST_ALGORITHM; 351 } 352 353 354 355 /** 356 * Get the "key-wrapping-transformation" property definition. 357 * <p> 358 * The preferred key wrapping transformation for the directory 359 * server. This value must be the same for all server instances in a 360 * replication topology. 361 * 362 * @return Returns the "key-wrapping-transformation" property definition. 363 */ 364 public StringPropertyDefinition getKeyWrappingTransformationPropertyDefinition() { 365 return PD_KEY_WRAPPING_TRANSFORMATION; 366 } 367 368 369 370 /** 371 * Get the "mac-algorithm" property definition. 372 * <p> 373 * Specifies the preferred MAC algorithm for the directory server. 374 * 375 * @return Returns the "mac-algorithm" property definition. 376 */ 377 public StringPropertyDefinition getMacAlgorithmPropertyDefinition() { 378 return PD_MAC_ALGORITHM; 379 } 380 381 382 383 /** 384 * Get the "mac-key-length" property definition. 385 * <p> 386 * Specifies the key length in bits for the preferred MAC algorithm. 387 * 388 * @return Returns the "mac-key-length" property definition. 389 */ 390 public IntegerPropertyDefinition getMacKeyLengthPropertyDefinition() { 391 return PD_MAC_KEY_LENGTH; 392 } 393 394 395 396 /** 397 * Get the "ssl-cert-nickname" property definition. 398 * <p> 399 * Specifies the nickname (also called the alias) of the certificate 400 * that the Crypto Manager should use when performing SSL 401 * communication. 402 * <p> 403 * This is only applicable when the Crypto Manager is configured to 404 * use SSL. 405 * 406 * @return Returns the "ssl-cert-nickname" property definition. 407 */ 408 public StringPropertyDefinition getSSLCertNicknamePropertyDefinition() { 409 return PD_SSL_CERT_NICKNAME; 410 } 411 412 413 414 /** 415 * Get the "ssl-cipher-suite" property definition. 416 * <p> 417 * Specifies the names of the SSL cipher suites that are allowed for 418 * use in SSL or TLS communication. 419 * 420 * @return Returns the "ssl-cipher-suite" property definition. 421 */ 422 public StringPropertyDefinition getSSLCipherSuitePropertyDefinition() { 423 return PD_SSL_CIPHER_SUITE; 424 } 425 426 427 428 /** 429 * Get the "ssl-encryption" property definition. 430 * <p> 431 * Specifies whether SSL/TLS is used to provide encrypted 432 * communication between two OpenDJ server components. 433 * 434 * @return Returns the "ssl-encryption" property definition. 435 */ 436 public BooleanPropertyDefinition getSSLEncryptionPropertyDefinition() { 437 return PD_SSL_ENCRYPTION; 438 } 439 440 441 442 /** 443 * Get the "ssl-protocol" property definition. 444 * <p> 445 * Specifies the names of the SSL protocols that are allowed for use 446 * in SSL or TLS communication. 447 * 448 * @return Returns the "ssl-protocol" property definition. 449 */ 450 public StringPropertyDefinition getSSLProtocolPropertyDefinition() { 451 return PD_SSL_PROTOCOL; 452 } 453 454 455 456 /** 457 * Managed object client implementation. 458 */ 459 private static class CryptoManagerCfgClientImpl implements 460 CryptoManagerCfgClient { 461 462 // Private implementation. 463 private ManagedObject<? extends CryptoManagerCfgClient> impl; 464 465 466 467 // Private constructor. 468 private CryptoManagerCfgClientImpl( 469 ManagedObject<? extends CryptoManagerCfgClient> impl) { 470 this.impl = impl; 471 } 472 473 474 475 /** 476 * {@inheritDoc} 477 */ 478 public int getCipherKeyLength() { 479 return impl.getPropertyValue(INSTANCE.getCipherKeyLengthPropertyDefinition()); 480 } 481 482 483 484 /** 485 * {@inheritDoc} 486 */ 487 public void setCipherKeyLength(Integer value) { 488 impl.setPropertyValue(INSTANCE.getCipherKeyLengthPropertyDefinition(), value); 489 } 490 491 492 493 /** 494 * {@inheritDoc} 495 */ 496 public String getCipherTransformation() { 497 return impl.getPropertyValue(INSTANCE.getCipherTransformationPropertyDefinition()); 498 } 499 500 501 502 /** 503 * {@inheritDoc} 504 */ 505 public void setCipherTransformation(String value) { 506 impl.setPropertyValue(INSTANCE.getCipherTransformationPropertyDefinition(), value); 507 } 508 509 510 511 /** 512 * {@inheritDoc} 513 */ 514 public String getDigestAlgorithm() { 515 return impl.getPropertyValue(INSTANCE.getDigestAlgorithmPropertyDefinition()); 516 } 517 518 519 520 /** 521 * {@inheritDoc} 522 */ 523 public void setDigestAlgorithm(String value) { 524 impl.setPropertyValue(INSTANCE.getDigestAlgorithmPropertyDefinition(), value); 525 } 526 527 528 529 /** 530 * {@inheritDoc} 531 */ 532 public String getKeyWrappingTransformation() { 533 return impl.getPropertyValue(INSTANCE.getKeyWrappingTransformationPropertyDefinition()); 534 } 535 536 537 538 /** 539 * {@inheritDoc} 540 */ 541 public void setKeyWrappingTransformation(String value) { 542 impl.setPropertyValue(INSTANCE.getKeyWrappingTransformationPropertyDefinition(), value); 543 } 544 545 546 547 /** 548 * {@inheritDoc} 549 */ 550 public String getMacAlgorithm() { 551 return impl.getPropertyValue(INSTANCE.getMacAlgorithmPropertyDefinition()); 552 } 553 554 555 556 /** 557 * {@inheritDoc} 558 */ 559 public void setMacAlgorithm(String value) { 560 impl.setPropertyValue(INSTANCE.getMacAlgorithmPropertyDefinition(), value); 561 } 562 563 564 565 /** 566 * {@inheritDoc} 567 */ 568 public int getMacKeyLength() { 569 return impl.getPropertyValue(INSTANCE.getMacKeyLengthPropertyDefinition()); 570 } 571 572 573 574 /** 575 * {@inheritDoc} 576 */ 577 public void setMacKeyLength(Integer value) { 578 impl.setPropertyValue(INSTANCE.getMacKeyLengthPropertyDefinition(), value); 579 } 580 581 582 583 /** 584 * {@inheritDoc} 585 */ 586 public String getSSLCertNickname() { 587 return impl.getPropertyValue(INSTANCE.getSSLCertNicknamePropertyDefinition()); 588 } 589 590 591 592 /** 593 * {@inheritDoc} 594 */ 595 public void setSSLCertNickname(String value) { 596 impl.setPropertyValue(INSTANCE.getSSLCertNicknamePropertyDefinition(), value); 597 } 598 599 600 601 /** 602 * {@inheritDoc} 603 */ 604 public SortedSet<String> getSSLCipherSuite() { 605 return impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 606 } 607 608 609 610 /** 611 * {@inheritDoc} 612 */ 613 public void setSSLCipherSuite(Collection<String> values) { 614 impl.setPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition(), values); 615 } 616 617 618 619 /** 620 * {@inheritDoc} 621 */ 622 public boolean isSSLEncryption() { 623 return impl.getPropertyValue(INSTANCE.getSSLEncryptionPropertyDefinition()); 624 } 625 626 627 628 /** 629 * {@inheritDoc} 630 */ 631 public void setSSLEncryption(Boolean value) { 632 impl.setPropertyValue(INSTANCE.getSSLEncryptionPropertyDefinition(), value); 633 } 634 635 636 637 /** 638 * {@inheritDoc} 639 */ 640 public SortedSet<String> getSSLProtocol() { 641 return impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 642 } 643 644 645 646 /** 647 * {@inheritDoc} 648 */ 649 public void setSSLProtocol(Collection<String> values) { 650 impl.setPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition(), values); 651 } 652 653 654 655 /** 656 * {@inheritDoc} 657 */ 658 public ManagedObjectDefinition<? extends CryptoManagerCfgClient, ? extends CryptoManagerCfg> definition() { 659 return INSTANCE; 660 } 661 662 663 664 /** 665 * {@inheritDoc} 666 */ 667 public PropertyProvider properties() { 668 return impl; 669 } 670 671 672 673 /** 674 * {@inheritDoc} 675 */ 676 public void commit() throws ManagedObjectAlreadyExistsException, 677 MissingMandatoryPropertiesException, ConcurrentModificationException, 678 OperationRejectedException, AuthorizationException, 679 CommunicationException { 680 impl.commit(); 681 } 682 683 } 684 685 686 687 /** 688 * Managed object server implementation. 689 */ 690 private static class CryptoManagerCfgServerImpl implements 691 CryptoManagerCfg { 692 693 // Private implementation. 694 private ServerManagedObject<? extends CryptoManagerCfg> impl; 695 696 // The value of the "cipher-key-length" property. 697 private final int pCipherKeyLength; 698 699 // The value of the "cipher-transformation" property. 700 private final String pCipherTransformation; 701 702 // The value of the "digest-algorithm" property. 703 private final String pDigestAlgorithm; 704 705 // The value of the "key-wrapping-transformation" property. 706 private final String pKeyWrappingTransformation; 707 708 // The value of the "mac-algorithm" property. 709 private final String pMacAlgorithm; 710 711 // The value of the "mac-key-length" property. 712 private final int pMacKeyLength; 713 714 // The value of the "ssl-cert-nickname" property. 715 private final String pSSLCertNickname; 716 717 // The value of the "ssl-cipher-suite" property. 718 private final SortedSet<String> pSSLCipherSuite; 719 720 // The value of the "ssl-encryption" property. 721 private final boolean pSSLEncryption; 722 723 // The value of the "ssl-protocol" property. 724 private final SortedSet<String> pSSLProtocol; 725 726 727 728 // Private constructor. 729 private CryptoManagerCfgServerImpl(ServerManagedObject<? extends CryptoManagerCfg> impl) { 730 this.impl = impl; 731 this.pCipherKeyLength = impl.getPropertyValue(INSTANCE.getCipherKeyLengthPropertyDefinition()); 732 this.pCipherTransformation = impl.getPropertyValue(INSTANCE.getCipherTransformationPropertyDefinition()); 733 this.pDigestAlgorithm = impl.getPropertyValue(INSTANCE.getDigestAlgorithmPropertyDefinition()); 734 this.pKeyWrappingTransformation = impl.getPropertyValue(INSTANCE.getKeyWrappingTransformationPropertyDefinition()); 735 this.pMacAlgorithm = impl.getPropertyValue(INSTANCE.getMacAlgorithmPropertyDefinition()); 736 this.pMacKeyLength = impl.getPropertyValue(INSTANCE.getMacKeyLengthPropertyDefinition()); 737 this.pSSLCertNickname = impl.getPropertyValue(INSTANCE.getSSLCertNicknamePropertyDefinition()); 738 this.pSSLCipherSuite = impl.getPropertyValues(INSTANCE.getSSLCipherSuitePropertyDefinition()); 739 this.pSSLEncryption = impl.getPropertyValue(INSTANCE.getSSLEncryptionPropertyDefinition()); 740 this.pSSLProtocol = impl.getPropertyValues(INSTANCE.getSSLProtocolPropertyDefinition()); 741 } 742 743 744 745 /** 746 * {@inheritDoc} 747 */ 748 public void addChangeListener( 749 ConfigurationChangeListener<CryptoManagerCfg> listener) { 750 impl.registerChangeListener(listener); 751 } 752 753 754 755 /** 756 * {@inheritDoc} 757 */ 758 public void removeChangeListener( 759 ConfigurationChangeListener<CryptoManagerCfg> listener) { 760 impl.deregisterChangeListener(listener); 761 } 762 763 764 765 /** 766 * {@inheritDoc} 767 */ 768 public int getCipherKeyLength() { 769 return pCipherKeyLength; 770 } 771 772 773 774 /** 775 * {@inheritDoc} 776 */ 777 public String getCipherTransformation() { 778 return pCipherTransformation; 779 } 780 781 782 783 /** 784 * {@inheritDoc} 785 */ 786 public String getDigestAlgorithm() { 787 return pDigestAlgorithm; 788 } 789 790 791 792 /** 793 * {@inheritDoc} 794 */ 795 public String getKeyWrappingTransformation() { 796 return pKeyWrappingTransformation; 797 } 798 799 800 801 /** 802 * {@inheritDoc} 803 */ 804 public String getMacAlgorithm() { 805 return pMacAlgorithm; 806 } 807 808 809 810 /** 811 * {@inheritDoc} 812 */ 813 public int getMacKeyLength() { 814 return pMacKeyLength; 815 } 816 817 818 819 /** 820 * {@inheritDoc} 821 */ 822 public String getSSLCertNickname() { 823 return pSSLCertNickname; 824 } 825 826 827 828 /** 829 * {@inheritDoc} 830 */ 831 public SortedSet<String> getSSLCipherSuite() { 832 return pSSLCipherSuite; 833 } 834 835 836 837 /** 838 * {@inheritDoc} 839 */ 840 public boolean isSSLEncryption() { 841 return pSSLEncryption; 842 } 843 844 845 846 /** 847 * {@inheritDoc} 848 */ 849 public SortedSet<String> getSSLProtocol() { 850 return pSSLProtocol; 851 } 852 853 854 855 /** 856 * {@inheritDoc} 857 */ 858 public Class<? extends CryptoManagerCfg> configurationClass() { 859 return CryptoManagerCfg.class; 860 } 861 862 863 864 /** 865 * {@inheritDoc} 866 */ 867 public DN dn() { 868 return impl.getDN(); 869 } 870 871 } 872}