package com.l7tech.server.secureconversation;

import com.l7tech.identity.User;
import com.l7tech.security.token.SecurityToken;
import com.l7tech.security.token.SecurityTokenType;
import com.l7tech.security.token.SessionSecurityToken;
import com.l7tech.security.xml.processor.SecurityContext;
import org.w3c.dom.Element;

public class SecureConversationSession implements SecurityContext, com.l7tech.security.xml.decorator.DecorationRequirements.SecureConversationSession {
   private final String a;
   private final byte[] b;
   private final byte[] c;
   private final byte[] d;
   private final long e;
   private final long f;
   private final User g;
   private final String h;
   private final Element i;
   private final SessionSecurityToken j;

   public SecureConversationSession(String var1, String var2, byte[] var3, long var4, long var6, User var8) {
      this(var1, var2, null, null, var3, var4, var6, var8, null);
   }

   public SecureConversationSession(String var1, String var2, byte[] var3, byte[] var4, byte[] var5, long var6, long var8, User var10, Element var11) {
      this.h = var1;
      this.a = var2;
      this.c = var3;
      this.d = var4;
      this.b = var5;
      this.f = var6;
      this.e = var8;
      this.g = var10;
      this.i = var11;
      this.j = new SessionSecurityToken(SecurityTokenType.WSSC_CONTEXT, var10.getProviderId(), var10.getId(), var10.getLogin());
   }

   public String getIdentifier() {
      return this.a;
   }

   public byte[] getSharedSecret() {
      return this.b;
   }

   public boolean hasEntropy() {
      return this.c != null && this.d != null;
   }

   public byte[] getClientEntropy() {
      return this.c;
   }

   public byte[] getServerEntropy() {
      return this.d;
   }

   public int getKeySize() {
      return this.b.length * 8;
   }

   public SecurityToken getSecurityToken() {
      return null;
   }

   public long getExpiration() {
      return this.e;
   }

   public long getCreation() {
      return this.f;
   }

   public User getUsedBy() {
      return this.g;
   }

   public String getSecConvNamespaceUsed() {
      return this.h;
   }

   public String getId() {
      return this.getIdentifier();
   }

   public byte[] getSecretKey() {
      return this.getSharedSecret();
   }

   public String getSCNamespace() {
      return this.getSecConvNamespaceUsed();
   }

   public Element getElement() {
      return this.i;
   }

   public SessionSecurityToken getCredentialSecurityToken() {
      return this.j;
   }
}
