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