package com.l7tech.policy.assertion;

import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.migration.Migration;
import com.l7tech.objectmodel.migration.MigrationMappingSelection;
import com.l7tech.objectmodel.migration.PropertyResolver;
import java.io.Serializable;

public class PrivateKeyableSupport implements OptionalPrivateKeyable, Serializable {
   private final boolean usesNoKeyAllowed;
   private boolean usesDefaultKeyStore = true;
   private Goid nonDefaultKeystoreId;
   private String keyAlias;
   private boolean usesNoKey = false;
   static final long serialVersionUID = 1865746157955615990L;

   public PrivateKeyableSupport() {
      this(false);
   }

   public PrivateKeyableSupport(boolean var1) {
      this.usesNoKeyAllowed = var1;
   }

   public PrivateKeyableSupport(PrivateKeyableSupport var1) {
      this(var1 != null && var1.isUsesNoKeyAllowed());
      if (var1 != null) {
         this.copyFrom(var1);
      }
   }

   @Override
   public String getKeyAlias() {
      return this.keyAlias;
   }

   @Override
   public void setKeyAlias(String var1) {
      this.keyAlias = var1;
   }

   @Migration(mapName = MigrationMappingSelection.REQUIRED, export = false, resolver = PropertyResolver.Type.SSGKEY)
   @Override
   public Goid getNonDefaultKeystoreId() {
      return this.nonDefaultKeystoreId;
   }

   @Override
   public void setNonDefaultKeystoreId(Goid var1) {
      this.nonDefaultKeystoreId = var1;
   }

   @Override
   public boolean isUsesDefaultKeyStore() {
      return this.usesDefaultKeyStore;
   }

   @Override
   public void setUsesDefaultKeyStore(boolean var1) {
      this.usesDefaultKeyStore = var1;
   }

   @Override
   public boolean isUsesNoKeyAllowed() {
      return this.usesNoKeyAllowed;
   }

   @Override
   public boolean isUsesNoKey() {
      return this.usesNoKey;
   }

   @Override
   public void setUsesNoKey(boolean var1) {
      this.usesNoKey = var1;
   }

   public void copyFrom(PrivateKeyableSupport var1) {
      this.usesDefaultKeyStore = var1.usesDefaultKeyStore;
      this.nonDefaultKeystoreId = var1.nonDefaultKeystoreId;
      this.keyAlias = var1.keyAlias;
      this.usesNoKey = var1.usesNoKey;
   }
}
