bcprov-jdk15on-147

6601");
    localFp = new ECCurve.Fp(localBigInteger1, new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502616"), new BigInteger("32858"));
    localECDomainParameters = new ECDomainParameters(localFp, new ECPoint.Fp(localFp, new ECFieldElement.Fp(localBigInteger1, new BigInteger("0")), new ECFieldElement.Fp(localBigInteger1, new BigInteger("29818893917731240733471273240314769927240550812383695689146495261604565990247"))), localBigInteger2);
    params.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchB, localECDomainParameters);
    localBigInteger1 = new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502619");
    localBigInteger2 = new BigInteger("70390085352083305199547718019018437840920882647164081035322601458352298396601");
    localFp = new ECCurve.Fp(localBigInteger1, new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502616"), new BigInteger("32858"));
    localECDomainParameters = new ECDomainParameters(localFp, new ECPoint.Fp(localFp, new ECFieldElement.Fp(localBigInteger1, new BigInteger("0")), new ECFieldElement.Fp(localBigInteger1, new BigInteger("29818893917731240733471273240314769927240550812383695689146495261604565990247"))), localBigInteger2);
    params.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_C, localECDomainParameters);
    objIds.put("GostR3410-2001-CryptoPro-A", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_A);
    objIds.put("GostR3410-2001-CryptoPro-B", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_B);
    objIds.put("GostR3410-2001-CryptoPro-C", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_C);
    objIds.put("GostR3410-2001-CryptoPro-XchA", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchA);
    objIds.put("GostR3410-2001-CryptoPro-XchB", CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchB);
    names.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_A, "GostR3410-2001-CryptoPro-A");
    names.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_B, "GostR3410-2001-CryptoPro-B");
    names.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_C, "GostR3410-2001-CryptoPro-C");
    names.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchA, "GostR3410-2001-CryptoPro-XchA");
    names.put(CryptoProObjectIdentifiers.gostR3410_2001_CryptoPro_XchB, "GostR3410-2001-CryptoPro-XchB");
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.cryptopro.ECGOST3410NamedCurves
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.cryptopro;

import java.math.BigInteger;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;

public class ECGOST3410ParamSetParameters
  extends ASN1Object
{
  ASN1Integer p;
  ASN1Integer q;
  ASN1Integer a;
  ASN1Integer b;
  ASN1Integer x;
  ASN1Integer y;
  
  public static ECGOST3410ParamSetParameters getInstance(ASN1TaggedObject paramASN1TaggedObject, boolean paramBoolean)
  {
    return getInstance(ASN1Sequence.getInstance(paramASN1TaggedObject, paramBoolean));
  }
  
  public static ECGOST3410ParamSetParameters getInstance(Object paramObject)
  {
    if ((paramObject == null) || ((paramObject instanceof ECGOST3410ParamSetParameters))) {
      return (ECGOST3410ParamSetParameters)paramObject;
    }
    if ((paramObject instanceof ASN1Sequence)) {
      return new ECGOST3410ParamSetParameters((ASN1Sequence)paramObject);
    }
    throw new IllegalArgumentException("Invalid GOST3410Parameter: " + paramObject.getClass().getName());
  }
  
  public ECGOST3410ParamSetParameters(BigInteger paramBigInteger1, BigInteger paramBigInteger2, BigInteger paramBigInteger3, BigInteger paramBigInteger4, int paramInt, BigInteger paramBigInteger5)
  {
    a = new ASN1Integer(paramBigInteger1);
    b = new ASN1Integer(paramBigInteger2);
    p = new ASN1Integer(paramBigInteger3);
    q = new ASN1Integer(paramBigInteger4);
    x = new ASN1Integer(paramInt);
    y = new ASN1Integer(paramBigInteger5);
  }
  
  public ECGOST3410ParamSetParameters(ASN1Sequence paramASN1Sequence)
  {
    Enumeration localEnumeration = paramASN1Sequence.getObjects();
    a = ((ASN1Integer)localEnumeration.nextElement());
    b = ((ASN1Integer)localEnumeration.nextElement());
    p = ((ASN1Integer)localEnumeration.nextElement());
    q = ((ASN1Integer)localEnumeration.nextElement());
    x = ((ASN1Integer)localEnumeration.nextElement());
    y = ((ASN1Integer)localEnumeration.nextElement());
  }
  
  public BigInteger getP()
  {
    return p.getPositiveValue();
  }
  
  public BigInteger getQ()
  {
    return q.getPositiveValue();
  }
  
  public BigInteger getA()
  {
    return a.getPositiveValue();
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(a);
    localASN1EncodableVector.add(b);
    localASN1EncodableVector.add(p);
    localASN1EncodableVector.add(q);
    localASN1EncodableVector.add(x);
    localASN1EncodableVector.add(y);
    return new DERSequence(localASN1EncodableVector);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.cryptopro.ECGOST3410ParamSetParameters
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.cryptopro;

import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;

public class GOST28147Parameters
  extends ASN1Object
{
  ASN1OctetString iv;
  ASN1ObjectIdentifier paramSet;
  
  public static GOST28147Parameters getInstance(ASN1TaggedObject paramASN1TaggedObject, boolean paramBoolean)
  {
    return getInstance(ASN1Sequence.getInstance(paramASN1TaggedObject, paramBoolean));
  }
  
  public static GOST28147Parameters getInstance(Object paramObject)
  {
    if ((paramObject == null) || ((paramObject instanceof GOST28147Parameters))) {
      return (GOST28147Parameters)paramObject;
    }
    if ((paramObject instanceof ASN1Sequence)) {
      return new GOST28147Parameters((ASN1Sequence)paramObject);
    }
    throw new IllegalArgumentException("Invalid GOST3410Parameter: " + paramObject.getClass().getName());
  }
  
  public GOST28147Parameters(ASN1Sequence paramASN1Sequence)
  {
    Enumeration localEnumeration = paramASN1Sequence.getObjects();
    iv = ((ASN1OctetString)localEnumeration.nextElement());
    paramSet = ((ASN1ObjectIdentifier)localEnumeration.nextElement());
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(iv);
    localASN1EncodableVector.add(paramSet);
    return new DERSequence(localASN1EncodableVector);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.cryptopro.GOST28147Parameters
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.cryptopro;

import java.math.BigInteger;
import java.util.Enumeration;
import java.util.Hashtable;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;

public class GOST3410NamedParameters
{
  static final Hashtable objIds = new Hashtable();
  static final Hashtable params = new Hashtable();
  static final Hashtable names = new Hashtable();
  private static GOST3410ParamSetParameters cryptoProA = new GOST3410ParamSetParameters(1024, new BigInteger("127021248288932417465907042777176443525787653508916535812817507265705031260985098497423188333483401180925999995120988934130659205614996724254121049274349357074920312769561451689224110579311248812610229678534638401693520013288995000362260684222750813532307004517341633685004541062586971416883686778842537820383"), new BigInteger("68363196144955700784444165611827252895102170888761442055095051287550314083023"), new BigInteger("100997906755055304772081815535925224869841082572053457874823515875577147990529272777244152852699298796483356699682842027972896052747173175480590485607134746852141928680912561502802222185647539190902656116367847270145019066794290930185446216399730872221732889830323194097355403213400972588322876850946740663962"));
  private static GOST3410ParamSetParameters cryptoProB = new GOST3410ParamSetParameters(1024, new BigInteger("139454871199115825601409655107690713107041707059928031797758001454375765357722984094124368522288239833039114681648076688236921220737322672160740747771700911134550432053804647694904686120113087816240740184800477047157336662926249423571248823968542221753660143391485680840520336859458494803187341288580489525163"), new BigInteger("79885141663410976897627118935756323747307951916507639758300472692338873533959"), new BigInteger("42941826148615804143873447737955502392672345968607143066798112994089471231420027060385216699563848719957657284814898909770759462613437669456364882730370838934791080835932647976778601915343474400961034231316672578686920482194932878633360203384797092684342247621055760235016132614780652761028509445403338652341"));
  private static GOST3410ParamSetParameters cryptoProXchA = new GOST3410ParamSetParameters(1024, new BigInteger("142011741597563481196368286022318089743276138395243738762872573441927459393512718973631166078467600360848946623567625795282774719212241929071046134208380636394084512691828894000571524625445295769349356752728956831541775441763139384457191755096847107846595662547942312293338483924514339614727760681880609734239"), new BigInteger("91771529896554605945588149018382750217296858393520724172743325725474374979801"), new BigInteger("133531813272720673433859519948319001217942375967847486899482359599369642528734712461590403327731821410328012529253871914788598993103310567744136196364803064721377826656898686468463277710150809401182608770201615324990468332931294920912776241137878030224355746606283971659376426832674269780880061631528163475887"));
  
  public static GOST3410ParamSetParameters getByOID(ASN1ObjectIdentifier paramASN1ObjectIdentifier)
  {
    return (GOST3410ParamSetParameters)params.get(paramASN1ObjectIdentifier);
  }
  
  public static Enumeration getNames()
  {
    return objIds.keys();
  }
  
  public static GOST3410ParamSetParameters getByName(String paramString)
  {
    ASN1ObjectIdentifier localASN1ObjectIdentifier = (ASN1ObjectIdentifier)objIds.get(paramString);
    if (localASN1ObjectIdentifier != null) {
      return (GOST3410ParamSetParameters)params.get(localASN1ObjectIdentifier);
    }
    return null;
  }
  
  public static ASN1ObjectIdentifier getOID(String paramString)
  {
    return (ASN1ObjectIdentifier)objIds.get(paramString);
  }
  
  static
  {
    params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_A, cryptoProA);
    params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_B, cryptoProB);
    params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_XchA, cryptoProXchA);
    objIds.put("GostR3410-94-CryptoPro-A", CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_A);
    objIds.put("GostR3410-94-CryptoPro-B", CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_B);
    objIds.put("GostR3410-94-CryptoPro-XchA", CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_XchA);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.cryptopro.GOST3410NamedParameters
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.cryptopro;

import java.math.BigInteger;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;

public class GOST3410ParamSetParameters
  extends ASN1Object
{
  int keySize;
  ASN1Integer p;
  ASN1Integer q;
  ASN1Integer a;
  
  public static GOST3410ParamSetParameters getInstance(ASN1TaggedObject paramASN1TaggedObject, boolean paramBoolean)
  {
    return getInstance(ASN1Sequence.getInstance(paramASN1TaggedObject, paramBoolean));
  }
  
  public static GOST3410ParamSetParameters getInstance(Object paramObject)
  {
    if ((paramObject == null) || ((paramObject instanceof GOST3410ParamSetParameters))) {
      return (GOST3410ParamSetParameters)paramObject;
    }
    if ((paramObject instanceof ASN1Sequence)) {
      return new GOST3410ParamSetParameters((ASN1Sequence)paramObject);
    }
    throw new IllegalArgumentException("Invalid GOST3410Parameter: " + paramObject.getClass().getName());
  }
  
  public GOST3410ParamSetParameters(int paramInt, BigInteger paramBigInteger1, BigInteger paramBigInteger2, BigInteger paramBigInteger3)
  {
    keySize = paramInt;
    p = new ASN1Integer(paramBigInteger1);
    q = new ASN1Integer(paramBigInteger2);
    a = new ASN1Integer(paramBigInteger3);
  }
  
  public GOST3410ParamSetParameters(ASN1Sequence paramASN1Sequence)
  {
    Enumeration localEnumeration = paramASN1Sequence.getObjects();
    keySize = ((ASN1Integer)localEnumeration.nextElement()).getValue().intValue();
    p = ((ASN1Integer)localEnumeration.nextElement());
    q = ((ASN1Integer)localEnumeration.nextElement());
    a = ((ASN1Integer)localEnumeration.nextElement());
  }
  
  /**
   * @deprecated
   */
  public int getLKeySize()
  {
    return keySize;
  }
  
  public int getKeySize()
  {
    return keySize;
  }
  
  public BigInteger getP()
  {
    return p.getPositiveValue();
  }
  
  public BigInteger getQ()
  {
    return q.getPositiveValue();
  }
  
  public BigInteger getA()
  {
    return a.getPositiveValue();
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(new ASN1Integer(keySize));
    localASN1EncodableVector.add(p);
    localASN1EncodableVector.add(q);
    localASN1EncodableVector.add(a);
    return new DERSequence(localASN1EncodableVector);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.cryptopro.GOST3410ParamSetParameters
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.cryptopro;

import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERSequence;

public class GOST3410PublicKeyAlgParameters
  extends ASN1Object
{
  private ASN1ObjectIdentifier publicKeyParamSet;
  private ASN1ObjectIdentifier digestParamSet;
  private ASN1ObjectIdentifier encryptionParamSet;
  
  public static GOST3410PublicKeyAlgParameters getInstance(ASN1TaggedObject paramASN1TaggedObject, boolean paramBoolean)
  {
    return getInstance(ASN1Sequence.getInstance(paramASN1TaggedObject, paramBoolean));
  }
  
  public static GOST3410PublicKeyAlgParameters getInstance(Object paramObject)
  {
    if ((paramObject instanceof GOST3410PublicKeyAlgParameters)) {
      return (GOST3410PublicKeyAlgParameters)paramObject;
    }
    if (paramObject != null) {
      return new GOST3410PublicKeyAlgParameters(ASN1Sequence.getInstance(paramObject));
    }
    return null;
  }
  
  public GOST3410PublicKeyAlgParameters(ASN1ObjectIdentifier paramASN1ObjectIdentifier1, ASN1ObjectIdentifier paramASN1ObjectIdentifier2)
  {
    publicKeyParamSet = paramASN1ObjectIdentifier1;
    digestParamSet = paramASN1ObjectIdentifier2;
    encryptionParamSet = null;
  }
  
  public GOST3410PublicKeyAlgParameters(ASN1ObjectIdentifier paramASN1ObjectIdentifier1, ASN1ObjectIdentifier paramASN1ObjectIdentifier2, ASN1ObjectIdentifier paramASN1ObjectIdentifier3)
  {
    publicKeyParamSet = paramASN1ObjectIdentifier1;
    digestParamSet = paramASN1ObjectIdentifier2;
    encryptionParamSet = paramASN1ObjectIdentifier3;
  }
  
  public GOST3410PublicKeyAlgParameters(ASN1Sequence paramASN1Sequence)
  {
    publicKeyParamSet = ((ASN1ObjectIdentifier)paramASN1Sequence.getObjectAt(0));
    digestParamSet = ((ASN1ObjectIdentifier)paramASN1Sequence.getObjectAt(1));
    if (paramASN1Sequence.size() > 2) {
      encryptionParamSet = ((ASN1ObjectIdentifier)paramASN1Sequence.getObjectAt(2));
    }
  }
  
  public ASN1ObjectIdentifier getPublicKeyParamSet()
  {
    return publicKeyParamSet;
  }
  
  public ASN1ObjectIdentifier getDigestParamSet()
  {
    return digestParamSet;
  }
  
  public ASN1ObjectIdentifier getEncryptionParamSet()
  {
    return encryptionParamSet;
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(publicKeyParamSet);
    localASN1EncodableVector.add(digestParamSet);
    if (encryptionParamSet != null) {
      localASN1EncodableVector.add(encryptionParamSet);
    }
    return new DERSequence(localASN1EncodableVector);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.cryptopro.GOST3410PublicKeyAlgParameters
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.eac;

import java.util.Hashtable;

public class BidirectionalMap
  extends Hashtable
{
  private static final long serialVersionUID = -7457289971962812909L;
  Hashtable reverseMap = new Hashtable();
  
  public Object getReverse(Object paramObject)
  {
    return reverseMap.get(paramObject);
  }
  
  public Object put(Object paramObject1, Object paramObject2)
  {
    reverseMap.put(paramObject2, paramObject1);
    return super.put(paramObject1, paramObject2);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.eac.BidirectionalMap
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.eac;

import java.io.IOException;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1ParsingException;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERApplicationSpecific;
import org.bouncycastle.asn1.DEROctetString;

public class CVCertificate
  extends ASN1Object
{
  private CertificateBody certificateBody;
  private byte[] signature;
  private int valid;
  private static int bodyValid = 1;
  private static int signValid = 2;
  public static final byte version_1 = 0;
  public static String ReferenceEncoding = "ISO-8859-1";
  
  private void setPrivateData(DERApplicationSpecific paramDERApplicationSpecific)
    throws IOException
  {
    valid = 0;
    if (paramDERApplicationSpecific.getApplicationTag() == 33)
    {
      ASN1InputStream localASN1InputStream = new ASN1InputStream(paramDERApplicationSpecific.getContents());
      ASN1Primitive localASN1Primitive;
      while ((localASN1Primitive = localASN1InputStream.readObject()) != null) {
        if ((localASN1Primitive instanceof DERApplicationSpecific))
        {
          DERApplicationSpecific localDERApplicationSpecific = (DERApplicationSpecific)localASN1Primitive;
          switch (localDERApplicationSpecific.getApplicationTag())
          {
          case 78: 
            certificateBody = CertificateBody.getInstance(localDERApplicationSpecific);
            valid |= bodyValid;
            break;
          case 55: 
            signature = localDERApplicationSpecific.getContents();
            valid |= signValid;
            break;
          default: 
            throw new IOException("Invalid tag, not an Iso7816CertificateStructure :" + localDERApplicationSpecific.getApplicationTag());
          }
        }
        else
        {
          throw new IOException("Invalid Object, not an Iso7816CertificateStructure");
        }
      }
    }
    else
    {
      throw new IOException("not a CARDHOLDER_CERTIFICATE :" + paramDERApplicationSpecific.getApplicationTag());
    }
  }
  
  public CVCertificate(ASN1InputStream paramASN1InputStream)
    throws IOException
  {
    initFrom(paramASN1InputStream);
  }
  
  private void initFrom(ASN1InputStream paramASN1InputStream)
    throws IOException
  {
    ASN1Primitive localASN1Primitive;
    while ((localASN1Primitive = paramASN1InputStream.readObject()) != null) {
      if ((localASN1Primitive instanceof DERApplicationSpecific)) {
        setPrivateData((DERApplicationSpecific)localASN1Primitive);
      } else {
        throw new IOException("Invalid Input Stream for creating an Iso7816CertificateStructure");
      }
    }
  }
  
  private CVCertificate(DERApplicationSpecific paramDERApplicationSpecific)
    throws IOException
  {
    setPrivateData(paramDERApplicationSpecific);
  }
  
  public CVCertificate(CertificateBody paramCertificateBody, byte[] paramArrayOfByte)
    throws IOException
  {
    certificateBody = paramCertificateBody;
    signature = paramArrayOfByte;
    valid |= bodyValid;
    valid |= signValid;
  }
  
  public static CVCertificate getInstance(Object paramObject)
  {
    if ((paramObject instanceof CVCertificate)) {
      return (CVCertificate)paramObject;
    }
    if (paramObject != null) {
      try
      {
        return new CVCertificate(DERApplicationSpecific.getInstance(paramObject));
      }
      catch (IOException localIOException)
      {
        throw new ASN1ParsingException("unable to parse data: " + localIOException.getMessage(), localIOException);
      }
    }
    return null;
  }
  
  public byte[] getSignature()
  {
    return signature;
  }
  
  public CertificateBody getBody()
  {
    return certificateBody;
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    if (valid != (signValid | bodyValid)) {
      return null;
    }
    localASN1EncodableVector.add(certificateBody);
    try
    {
      localASN1EncodableVector.add(new DERApplicationSpecific(false, 55, new DEROctetString(signature)));
    }
    catch (IOException localIOException)
    {
      throw new IllegalStateException("unable to convert signature!");
    }
    return new DERApplicationSpecific(33, localASN1EncodableVector);
  }
  
  public ASN1ObjectIdentifier getHolderAuthorization()
    throws IOException
  {
    CertificateHolderAuthorization localCertificateHolderAuthorization = certificateBody.getCertificateHolderAuthorization();
    return localCertificateHolderAuthorization.getOid();
  }
  
  public PackedDate getEffectiveDate()
    throws IOException
  {
    return certificateBody.getCertificateEffectiveDate();
  }
  
  public int getCertificateType()
  {
    return certificateBody.getCertificateType();
  }
  
  public PackedDate getExpirationDate()
    throws IOException
  {
    return certificateBody.getCertificateExpirationDate();
  }
  
  public int getRole()
    throws IOException
  {
    CertificateHolderAuthorization localCertificateHolderAuthorization = certificateBody.getCertificateHolderAuthorization();
    return localCertificateHolderAuthorization.getAccessRights();
  }
  
  public CertificationAuthorityReference getAuthorityReference()
    throws IOException
  {
    return certificateBody.getCertificationAuthorityReference();
  }
  
  public CertificateHolderReference getHolderReference()
    throws IOException
  {
    return certificateBody.getCertificateHolderReference();
  }
  
  public int getHolderAuthorizationRole()
    throws IOException
  {
    int i = certificateBody.getCertificateHolderAuthorization().getAccessRights();
    return i & 0xC0;
  }
  
  public Flags getHolderAuthorizationRights()
    throws IOException
  {
    return new Flags(certificateBody.getCertificateHolderAuthorization().getAccessRights() & 0x1F);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.eac.CVCertificate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.eac;

import java.io.IOException;
import java.util.Enumeration;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1ParsingException;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERApplicationSpecific;
import org.bouncycastle.asn1.DEROctetString;

public class CVCertificateRequest
  extends ASN1Object
{
  private CertificateBody certificateBody;
  private byte[] innerSignature = null;
  private byte[] outerSignature = null;
  private int valid;
  private static int bodyValid = 1;
  private static int signValid = 2;
  ASN1ObjectIdentifier signOid = null;
  ASN1ObjectIdentifier keyOid = null;
  public static byte[] ZeroArray = { 0 };
  String strCertificateHolderReference;
  byte[] encodedAuthorityReference;
  int ProfileId;
  byte[] certificate = null;
  protected String overSignerReference = null;
  byte[] encoded;
  PublicKeyDataObject iso7816PubKey = null;
  
  private CVCertificateRequest(DERApplicationSpecific paramDERApplicationSpecific)
    throws IOException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 103)
    {
      ASN1Sequence localASN1Sequence = ASN1Sequence.getInstance(paramDERApplicationSpecific.getObject(16));
      initCertBody(DERApplicationSpecific.getInstance(localASN1Sequence.getObjectAt(0)));
      outerSignature = DERApplicationSpecific.getInstance(localASN1Sequence.getObjectAt(localASN1Sequence.size() - 1)).getContents();
    }
    else
    {
      initCertBody(paramDERApplicationSpecific);
    }
  }
  
  private void initCertBody(DERApplicationSpecific paramDERApplicationSpecific)
    throws IOException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 33)
    {
      ASN1Sequence localASN1Sequence = ASN1Sequence.getInstance(paramDERApplicationSpecific.getObject(16));
      Enumeration localEnumeration = localASN1Sequence.getObjects();
      while (localEnumeration.hasMoreElements())
      {
        DERApplicationSpecific localDERApplicationSpecific = DERApplicationSpecific.getInstance(localEnumeration.nextElement());
        switch (localDERApplicationSpecific.getApplicationTag())
        {
        case 78: 
          certificateBody = CertificateBody.getInstance(localDERApplicationSpecific);
          valid |= bodyValid;
          break;
        case 55: 
          innerSignature = localDERApplicationSpecific.getContents();
          valid |= signValid;
          break;
        default: 
          throw new IOException("Invalid tag, not an CV Certificate Request element:" + localDERApplicationSpecific.getApplicationTag());
        }
      }
    }
    else
    {
      throw new IOException("not a CARDHOLDER_CERTIFICATE in request:" + paramDERApplicationSpecific.getApplicationTag());
    }
  }
  
  public static CVCertificateRequest getInstance(Object paramObject)
  {
    if ((paramObject instanceof CVCertificateRequest)) {
      return (CVCertificateRequest)paramObject;
    }
    if (paramObject != null) {
      try
      {
        return new CVCertificateRequest(DERApplicationSpecific.getInstance(paramObject));
      }
      catch (IOException localIOException)
      {
        throw new ASN1ParsingException("unable to parse data: " + localIOException.getMessage(), localIOException);
      }
    }
    return null;
  }
  
  public CertificateBody getCertificateBody()
  {
    return certificateBody;
  }
  
  public PublicKeyDataObject getPublicKey()
  {
    return certificateBody.getPublicKey();
  }
  
  public byte[] getInnerSignature()
  {
    return innerSignature;
  }
  
  public byte[] getOuterSignature()
  {
    return outerSignature;
  }
  
  public boolean hasOuterSignature()
  {
    return outerSignature != null;
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(certificateBody);
    try
    {
      localASN1EncodableVector.add(new DERApplicationSpecific(false, 55, new DEROctetString(innerSignature)));
    }
    catch (IOException localIOException)
    {
      throw new IllegalStateException("unable to convert signature!");
    }
    return new DERApplicationSpecific(33, localASN1EncodableVector);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.eac.CVCertificateRequest
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.eac;

import java.io.IOException;
import java.io.PrintStream;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERApplicationSpecific;
import org.bouncycastle.asn1.DEROctetString;

public class CertificateBody
  extends ASN1Object
{
  ASN1InputStream seq;
  private DERApplicationSpecific certificateProfileIdentifier;
  private DERApplicationSpecific certificationAuthorityReference;
  private PublicKeyDataObject publicKey;
  private DERApplicationSpecific certificateHolderReference;
  private CertificateHolderAuthorization certificateHolderAuthorization;
  private DERApplicationSpecific certificateEffectiveDate;
  private DERApplicationSpecific certificateExpirationDate;
  private int certificateType = 0;
  private static final int CPI = 1;
  private static final int CAR = 2;
  private static final int PK = 4;
  private static final int CHR = 8;
  private static final int CHA = 16;
  private static final int CEfD = 32;
  private static final int CExD = 64;
  public static final int profileType = 127;
  public static final int requestType = 13;
  
  private void setIso7816CertificateBody(DERApplicationSpecific paramDERApplicationSpecific)
    throws IOException
  {
    byte[] arrayOfByte;
    if (paramDERApplicationSpecific.getApplicationTag() == 78) {
      arrayOfByte = paramDERApplicationSpecific.getContents();
    } else {
      throw new IOException("Bad tag : not an iso7816 CERTIFICATE_CONTENT_TEMPLATE");
    }
    ASN1InputStream localASN1InputStream = new ASN1InputStream(arrayOfByte);
    ASN1Primitive localASN1Primitive;
    while ((localASN1Primitive = localASN1InputStream.readObject()) != null)
    {
      DERApplicationSpecific localDERApplicationSpecific;
      if ((localASN1Primitive instanceof DERApplicationSpecific)) {
        localDERApplicationSpecific = (DERApplicationSpecific)localASN1Primitive;
      } else {
        throw new IOException("Not a valid iso7816 content : not a DERApplicationSpecific Object :" + EACTags.encodeTag(paramDERApplicationSpecific) + localASN1Primitive.getClass());
      }
      switch (localDERApplicationSpecific.getApplicationTag())
      {
      case 41: 
        setCertificateProfileIdentifier(localDERApplicationSpecific);
        break;
      case 2: 
        setCertificationAuthorityReference(localDERApplicationSpecific);
        break;
      case 73: 
        setPublicKey(PublicKeyDataObject.getInstance(localDERApplicationSpecific.getObject(16)));
        break;
      case 32: 
        setCertificateHolderReference(localDERApplicationSpecific);
        break;
      case 76: 
        setCertificateHolderAuthorization(new CertificateHolderAuthorization(localDERApplicationSpecific));
        break;
      case 37: 
        setCertificateEffectiveDate(localDERApplicationSpecific);
        break;
      case 36: 
        setCertificateExpirationDate(localDERApplicationSpecific);
        break;
      default: 
        certificateType = 0;
        throw new IOException("Not a valid iso7816 DERApplicationSpecific tag " + localDERApplicationSpecific.getApplicationTag());
      }
    }
  }
  
  public CertificateBody(DERApplicationSpecific paramDERApplicationSpecific, CertificationAuthorityReference paramCertificationAuthorityReference, PublicKeyDataObject paramPublicKeyDataObject, CertificateHolderReference paramCertificateHolderReference, CertificateHolderAuthorization paramCertificateHolderAuthorization, PackedDate paramPackedDate1, PackedDate paramPackedDate2)
  {
    setCertificateProfileIdentifier(paramDERApplicationSpecific);
    setCertificationAuthorityReference(new DERApplicationSpecific(2, paramCertificationAuthorityReference.getEncoded()));
    setPublicKey(paramPublicKeyDataObject);
    setCertificateHolderReference(new DERApplicationSpecific(32, paramCertificateHolderReference.getEncoded()));
    setCertificateHolderAuthorization(paramCertificateHolderAuthorization);
    try
    {
      setCertificateEffectiveDate(new DERApplicationSpecific(false, 37, new DEROctetString(paramPackedDate1.getEncoding())));
      setCertificateExpirationDate(new DERApplicationSpecific(false, 36, new DEROctetString(paramPackedDate2.getEncoding())));
    }
    catch (IOException localIOException)
    {
      throw new IllegalArgumentException("unable to encode dates: " + localIOException.getMessage());
    }
  }
  
  private CertificateBody(DERApplicationSpecific paramDERApplicationSpecific)
    throws IOException
  {
    setIso7816CertificateBody(paramDERApplicationSpecific);
  }
  
  private ASN1Primitive profileToASN1Object()
    throws IOException
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(certificateProfileIdentifier);
    localASN1EncodableVector.add(certificationAuthorityReference);
    localASN1EncodableVector.add(new DERApplicationSpecific(false, 73, publicKey));
    localASN1EncodableVector.add(certificateHolderReference);
    localASN1EncodableVector.add(certificateHolderAuthorization);
    localASN1EncodableVector.add(certificateEffectiveDate);
    localASN1EncodableVector.add(certificateExpirationDate);
    return new DERApplicationSpecific(78, localASN1EncodableVector);
  }
  
  private void setCertificateProfileIdentifier(DERApplicationSpecific paramDERApplicationSpecific)
    throws IllegalArgumentException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 41)
    {
      certificateProfileIdentifier = paramDERApplicationSpecific;
      certificateType |= 0x1;
    }
    else
    {
      throw new IllegalArgumentException("Not an Iso7816Tags.INTERCHANGE_PROFILE tag :" + EACTags.encodeTag(paramDERApplicationSpecific));
    }
  }
  
  private void setCertificateHolderReference(DERApplicationSpecific paramDERApplicationSpecific)
    throws IllegalArgumentException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 32)
    {
      certificateHolderReference = paramDERApplicationSpecific;
      certificateType |= 0x8;
    }
    else
    {
      throw new IllegalArgumentException("Not an Iso7816Tags.CARDHOLDER_NAME tag");
    }
  }
  
  private void setCertificationAuthorityReference(DERApplicationSpecific paramDERApplicationSpecific)
    throws IllegalArgumentException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 2)
    {
      certificationAuthorityReference = paramDERApplicationSpecific;
      certificateType |= 0x2;
    }
    else
    {
      throw new IllegalArgumentException("Not an Iso7816Tags.ISSUER_IDENTIFICATION_NUMBER tag");
    }
  }
  
  private void setPublicKey(PublicKeyDataObject paramPublicKeyDataObject)
  {
    publicKey = PublicKeyDataObject.getInstance(paramPublicKeyDataObject);
    certificateType |= 0x4;
  }
  
  private ASN1Primitive requestToASN1Object()
    throws IOException
  {
    ASN1EncodableVector localASN1EncodableVector = new ASN1EncodableVector();
    localASN1EncodableVector.add(certificateProfileIdentifier);
    localASN1EncodableVector.add(new DERApplicationSpecific(false, 73, publicKey));
    localASN1EncodableVector.add(certificateHolderReference);
    return new DERApplicationSpecific(78, localASN1EncodableVector);
  }
  
  public ASN1Primitive toASN1Primitive()
  {
    try
    {
      if (certificateType == 127) {
        return profileToASN1Object();
      }
      if (certificateType == 13) {
        return requestToASN1Object();
      }
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      return null;
    }
    System.err.println("returning null");
    return null;
  }
  
  public int getCertificateType()
  {
    return certificateType;
  }
  
  public static CertificateBody getInstance(Object paramObject)
    throws IOException
  {
    if ((paramObject instanceof CertificateBody)) {
      return (CertificateBody)paramObject;
    }
    if (paramObject != null) {
      return new CertificateBody(DERApplicationSpecific.getInstance(paramObject));
    }
    return null;
  }
  
  public PackedDate getCertificateEffectiveDate()
  {
    if ((certificateType & 0x20) == 32) {
      return new PackedDate(certificateEffectiveDate.getContents());
    }
    return null;
  }
  
  private void setCertificateEffectiveDate(DERApplicationSpecific paramDERApplicationSpecific)
    throws IllegalArgumentException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 37)
    {
      certificateEffectiveDate = paramDERApplicationSpecific;
      certificateType |= 0x20;
    }
    else
    {
      throw new IllegalArgumentException("Not an Iso7816Tags.APPLICATION_EFFECTIVE_DATE tag :" + EACTags.encodeTag(paramDERApplicationSpecific));
    }
  }
  
  public PackedDate getCertificateExpirationDate()
    throws IOException
  {
    if ((certificateType & 0x40) == 64) {
      return new PackedDate(certificateExpirationDate.getContents());
    }
    throw new IOException("certificate Expiration Date not set");
  }
  
  private void setCertificateExpirationDate(DERApplicationSpecific paramDERApplicationSpecific)
    throws IllegalArgumentException
  {
    if (paramDERApplicationSpecific.getApplicationTag() == 36)
    {
      certificateExpirationDate = paramDERApplicationSpecific;
      certificateType |= 0x40;
    }
    else
    {
      throw new IllegalArgumentException("Not an Iso7816Tags.APPLICATION_EXPIRATION_DATE tag");
    }
  }
  
  public CertificateHolderAuthorization getCertificateHolderAuthorization()
    throws IOException
  {
    if ((certificateType & 0x10) == 16) {
      return certificateHolderAuthorization;
    }
    throw new IOException("Certificate Holder Authorisation not set");
  }
  
  private void setCertificateHolderAuthorization(CertificateHolderAuthorization paramCertificateHolderAuthorization)
  {
    certificateHolderAuthorization = paramCertificateHolderAuthorization;
    certificateType |= 0x10;
  }
  
  public CertificateHolderReference getCertificateHolderReference()
  {
    return new CertificateHolderReference(certificateHolderReference.getContents());
  }
  
  public DERApplicationSpecific getCertificateProfileIdentifier()
  {
    return certificateProfileIdentifier;
  }
  
  public CertificationAuthorityReference getCertificationAuthorityReference()
    throws IOException
  {
    if ((certificateType & 0x2) == 2) {
      return new CertificationAuthorityReference(certificationAuthorityReference.getContents());
    }
    throw new IOException("Certification authority reference not set");
  }
  
  public PublicKeyDataObject getPublicKey()
  {
    return publicKey;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.asn1.eac.CertificateBody
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.asn1.eac;

import java.io.IOException;
import java.util.Hashtable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1InputStream;
import
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125

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-2019. Infinite Loop Ltd