jce

16:37:18.483 INFO  jd.cli.Main - Decompiling jce.jar
package javax.crypto.interfaces;

import javax.crypto.spec.DHParameterSpec;

public abstract interface DHKey
{
  public abstract DHParameterSpec getParams();
}

/* Location:
 * Qualified Name:     javax.crypto.interfaces.DHKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.interfaces;

import java.math.BigInteger;
import java.security.PublicKey;

public abstract interface DHPublicKey
  extends DHKey, PublicKey
{
  public static final long serialVersionUID = -6628103563352519193L;
  
  public abstract BigInteger getY();
}

/* Location:
 * Qualified Name:     javax.crypto.interfaces.DHPublicKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.interfaces;

import java.math.BigInteger;
import java.security.PrivateKey;

public abstract interface DHPrivateKey
  extends DHKey, PrivateKey
{
  public static final long serialVersionUID = 2211791113380396553L;
  
  public abstract BigInteger getX();
}

/* Location:
 * Qualified Name:     javax.crypto.interfaces.DHPrivateKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.interfaces;

import javax.crypto.SecretKey;

public abstract interface PBEKey
  extends SecretKey
{
  public static final long serialVersionUID = -1430015993304333921L;
  
  public abstract char[] getPassword();
  
  public abstract byte[] getSalt();
  
  public abstract int getIterationCount();
}

/* Location:
 * Qualified Name:     javax.crypto.interfaces.PBEKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto;

import java.security.Key;

public abstract interface SecretKey
  extends Key
{
  public static final long serialVersionUID = -4795878709595146952L;
}

/* Location:
 * Qualified Name:     javax.crypto.SecretKey
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.math.BigInteger;
import java.security.spec.AlgorithmParameterSpec;

public class DHParameterSpec
  implements AlgorithmParameterSpec
{
  private BigInteger a;
  private BigInteger b;
  private int c;
  
  public DHParameterSpec(BigInteger paramBigInteger1, BigInteger paramBigInteger2)
  {
    a = paramBigInteger1;
    b = paramBigInteger2;
    c = 0;
  }
  
  public DHParameterSpec(BigInteger paramBigInteger1, BigInteger paramBigInteger2, int paramInt)
  {
    a = paramBigInteger1;
    b = paramBigInteger2;
    c = paramInt;
  }
  
  public BigInteger getP()
  {
    return a;
  }
  
  public BigInteger getG()
  {
    return b;
  }
  
  public int getL()
  {
    return c;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.DHParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.InvalidKeyException;
import java.security.spec.KeySpec;

public class DESKeySpec
  implements KeySpec
{
  public static final int DES_KEY_LEN = 8;
  private byte[] a;
  private static final byte[][] b = { { 1, 1, 1, 1, 1, 1, 1, 1 }, { -2, -2, -2, -2, -2, -2, -2, -2 }, { 31, 31, 31, 31, 14, 14, 14, 14 }, { -32, -32, -32, -32, -15, -15, -15, -15 }, { 1, -2, 1, -2, 1, -2, 1, -2 }, { 31, -32, 31, -32, 14, -15, 14, -15 }, { 1, -32, 1, -32, 1, -15, 1, -15 }, { 31, -2, 31, -2, 14, -2, 14, -2 }, { 1, 31, 1, 31, 1, 14, 1, 14 }, { -32, -2, -32, -2, -15, -2, -15, -2 }, { -2, 1, -2, 1, -2, 1, -2, 1 }, { -32, 31, -32, 31, -15, 14, -15, 14 }, { -32, 1, -32, 1, -15, 1, -15, 1 }, { -2, 31, -2, 31, -2, 14, -2, 14 }, { 31, 1, 31, 1, 14, 1, 14, 1 }, { -2, -32, -2, -32, -2, -15, -2, -15 } };
  
  public DESKeySpec(byte[] paramArrayOfByte)
    throws InvalidKeyException
  {
    this(paramArrayOfByte, 0);
  }
  
  public DESKeySpec(byte[] paramArrayOfByte, int paramInt)
    throws InvalidKeyException
  {
    if (paramArrayOfByte.length - paramInt < 8) {
      throw new InvalidKeyException("Wrong key size");
    }
    a = new byte[8];
    System.arraycopy(paramArrayOfByte, paramInt, a, 0, 8);
  }
  
  public byte[] getKey()
  {
    return (byte[])a.clone();
  }
  
  public static boolean isParityAdjusted(byte[] paramArrayOfByte, int paramInt)
    throws InvalidKeyException
  {
    if (paramArrayOfByte == null) {
      throw new InvalidKeyException("null key");
    }
    if (paramArrayOfByte.length - paramInt < 8) {
      throw new InvalidKeyException("Wrong key size");
    }
    for (int i = 0; i < 8; i++)
    {
      int j = Integer.bitCount(paramArrayOfByte[(paramInt++)] & 0xFF);
      if ((j & 0x1) == 0) {
        return false;
      }
    }
    return true;
  }
  
  public static boolean isWeak(byte[] paramArrayOfByte, int paramInt)
    throws InvalidKeyException
  {
    if (paramArrayOfByte == null) {
      throw new InvalidKeyException("null key");
    }
    if (paramArrayOfByte.length - paramInt < 8) {
      throw new InvalidKeyException("Wrong key size");
    }
    for (int i = 0; i < b.length; i++)
    {
      boolean bool = true;
      for (int j = 0; (j < 8) && (bool == true); j++) {
        if (b[i][j] != paramArrayOfByte[(j + paramInt)]) {
          bool = false;
        }
      }
      if (bool == true) {
        return bool;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.DESKeySpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.AlgorithmParameterSpec;

public class IvParameterSpec
  implements AlgorithmParameterSpec
{
  private byte[] a;
  
  public IvParameterSpec(byte[] paramArrayOfByte)
  {
    this(paramArrayOfByte, 0, paramArrayOfByte.length);
  }
  
  public IvParameterSpec(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    if (paramArrayOfByte == null) {
      throw new IllegalArgumentException("IV missing");
    }
    if (paramArrayOfByte.length - paramInt1 < paramInt2) {
      throw new IllegalArgumentException("IV buffer too short for given offset/length combination");
    }
    if (paramInt2 < 0) {
      throw new ArrayIndexOutOfBoundsException("len is negative");
    }
    a = new byte[paramInt2];
    System.arraycopy(paramArrayOfByte, paramInt1, a, 0, paramInt2);
  }
  
  public byte[] getIV()
  {
    return (byte[])a.clone();
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.IvParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.AlgorithmParameterSpec;
import java.util.Arrays;

public class RC2ParameterSpec
  implements AlgorithmParameterSpec
{
  private byte[] a = null;
  private int b;
  
  public RC2ParameterSpec(int paramInt)
  {
    b = paramInt;
  }
  
  public RC2ParameterSpec(int paramInt, byte[] paramArrayOfByte)
  {
    this(paramInt, paramArrayOfByte, 0);
  }
  
  public RC2ParameterSpec(int paramInt1, byte[] paramArrayOfByte, int paramInt2)
  {
    b = paramInt1;
    if (paramArrayOfByte == null) {
      throw new IllegalArgumentException("IV missing");
    }
    int i = 8;
    if (paramArrayOfByte.length - paramInt2 < i) {
      throw new IllegalArgumentException("IV too short");
    }
    a = new byte[i];
    System.arraycopy(paramArrayOfByte, paramInt2, a, 0, i);
  }
  
  public int getEffectiveKeyBits()
  {
    return b;
  }
  
  public byte[] getIV()
  {
    return a == null ? null : (byte[])a.clone();
  }
  
  public boolean equals(Object paramObject)
  {
    if (paramObject == this) {
      return true;
    }
    if (!(paramObject instanceof RC2ParameterSpec)) {
      return false;
    }
    RC2ParameterSpec localRC2ParameterSpec = (RC2ParameterSpec)paramObject;
    return (b == b) && (Arrays.equals(a, a));
  }
  
  public int hashCode()
  {
    int i = 0;
    if (a != null) {
      for (int j = 1; j < a.length; j++) {
        i += a[j] * j;
      }
    }
    return i += b;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.RC2ParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.AlgorithmParameterSpec;
import java.util.Arrays;

public class RC5ParameterSpec
  implements AlgorithmParameterSpec
{
  private byte[] a = null;
  private int b;
  private int c;
  private int d;
  
  public RC5ParameterSpec(int paramInt1, int paramInt2, int paramInt3)
  {
    b = paramInt1;
    c = paramInt2;
    d = paramInt3;
  }
  
  public RC5ParameterSpec(int paramInt1, int paramInt2, int paramInt3, byte[] paramArrayOfByte)
  {
    this(paramInt1, paramInt2, paramInt3, paramArrayOfByte, 0);
  }
  
  public RC5ParameterSpec(int paramInt1, int paramInt2, int paramInt3, byte[] paramArrayOfByte, int paramInt4)
  {
    b = paramInt1;
    c = paramInt2;
    d = paramInt3;
    if (paramArrayOfByte == null) {
      throw new IllegalArgumentException("IV missing");
    }
    int i = paramInt3 / 8 * 2;
    if (paramArrayOfByte.length - paramInt4 < i) {
      throw new IllegalArgumentException("IV too short");
    }
    a = new byte[i];
    System.arraycopy(paramArrayOfByte, paramInt4, a, 0, i);
  }
  
  public int getVersion()
  {
    return b;
  }
  
  public int getRounds()
  {
    return c;
  }
  
  public int getWordSize()
  {
    return d;
  }
  
  public byte[] getIV()
  {
    return a == null ? null : (byte[])a.clone();
  }
  
  public boolean equals(Object paramObject)
  {
    if (paramObject == this) {
      return true;
    }
    if (!(paramObject instanceof RC5ParameterSpec)) {
      return false;
    }
    RC5ParameterSpec localRC5ParameterSpec = (RC5ParameterSpec)paramObject;
    return (b == b) && (c == c) && (d == d) && (Arrays.equals(a, a));
  }
  
  public int hashCode()
  {
    int i = 0;
    if (a != null) {
      for (int j = 1; j < a.length; j++) {
        i += a[j] * j;
      }
    }
    i += b + c + d;
    return i;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.RC5ParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.InvalidKeyException;
import java.security.spec.KeySpec;

public class DESedeKeySpec
  implements KeySpec
{
  public static final int DES_EDE_KEY_LEN = 24;
  private byte[] a;
  
  public DESedeKeySpec(byte[] paramArrayOfByte)
    throws InvalidKeyException
  {
    this(paramArrayOfByte, 0);
  }
  
  public DESedeKeySpec(byte[] paramArrayOfByte, int paramInt)
    throws InvalidKeyException
  {
    if (paramArrayOfByte.length - paramInt < 24) {
      throw new InvalidKeyException("Wrong key size");
    }
    a = new byte[24];
    System.arraycopy(paramArrayOfByte, paramInt, a, 0, 24);
  }
  
  public byte[] getKey()
  {
    return (byte[])a.clone();
  }
  
  public static boolean isParityAdjusted(byte[] paramArrayOfByte, int paramInt)
    throws InvalidKeyException
  {
    if (paramArrayOfByte.length - paramInt < 24) {
      throw new InvalidKeyException("Wrong key size");
    }
    return (DESKeySpec.isParityAdjusted(paramArrayOfByte, paramInt)) && (DESKeySpec.isParityAdjusted(paramArrayOfByte, paramInt + 8)) && (DESKeySpec.isParityAdjusted(paramArrayOfByte, paramInt + 16));
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.DESedeKeySpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.AlgorithmParameterSpec;

public class DHGenParameterSpec
  implements AlgorithmParameterSpec
{
  private int a;
  private int b;
  
  public DHGenParameterSpec(int paramInt1, int paramInt2)
  {
    a = paramInt1;
    b = paramInt2;
  }
  
  public int getPrimeSize()
  {
    return a;
  }
  
  public int getExponentSize()
  {
    return b;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.DHGenParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.math.BigInteger;
import java.security.spec.KeySpec;

public class DHPrivateKeySpec
  implements KeySpec
{
  private BigInteger a;
  private BigInteger b;
  private BigInteger c;
  
  public DHPrivateKeySpec(BigInteger paramBigInteger1, BigInteger paramBigInteger2, BigInteger paramBigInteger3)
  {
    a = paramBigInteger1;
    b = paramBigInteger2;
    c = paramBigInteger3;
  }
  
  public BigInteger getX()
  {
    return a;
  }
  
  public BigInteger getP()
  {
    return b;
  }
  
  public BigInteger getG()
  {
    return c;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.DHPrivateKeySpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.math.BigInteger;
import java.security.spec.KeySpec;

public class DHPublicKeySpec
  implements KeySpec
{
  private BigInteger a;
  private BigInteger b;
  private BigInteger c;
  
  public DHPublicKeySpec(BigInteger paramBigInteger1, BigInteger paramBigInteger2, BigInteger paramBigInteger3)
  {
    a = paramBigInteger1;
    b = paramBigInteger2;
    c = paramBigInteger3;
  }
  
  public BigInteger getY()
  {
    return a;
  }
  
  public BigInteger getP()
  {
    return b;
  }
  
  public BigInteger getG()
  {
    return c;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.DHPublicKeySpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.KeySpec;

public class PBEKeySpec
  implements KeySpec
{
  private char[] a;
  private byte[] b = null;
  private int c = 0;
  private int d = 0;
  
  public PBEKeySpec(char[] paramArrayOfChar)
  {
    if ((paramArrayOfChar == null) || (paramArrayOfChar.length == 0)) {
      a = new char[0];
    } else {
      a = ((char[])paramArrayOfChar.clone());
    }
  }
  
  public PBEKeySpec(char[] paramArrayOfChar, byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    if ((paramArrayOfChar == null) || (paramArrayOfChar.length == 0)) {
      a = new char[0];
    } else {
      a = ((char[])paramArrayOfChar.clone());
    }
    if (paramArrayOfByte == null) {
      throw new NullPointerException("the salt parameter must be non-null");
    }
    if (paramArrayOfByte.length == 0) {
      throw new IllegalArgumentException("the salt parameter must not be empty");
    }
    b = ((byte[])paramArrayOfByte.clone());
    if (paramInt1 <= 0) {
      throw new IllegalArgumentException("invalid iterationCount value");
    }
    if (paramInt2 <= 0) {
      throw new IllegalArgumentException("invalid keyLength value");
    }
    c = paramInt1;
    d = paramInt2;
  }
  
  public PBEKeySpec(char[] paramArrayOfChar, byte[] paramArrayOfByte, int paramInt)
  {
    if ((paramArrayOfChar == null) || (paramArrayOfChar.length == 0)) {
      a = new char[0];
    } else {
      a = ((char[])paramArrayOfChar.clone());
    }
    if (paramArrayOfByte == null) {
      throw new NullPointerException("the salt parameter must be non-null");
    }
    if (paramArrayOfByte.length == 0) {
      throw new IllegalArgumentException("the salt parameter must not be empty");
    }
    b = ((byte[])paramArrayOfByte.clone());
    if (paramInt <= 0) {
      throw new IllegalArgumentException("invalid iterationCount value");
    }
    c = paramInt;
  }
  
  public final void clearPassword()
  {
    if (a != null)
    {
      for (int i = 0; i < a.length; i++) {
        a[i] = ' ';
      }
      a = null;
    }
  }
  
  public final char[] getPassword()
  {
    if (a == null) {
      throw new IllegalStateException("password has been cleared");
    }
    return (char[])a.clone();
  }
  
  public final byte[] getSalt()
  {
    if (b != null) {
      return (byte[])b.clone();
    }
    return null;
  }
  
  public final int getIterationCount()
  {
    return c;
  }
  
  public final int getKeyLength()
  {
    return d;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.PBEKeySpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.AlgorithmParameterSpec;

public class PBEParameterSpec
  implements AlgorithmParameterSpec
{
  private byte[] a;
  private int b;
  
  public PBEParameterSpec(byte[] paramArrayOfByte, int paramInt)
  {
    a = ((byte[])paramArrayOfByte.clone());
    b = paramInt;
  }
  
  public byte[] getSalt()
  {
    return (byte[])a.clone();
  }
  
  public int getIterationCount()
  {
    return b;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.PBEParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.Key;
import java.security.spec.KeySpec;
import java.util.Arrays;
import javax.crypto.SecretKey;

public class SecretKeySpec
  implements KeySpec, SecretKey
{
  private static final long serialVersionUID = 6577238317307289933L;
  private byte[] key;
  private String algorithm;
  
  public SecretKeySpec(byte[] paramArrayOfByte, String paramString)
  {
    if ((paramArrayOfByte == null) || (paramString == null)) {
      throw new IllegalArgumentException("Missing argument");
    }
    if (paramArrayOfByte.length == 0) {
      throw new IllegalArgumentException("Empty key");
    }
    key = ((byte[])paramArrayOfByte.clone());
    algorithm = paramString;
  }
  
  public SecretKeySpec(byte[] paramArrayOfByte, int paramInt1, int paramInt2, String paramString)
  {
    if ((paramArrayOfByte == null) || (paramString == null)) {
      throw new IllegalArgumentException("Missing argument");
    }
    if (paramArrayOfByte.length == 0) {
      throw new IllegalArgumentException("Empty key");
    }
    if (paramArrayOfByte.length - paramInt1 < paramInt2) {
      throw new IllegalArgumentException("Invalid offset/length combination");
    }
    if (paramInt2 < 0) {
      throw new ArrayIndexOutOfBoundsException("len is negative");
    }
    key = new byte[paramInt2];
    System.arraycopy(paramArrayOfByte, paramInt1, key, 0, paramInt2);
    algorithm = paramString;
  }
  
  public String getAlgorithm()
  {
    return algorithm;
  }
  
  public String getFormat()
  {
    return "RAW";
  }
  
  public byte[] getEncoded()
  {
    return (byte[])key.clone();
  }
  
  public int hashCode()
  {
    int i = 0;
    for (int j = 1; j < key.length; j++) {
      i += key[j] * j;
    }
    if (algorithm.equalsIgnoreCase("TripleDES")) {
      return i ^= "desede".hashCode();
    }
    return i ^= algorithm.toLowerCase().hashCode();
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {
      return true;
    }
    if (!(paramObject instanceof SecretKey)) {
      return false;
    }
    String str = ((SecretKey)paramObject).getAlgorithm();
    if ((!str.equalsIgnoreCase(algorithm)) && ((!str.equalsIgnoreCase("DESede")) || (!algorithm.equalsIgnoreCase("TripleDES"))) && ((!str.equalsIgnoreCase("TripleDES")) || (!algorithm.equalsIgnoreCase("DESede")))) {
      return false;
    }
    byte[] arrayOfByte = ((SecretKey)paramObject).getEncoded();
    return Arrays.equals(key, arrayOfByte);
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.SecretKeySpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

public final class PSource$PSpecified
  extends PSource
{
  private byte[] a = new byte[0];
  public static final PSpecified DEFAULT = new PSpecified(new byte[0]);
  
  public PSource$PSpecified(byte[] paramArrayOfByte)
  {
    super("PSpecified");
    a = ((byte[])paramArrayOfByte.clone());
  }
  
  public byte[] getValue()
  {
    return a.length == 0 ? a : (byte[])a.clone();
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.PSource.PSpecified
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

public class PSource
{
  private String a;
  
  protected PSource(String paramString)
  {
    if (paramString == null) {
      throw new NullPointerException("pSource algorithm is null");
    }
    a = paramString;
  }
  
  public String getAlgorithm()
  {
    return a;
  }
  
  public static final class PSpecified
    extends PSource
  {
    private byte[] a = new byte[0];
    public static final PSpecified DEFAULT = new PSpecified(new byte[0]);
    
    public PSpecified(byte[] paramArrayOfByte)
    {
      super();
      a = ((byte[])paramArrayOfByte.clone());
    }
    
    public byte[] getValue()
    {
      return a.length == 0 ? a : (byte[])a.clone();
    }
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.PSource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto.spec;

import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.MGF1ParameterSpec;

public class OAEPParameterSpec
  implements AlgorithmParameterSpec
{
  private String a = "SHA-1";
  private String b = "MGF1";
  private AlgorithmParameterSpec c = MGF1ParameterSpec.SHA1;
  private PSource d = PSource.PSpecified.DEFAULT;
  public static final OAEPParameterSpec DEFAULT = new OAEPParameterSpec();
  
  private OAEPParameterSpec() {}
  
  public OAEPParameterSpec(String paramString1, String paramString2, AlgorithmParameterSpec paramAlgorithmParameterSpec, PSource paramPSource)
  {
    if (paramString1 == null) {
      throw new NullPointerException("digest algorithm is null");
    }
    if (paramString2 == null) {
      throw new NullPointerException("mask generation function algorithm is null");
    }
    if (paramPSource == null) {
      throw new NullPointerException("source of the encoding input is null");
    }
    a = paramString1;
    b = paramString2;
    c = paramAlgorithmParameterSpec;
    d = paramPSource;
  }
  
  public String getDigestAlgorithm()
  {
    return a;
  }
  
  public String getMGFAlgorithm()
  {
    return b;
  }
  
  public AlgorithmParameterSpec getMGFParameters()
  {
    return c;
  }
  
  public PSource getPSource()
  {
    return d;
  }
}

/* Location:
 * Qualified Name:     javax.crypto.spec.OAEPParameterSpec
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.crypto;

import java.nio.ByteBuffer;
import java.nio.ReadOnlyBufferException;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.InvalidParameterException;
import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
import java.security.Provider.Service;
import java.security.ProviderException;
import java.security.SecureRandom;
import java.security.Security;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.InvalidParameterSpecException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.spec.RC2ParameterSpec;
import javax.crypto.spec.RC5ParameterSpec;
import sun.security.jca.GetInstance;
import sun.security.jca.ServiceId;
import sun.security.util.Debug;

public class Cipher
{
  private static final Debug a = Debug.getInstance("jca", "Cipher");
  public static final int ENCRYPT_MODE = 1;
  public static final int DECRYPT_MODE = 2;
  public static final int WRAP_MODE = 3;
  public static final int UNWRAP_MODE = 4;
  public static final int PUBLIC_KEY = 1;
  public static final int PRIVATE_KEY = 2;
  public static final int SECRET_KEY = 3;
  private Provider b;
  private CipherSpi c;
  private String d;
  private SunJCE_f e;
  private ExemptionMechanism f;
  private boolean g = false;
  private int h = 0;
  private static final String i = "2.5.29.15";
  private CipherSpi j;
  private Provider.Service k;
  private Iterator l;
  private List m;
  private final Object n;
  private static final String o = "SupportedModes";
  private static final String p = "SupportedPaddings";
  private static final int q = 0;
  private static final int r = 1;
  private static final int s = 2;
  private static int t = 10;
  private static final int u = 1;
  private static final int v = 2;
  private static final int w = 3;
  private static final int x = 4;
  
  protected Cipher(CipherSpi paramCipherSpi, Provider paramProvider, String paramString)
  {
    if (!SunJCE_h.f.a()) {
      throw new NullPointerException();
    }
    c = paramCipherSpi;
    b = paramProvider;
    d = paramString;
    e = SunJCE_k.b;
    n = null;
  }
  
  Cipher(CipherSpi paramCipherSpi, String paramString)
  {
    c = paramCipherSpi;
    d = paramString;
    e = SunJCE_k.b;
    n = null;
  }
  
  private Cipher(CipherSpi paramCipherSpi, Provider.Service paramService, Iterator paramIterator, String paramString, List paramList)
  {
    j = paramCipherSpi;
    k = paramService;
    l = paramIterator;
    m = paramList;
    d = paramString;
    n = new Object();
  }
  
  private static String[] a(String paramString)
    throws NoSuchAlgorithmException
  {
    if (paramString == null) {
      throw new NoSuchAlgorithmException("No transformation given");
    }
    String[] arrayOfString = new String[3];
    int i1 = 0;
    StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "/");
    try
    {
      while ((localStringTokenizer.hasMoreTokens()) && (i1 < 3)) {
        arrayOfString[(i1++)] = localStringTokenizer.nextToken().trim();
      }
      if ((i1 == 0) || (i1 == 2) || (localStringTokenizer.hasMoreTokens())) {
        throw new NoSuchAlgorithmException("Invalid transformation format:" + paramString);
      }
    }
    catch (NoSuchElementException localNoSuchElementException)
    {
      throw new NoSuchAlgorithmException("Invalid transformation format:" + paramString);
    }
    if ((arrayOfString[0] == null) || (arrayOfString[0].length() == 0)) {
      throw new NoSuchAlgorithmException("Invalid transformation:algorithm not specified-" + paramString);
    }
    return arrayOfString;
  }
  
  private static List b(String paramString)
    throws NoSuchAlgorithmException
  {
    String[] arrayOfString = a(paramString);
    String str1 = arrayOfString[0];
    String str2 = arrayOfString[1];
    String str3 = arrayOfString[2];
    if ((str2 != null) && (str2.length() == 0)) {
      str2 = null;
    }
    if ((str3 != null) && (str3.length() == 0)) {
      str3 = null;
    }
    if ((str2 == null) && (str3 == null))
    {
      localObject = new r(str1, "", null, null);
      return Collections.singletonList(localObject);
    }
    Object localObject = new ArrayList(4);
    ((List)localObject).add(new r(str1, "/" + str2 + "/" + str3, null, null));
    ((List)localObject).add(new r(str1, "/" + str2, null, str3));
    ((List)localObject).add(new r(str1, "//" + str3, str2, null));
    ((List)localObject).add(new r(str1, "", str2, str3));
    return (List)localObject;
  }
  
  private static r a(Provider.Service paramService, List paramList)
  {
    String str = paramService.getAlgorithm().toUpperCase(Locale.ENGLISH);
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      r localr = (r)localIterator.next();
      if (str.endsWith(b)) {
        return localr;
      }
    }
    return null;
  }
  
  public static final Cipher getInstance(String paramString)
    throws NoSuchAlgorithmException, NoSuchPaddingException
  {
    List localList = b(paramString);
    ArrayList localArrayList = new ArrayList(localList.size());
    Object localObject1 = localList.iterator();
    while (((Iterator)localObject1).hasNext())
    {
      localObject2 = (r)((Iterator)localObject1).next();
      localArrayList.add(new ServiceId("Cipher", a));
    }
    localObject1 = GetInstance.getServices(localArrayList);
    Object localObject2 = ((List)localObject1).iterator();
    Object localObject3 = null;
    while (((Iterator)localObject2).hasNext())
    {
      Provider.Service localService = (Provider.Service)((Iterator)localObject2).next();
      if (SunJCE_b.b(localService.getProvider()))
      {
        r localr = a(localService, localList);
        if (localr != null)
        {
          int i1 = localr.a(localService);
          if (i1 != 0)
          {
            if (i1 == 2) {
              return new Cipher(null, localService, (Iterator)localObject2, paramString, localList);
            }
            try
            {
              CipherSpi localCipherSpi = (CipherSpi)localService.newInstance(null);
              localr.a(localCipherSpi);
              return new Cipher(localCipherSpi, localService, (Iterator)localObject2, paramString, localList);
            }
            catch (Exception localException)
            {
              localObject3 = localException;
            }
          }
        }
      }
    }
    throw new NoSuchAlgorithmException("Cannot find any provider supporting " + paramString, (Throwable)localObject3);
  }
  
  public static final Cipher getInstance(String paramString1, String paramString2)
    throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException
  {
    if ((paramString2 == null) || (paramString2.length() == 0)) {
      throw new IllegalArgumentException("Missing provider");
    }
    Provider localProvider = Security.getProvider(paramString2);
    if (localProvider == null) {
      throw new NoSuchProviderException("No such provider: " + paramString2);
    }
    return getInstance(paramString1, localProvider);
  }
  
  public static final Cipher getInstance(String paramString, Provider paramProvider)
    throws NoSuchAlgorithmException, NoSuchPaddingException
  {
    if (paramProvider == null) {
      throw new IllegalArgumentException("Missing provider");
    }
    Object localObject1 = null;
    List localList = b(paramString);
    int i1 = 0;
    String str = null;
    Iterator localIterator = localList.iterator();
    while (localIterator.hasNext())
    {
      r localr = (r)localIterator.next();
      Provider.Service localService = paramProvider.getService("Cipher", a);
      if (localService != null)
      {
        Object localObject2;
        Object localObject3;
        if (i1 == 0)
        {
          localObject2 = SunJCE_b.a(paramProvider);
          if (localObject2 != null)
          {
            localObject3 = "JCE cannot authenticate the provider " + paramProvider.getName();
            throw new SecurityException((String)localObject3, (Throwable)localObject2);
          }
          i1 = 1;
        }
        if (localr.b(localService) != 0) {
          if (localr.c(localService) == 0) {
            str = d;
          } else {
            try
            {
              localObject2 = (CipherSpi)localService.newInstance(null);
              localr.a((CipherSpi)localObject2);
              localObject3 = new Cipher((CipherSpi)localObject2, paramString);
              b = localService.getProvider();
              ((Cipher)localObject3).b();
              return (Cipher)localObject3;
            }
            catch (Exception localException)
            {
              localObject1 = localException;
            }
          }
        }
      }
    }
    if ((localObject1 instanceof NoSuchPaddingException)) {
      throw ((NoSuchPaddingException)localObject1);
    }
    if (str != null) {
      throw new NoSuchPaddingException("Padding not supported: " + str);
    }
    throw new NoSuchAlgorithmException("No such algorithm: " + paramString, (Throwable)localObject1);
  }
  
  private void b()
    throws NoSuchAlgorithmException
  {
    if (!SunJCE_b.c())
    {
      e = SunJCE_k.b;
      f = null;
      return;
    }
    e = c(d);
    String str = e.b();
    if (str != null) {
      f = ExemptionMechanism.getInstance(str);
    }
  }
  
  void a()
  {
    if (c != null) {
      return;
    }
    synchronized (n)
    {
      if (c != null) {
        return;
      }
      if (a != null)
      {
        int i1 = --t;
        if (i1 >= 0)
        {
          a.println("Cipher.init() not first method called, disabling delayed provider selection");
          if (i1 == 0) {
            a.println("Further warnings of this type will be suppressed");
          }
          new Exception("Call trace").printStackTrace();
        }
      }
      Object localObject1 = null;
      while ((k != null) || (l.hasNext()))
      {
        CipherSpi localCipherSpi;
        if (k != null)
        {
          localObject2 = k;
          localCipherSpi = j;
          k = null;
          j = null;
        }
        else
        {
          localObject2 = (Provider.Service)l.next();
          localCipherSpi = null;
        }
        if (SunJCE_b.b(((Provider.Service)localObject2).getProvider()))
        {
          r localr = a((Provider.Service)localObject2, m);
          if ((localr != null) && (localr.a((Provider.Service)localObject2) != 0)) {
            try
            {
              if (localCipherSpi == null)
              {
                Object localObject3 = ((Provider.Service)localObject2).newInstance(null);
                if ((localObject3 instanceof CipherSpi)) {
                  localCipherSpi = (CipherSpi)localObject3;
                }
              }
              else
              {
                localr.a(localCipherSpi);
                b();
                c = localCipherSpi;
                b = ((Provider.Service)localObject2).getProvider();
                k = null;
                l = null;
                m = null;
                return;
              }
            }
            catch (Exception localException)
            {
              localObject1 = localException;
            }
          }
        }
      }
      Object localObject2 = new ProviderException("Could not construct CipherSpi instance");
      if (localObject1 != null) {
        ((ProviderException)localObject2).initCause((Throwable)localObject1);
      }
      throw ((Throwable)localObject2);
    }
  }
  
  private void a(CipherSpi paramCipherSpi, int paramInt1, int paramInt2, Key paramKey, AlgorithmParameterSpec paramAlgorithmParameterSpec, AlgorithmParameters paramAlgorithmParameters, SecureRandom paramSecureRandom)
    throws InvalidKeyException, InvalidAlgorithmParameterException
  {
    switch (paramInt1)
    {
    case 1: 
      a(paramCipherSpi, paramKey);
      paramCipherSpi.engineInit(paramInt2, paramKey, paramSecureRandom);
      break;
    case 2: 
      a(paramCipherSpi, paramKey, paramAlgorithmParameterSpec);
      paramCipherSpi.engineInit(paramInt2, paramKey, paramAlgorithmParameterSpec, paramSecureRandom);
      break;
    case 3: 
      a(paramCipherSpi, paramKey, paramAlgorithmParameters);
      paramCipherSpi.engineInit(paramInt2, paramKey, paramAlgorithmParameters, paramSecureRandom);
      break;
    case 4: 
      a(paramCipherSpi, paramKey);
      paramCipherSpi.engineInit(paramInt2, paramKey, paramSecureRandom);
      break;
    default: 
      throw new AssertionError("Internal Cipher error: " + paramInt1);
    }
  }
  
  private void a(int paramInt1, int paramInt2, Key paramKey, AlgorithmParameterSpec paramAlgorithmParameterSpec, AlgorithmParameters paramAlgorithmParameters, SecureRandom paramSecureRandom)
    throws InvalidKeyException, InvalidAlgorithmParameterException
  {
    synchronized (n)
    {
      if (c != null)
      {
        a(c, paramInt1, paramInt2, paramKey, paramAlgorithmParameterSpec, paramAlgorithmParameters, paramSecureRandom);
        return;
      }
      Object localObject1 = null;
      while ((k != null) || (l.hasNext()))
      {
        CipherSpi localCipherSpi;
        if (k != null)
        {
          localObject2 = k;
          localCipherSpi = j;
          k = null;
          j = null;
        }
        else
        {
          localObject2 = (Provider.Service)l.next();
          localCipherSpi = null;
        }
        if ((((Provider.Service)localObject2).supportsParameter(paramKey)) && (SunJCE_b.b(((Provider.Service)localObject2).getProvider())))
        {
          r localr = a((Provider.Service)localObject2, m);
          if ((localr != null) && (localr.a((Provider.Service)localObject2) != 0)) {
            try
            {
              if (localCipherSpi == null) {
                localCipherSpi = (CipherSpi)((Provider.Service)localObject2).newInstance(null);
              }
              localr.a(localCipherSpi);
              b();
              a(localCipherSpi, paramInt1, paramInt2, paramKey, paramAlgorithmParameterSpec, paramAlgorithmParameters, paramSecureRandom);
              b = ((Provider.Service)localObject2).getProvider();
              c = localCipherSpi;
              k = null;
              l = null;
              m = null;
              return;
            }
            catch (Exception localException)
            {
              if (localObject1 == null) {
                localObject1 = localException;
              }
            }
          }
        }
      }
      if ((localObject1 instanceof InvalidKeyException)) {
        throw ((InvalidKeyException)localObject1);
      }
      if ((localObject1 instanceof InvalidAlgorithmParameterException)) {
        throw ((InvalidAlgorithmParameterException)localObject1);
      }
      if ((localObject1 instanceof RuntimeException)) {
        throw ((RuntimeException)localObject1);
      }
      Object localObject2 = paramKey != null ? paramKey.getClass().getName() : "(null)";
      throw new InvalidKeyException("No installed provider supports this key: " + (String)localObject2, (Throwable)localObject1);
    }
  }
  
  public final Provider getProvider()
  {
    a();
    return b;
  }
  
  public final String getAlgorithm()
  {
    return d;
  }
  
  public final int getBlockSize()
  {
    a();
    return c.engineGetBlockSize();
  }
  
  public final int getOutputSize(int paramInt)
  {
    if ((!g) && (!(this instanceof NullCipher))) {
      throw new IllegalStateException("Cipher not initialized");
    }
    if (paramInt < 0) {
      throw new IllegalArgumentException("Input size must be equal to or greater than zero");
    }
    a();
    return c.engineGetOutputSize(paramInt);
  }
  
  public final byte[] getIV()
  {
    a();
    return c.engineGetIV();
  }
  
  public final AlgorithmParameters getParameters()
  {
    a();
    return c.engineGetParameters();
  }
  
  public final ExemptionMechanism getExemptionMechanism()
  {
    a();
    return f;
  }
  
  private void a(CipherSpi paramCipherSpi, Key paramKey)
    throws InvalidKeyException
  {
    if (e == SunJCE_k.b) {
      return;
    }
    AlgorithmParameterSpec localAlgorithmParameterSpec;
    try
    {
      localAlgorithmParameterSpec = a(paramCipherSpi.engineGetParameters());
    }
    catch (InvalidParameterSpecException localInvalidParameterSpecException)
    {
      throw new InvalidKeyException("Unsupported default algorithm parameters");
    }
    if (!b(paramCipherSpi, paramKey, localAlgorithmParameterSpec)) {
      throw new InvalidKeyException("Illegal key size or default parameters");
    }
  }
  
  private void a(CipherSpi paramCipherSpi, Key paramKey, AlgorithmParameterSpec paramAlgorithmParameterSpec)
    throws InvalidKeyException, InvalidAlgorithmParameterException
  {
    if (e == SunJCE_k.b) {
      return;
    }
    if (!b(paramCipherSpi, paramKey, null)) {
      throw new InvalidKeyException("Illegal key size");
    }
    if ((paramAlgorithmParameterSpec != null) && (!b(paramCipherSpi, paramKey, paramAlgorithmParameterSpec))) {
      throw new InvalidAlgorithmParameterException("Illegal parameters");
    }
  }
  
  private void a(CipherSpi paramCipherSpi, Key paramKey, AlgorithmParameters paramAlgorithmParameters)
    throws InvalidKeyException, InvalidAlgorithmParameterException
  {
    if (e == SunJCE_k.b) {
      return;
    }
    AlgorithmParameterSpec localAlgorithmParameterSpec;
    try
    {
      localAlgorithmParameterSpec = 
1 2 3 4 5 6

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd