bcpkix-jdk15on-147

 Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.ocsp.jcajce;

import java.math.BigInteger;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import org.bouncycastle.cert.jcajce.JcaX509CertificateHolder;
import org.bouncycastle.cert.ocsp.CertificateID;
import org.bouncycastle.cert.ocsp.OCSPException;
import org.bouncycastle.operator.DigestCalculator;

public class JcaCertificateID
  extends CertificateID
{
  public JcaCertificateID(DigestCalculator paramDigestCalculator, X509Certificate paramX509Certificate, BigInteger paramBigInteger)
    throws OCSPException, CertificateEncodingException
  {
    super(paramDigestCalculator, new JcaX509CertificateHolder(paramX509Certificate), paramBigInteger);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.ocsp.jcajce.JcaCertificateID
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.ocsp.jcajce;

import java.security.PublicKey;
import javax.security.auth.x500.X500Principal;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.bouncycastle.cert.ocsp.OCSPException;
import org.bouncycastle.cert.ocsp.RespID;
import org.bouncycastle.operator.DigestCalculator;

public class JcaRespID
  extends RespID
{
  public JcaRespID(X500Principal paramX500Principal)
  {
    super(X500Name.getInstance(paramX500Principal.getEncoded()));
  }
  
  public JcaRespID(PublicKey paramPublicKey, DigestCalculator paramDigestCalculator)
    throws OCSPException
  {
    super(SubjectPublicKeyInfo.getInstance(paramPublicKey.getEncoded()), paramDigestCalculator);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.ocsp.jcajce.JcaRespID
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector;

import java.io.IOException;
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.bouncycastle.crypto.Digest;
import org.bouncycastle.crypto.digests.SHA1Digest;

class MSOutlookKeyIdCalculator
{
  static byte[] calculateKeyId(SubjectPublicKeyInfo paramSubjectPublicKeyInfo)
  {
    SHA1Digest localSHA1Digest = new SHA1Digest();
    byte[] arrayOfByte1 = new byte[localSHA1Digest.getDigestSize()];
    byte[] arrayOfByte2 = new byte[0];
    try
    {
      arrayOfByte2 = paramSubjectPublicKeyInfo.getEncoded("DER");
    }
    catch (IOException localIOException)
    {
      return new byte[0];
    }
    localSHA1Digest.update(arrayOfByte2, 0, arrayOfByte2.length);
    localSHA1Digest.doFinal(arrayOfByte1, 0);
    return arrayOfByte1;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.MSOutlookKeyIdCalculator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector;

import java.math.BigInteger;
import java.util.Collection;
import java.util.Date;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.Target;
import org.bouncycastle.asn1.x509.TargetInformation;
import org.bouncycastle.asn1.x509.Targets;
import org.bouncycastle.cert.AttributeCertificateHolder;
import org.bouncycastle.cert.AttributeCertificateIssuer;
import org.bouncycastle.cert.X509AttributeCertificateHolder;
import org.bouncycastle.util.Selector;

public class X509AttributeCertificateHolderSelector
  implements Selector
{
  private final AttributeCertificateHolder holder;
  private final AttributeCertificateIssuer issuer;
  private final BigInteger serialNumber;
  private final Date attributeCertificateValid;
  private final X509AttributeCertificateHolder attributeCert;
  private final Collection targetNames;
  private final Collection targetGroups;
  
  X509AttributeCertificateHolderSelector(AttributeCertificateHolder paramAttributeCertificateHolder, AttributeCertificateIssuer paramAttributeCertificateIssuer, BigInteger paramBigInteger, Date paramDate, X509AttributeCertificateHolder paramX509AttributeCertificateHolder, Collection paramCollection1, Collection paramCollection2)
  {
    holder = paramAttributeCertificateHolder;
    issuer = paramAttributeCertificateIssuer;
    serialNumber = paramBigInteger;
    attributeCertificateValid = paramDate;
    attributeCert = paramX509AttributeCertificateHolder;
    targetNames = paramCollection1;
    targetGroups = paramCollection2;
  }
  
  public boolean match(Object paramObject)
  {
    if (!(paramObject instanceof X509AttributeCertificateHolder)) {
      return false;
    }
    X509AttributeCertificateHolder localX509AttributeCertificateHolder = (X509AttributeCertificateHolder)paramObject;
    if ((attributeCert != null) && (!attributeCert.equals(localX509AttributeCertificateHolder))) {
      return false;
    }
    if ((serialNumber != null) && (!localX509AttributeCertificateHolder.getSerialNumber().equals(serialNumber))) {
      return false;
    }
    if ((holder != null) && (!localX509AttributeCertificateHolder.getHolder().equals(holder))) {
      return false;
    }
    if ((issuer != null) && (!localX509AttributeCertificateHolder.getIssuer().equals(issuer))) {
      return false;
    }
    if ((attributeCertificateValid != null) && (!localX509AttributeCertificateHolder.isValidOn(attributeCertificateValid))) {
      return false;
    }
    if ((!targetNames.isEmpty()) || (!targetGroups.isEmpty()))
    {
      Extension localExtension = localX509AttributeCertificateHolder.getExtension(Extension.targetInformation);
      if (localExtension != null)
      {
        TargetInformation localTargetInformation;
        try
        {
          localTargetInformation = TargetInformation.getInstance(localExtension.getParsedValue());
        }
        catch (IllegalArgumentException localIllegalArgumentException)
        {
          return false;
        }
        Targets[] arrayOfTargets = localTargetInformation.getTargetsObjects();
        int i;
        int j;
        Targets localTargets;
        Target[] arrayOfTarget;
        int k;
        if (!targetNames.isEmpty())
        {
          i = 0;
          for (j = 0; j < arrayOfTargets.length; j++)
          {
            localTargets = arrayOfTargets[j];
            arrayOfTarget = localTargets.getTargets();
            for (k = 0; k < arrayOfTarget.length; k++) {
              if (targetNames.contains(GeneralName.getInstance(arrayOfTarget[k].getTargetName())))
              {
                i = 1;
                break;
              }
            }
          }
          if (i == 0) {
            return false;
          }
        }
        if (!targetGroups.isEmpty())
        {
          i = 0;
          for (j = 0; j < arrayOfTargets.length; j++)
          {
            localTargets = arrayOfTargets[j];
            arrayOfTarget = localTargets.getTargets();
            for (k = 0; k < arrayOfTarget.length; k++) {
              if (targetGroups.contains(GeneralName.getInstance(arrayOfTarget[k].getTargetGroup())))
              {
                i = 1;
                break;
              }
            }
          }
          if (i == 0) {
            return false;
          }
        }
      }
    }
    return true;
  }
  
  public Object clone()
  {
    X509AttributeCertificateHolderSelector localX509AttributeCertificateHolderSelector = new X509AttributeCertificateHolderSelector(holder, issuer, serialNumber, attributeCertificateValid, attributeCert, targetNames, targetGroups);
    return localX509AttributeCertificateHolderSelector;
  }
  
  public X509AttributeCertificateHolder getAttributeCert()
  {
    return attributeCert;
  }
  
  public Date getAttributeCertificateValid()
  {
    if (attributeCertificateValid != null) {
      return new Date(attributeCertificateValid.getTime());
    }
    return null;
  }
  
  public AttributeCertificateHolder getHolder()
  {
    return holder;
  }
  
  public AttributeCertificateIssuer getIssuer()
  {
    return issuer;
  }
  
  public BigInteger getSerialNumber()
  {
    return serialNumber;
  }
  
  public Collection getTargetNames()
  {
    return targetNames;
  }
  
  public Collection getTargetGroups()
  {
    return targetGroups;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.X509AttributeCertificateHolderSelector
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector;

import java.io.IOException;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.cert.AttributeCertificateHolder;
import org.bouncycastle.cert.AttributeCertificateIssuer;
import org.bouncycastle.cert.X509AttributeCertificateHolder;

public class X509AttributeCertificateHolderSelectorBuilder
{
  private AttributeCertificateHolder holder;
  private AttributeCertificateIssuer issuer;
  private BigInteger serialNumber;
  private Date attributeCertificateValid;
  private X509AttributeCertificateHolder attributeCert;
  private Collection targetNames = new HashSet();
  private Collection targetGroups = new HashSet();
  
  public void setAttributeCert(X509AttributeCertificateHolder paramX509AttributeCertificateHolder)
  {
    attributeCert = paramX509AttributeCertificateHolder;
  }
  
  public void setAttributeCertificateValid(Date paramDate)
  {
    if (paramDate != null) {
      attributeCertificateValid = new Date(paramDate.getTime());
    } else {
      attributeCertificateValid = null;
    }
  }
  
  public void setHolder(AttributeCertificateHolder paramAttributeCertificateHolder)
  {
    holder = paramAttributeCertificateHolder;
  }
  
  public void setIssuer(AttributeCertificateIssuer paramAttributeCertificateIssuer)
  {
    issuer = paramAttributeCertificateIssuer;
  }
  
  public void setSerialNumber(BigInteger paramBigInteger)
  {
    serialNumber = paramBigInteger;
  }
  
  public void addTargetName(GeneralName paramGeneralName)
  {
    targetNames.add(paramGeneralName);
  }
  
  public void setTargetNames(Collection paramCollection)
    throws IOException
  {
    targetNames = extractGeneralNames(paramCollection);
  }
  
  public void addTargetGroup(GeneralName paramGeneralName)
  {
    targetGroups.add(paramGeneralName);
  }
  
  public void setTargetGroups(Collection paramCollection)
    throws IOException
  {
    targetGroups = extractGeneralNames(paramCollection);
  }
  
  private Set extractGeneralNames(Collection paramCollection)
    throws IOException
  {
    if ((paramCollection == null) || (paramCollection.isEmpty())) {
      return new HashSet();
    }
    HashSet localHashSet = new HashSet();
    Iterator localIterator = paramCollection.iterator();
    while (localIterator.hasNext()) {
      localHashSet.add(GeneralName.getInstance(localIterator.next()));
    }
    return localHashSet;
  }
  
  public X509AttributeCertificateHolderSelector build()
  {
    X509AttributeCertificateHolderSelector localX509AttributeCertificateHolderSelector = new X509AttributeCertificateHolderSelector(holder, issuer, serialNumber, attributeCertificateValid, attributeCert, Collections.unmodifiableCollection(new HashSet(targetNames)), Collections.unmodifiableCollection(new HashSet(targetGroups)));
    return localX509AttributeCertificateHolderSelector;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.X509AttributeCertificateHolderSelectorBuilder
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector;

import java.math.BigInteger;
import org.bouncycastle.asn1.ASN1Integer;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.cms.IssuerAndSerialNumber;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.Extension;
import org.bouncycastle.cert.X509CertificateHolder;
import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.Selector;

public class X509CertificateHolderSelector
  implements Selector
{
  private byte[] subjectKeyId;
  private X500Name issuer;
  private BigInteger serialNumber;
  
  public X509CertificateHolderSelector(byte[] paramArrayOfByte)
  {
    this(null, null, paramArrayOfByte);
  }
  
  public X509CertificateHolderSelector(X500Name paramX500Name, BigInteger paramBigInteger)
  {
    this(paramX500Name, paramBigInteger, null);
  }
  
  public X509CertificateHolderSelector(X500Name paramX500Name, BigInteger paramBigInteger, byte[] paramArrayOfByte)
  {
    issuer = paramX500Name;
    serialNumber = paramBigInteger;
    subjectKeyId = paramArrayOfByte;
  }
  
  public X500Name getIssuer()
  {
    return issuer;
  }
  
  public BigInteger getSerialNumber()
  {
    return serialNumber;
  }
  
  public byte[] getSubjectKeyIdentifier()
  {
    return Arrays.clone(subjectKeyId);
  }
  
  public int hashCode()
  {
    int i = Arrays.hashCode(subjectKeyId);
    if (serialNumber != null) {
      i ^= serialNumber.hashCode();
    }
    if (issuer != null) {
      i ^= issuer.hashCode();
    }
    return i;
  }
  
  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof X509CertificateHolderSelector)) {
      return false;
    }
    X509CertificateHolderSelector localX509CertificateHolderSelector = (X509CertificateHolderSelector)paramObject;
    return (Arrays.areEqual(subjectKeyId, subjectKeyId)) && (equalsObj(serialNumber, serialNumber)) && (equalsObj(issuer, issuer));
  }
  
  private boolean equalsObj(Object paramObject1, Object paramObject2)
  {
    return paramObject2 == null ? true : paramObject1 != null ? paramObject1.equals(paramObject2) : false;
  }
  
  public boolean match(Object paramObject)
  {
    if ((paramObject instanceof X509CertificateHolder))
    {
      X509CertificateHolder localX509CertificateHolder = (X509CertificateHolder)paramObject;
      Object localObject;
      if (getSerialNumber() != null)
      {
        localObject = new IssuerAndSerialNumber(localX509CertificateHolder.toASN1Structure());
        return (((IssuerAndSerialNumber)localObject).getName().equals(issuer)) && (((IssuerAndSerialNumber)localObject).getSerialNumber().getValue().equals(serialNumber));
      }
      if (subjectKeyId != null)
      {
        localObject = localX509CertificateHolder.getExtension(Extension.subjectKeyIdentifier);
        if (localObject == null) {
          return Arrays.areEqual(subjectKeyId, MSOutlookKeyIdCalculator.calculateKeyId(localX509CertificateHolder.getSubjectPublicKeyInfo()));
        }
        byte[] arrayOfByte = ASN1OctetString.getInstance(((Extension)localObject).getParsedValue()).getOctets();
        return Arrays.areEqual(subjectKeyId, arrayOfByte);
      }
    }
    else if ((paramObject instanceof byte[]))
    {
      return Arrays.areEqual(subjectKeyId, (byte[])paramObject);
    }
    return false;
  }
  
  public Object clone()
  {
    return new X509CertificateHolderSelector(issuer, serialNumber, subjectKeyId);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.X509CertificateHolderSelector
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector.jcajce;

import java.io.IOException;
import java.security.cert.X509CertSelector;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.cert.selector.X509CertificateHolderSelector;

public class JcaSelectorConverter
{
  public X509CertificateHolderSelector getCertificateHolderSelector(X509CertSelector paramX509CertSelector)
  {
    try
    {
      if (paramX509CertSelector.getSubjectKeyIdentifier() != null) {
        return new X509CertificateHolderSelector(X500Name.getInstance(paramX509CertSelector.getIssuerAsBytes()), paramX509CertSelector.getSerialNumber(), ASN1OctetString.getInstance(paramX509CertSelector.getSubjectKeyIdentifier()).getOctets());
      }
      return new X509CertificateHolderSelector(X500Name.getInstance(paramX509CertSelector.getIssuerAsBytes()), paramX509CertSelector.getSerialNumber());
    }
    catch (IOException localIOException)
    {
      throw new IllegalArgumentException("unable to convert issuer: " + localIOException.getMessage());
    }
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.jcajce.JcaSelectorConverter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector.jcajce;

import java.io.IOException;
import java.math.BigInteger;
import java.security.cert.X509CertSelector;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.cert.selector.X509CertificateHolderSelector;

public class JcaX509CertSelectorConverter
{
  protected X509CertSelector doConversion(X500Name paramX500Name, BigInteger paramBigInteger, byte[] paramArrayOfByte)
  {
    X509CertSelector localX509CertSelector = new X509CertSelector();
    if (paramX500Name != null) {
      try
      {
        localX509CertSelector.setIssuer(paramX500Name.getEncoded());
      }
      catch (IOException localIOException1)
      {
        throw new IllegalArgumentException("unable to convert issuer: " + localIOException1.getMessage());
      }
    }
    if (paramBigInteger != null) {
      localX509CertSelector.setSerialNumber(paramBigInteger);
    }
    if (paramArrayOfByte != null) {
      try
      {
        localX509CertSelector.setSubjectKeyIdentifier(new DEROctetString(paramArrayOfByte).getEncoded());
      }
      catch (IOException localIOException2)
      {
        throw new IllegalArgumentException("unable to convert issuer: " + localIOException2.getMessage());
      }
    }
    return localX509CertSelector;
  }
  
  public X509CertSelector getCertSelector(X509CertificateHolderSelector paramX509CertificateHolderSelector)
  {
    return doConversion(paramX509CertificateHolderSelector.getIssuer(), paramX509CertificateHolderSelector.getSerialNumber(), paramX509CertificateHolderSelector.getSubjectKeyIdentifier());
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.jcajce.JcaX509CertSelectorConverter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cert.selector.jcajce;

import java.math.BigInteger;
import java.security.cert.X509Certificate;
import javax.security.auth.x500.X500Principal;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.X509Extension;
import org.bouncycastle.cert.selector.X509CertificateHolderSelector;

public class JcaX509CertificateHolderSelector
  extends X509CertificateHolderSelector
{
  public JcaX509CertificateHolderSelector(X509Certificate paramX509Certificate)
  {
    super(convertPrincipal(paramX509Certificate.getIssuerX500Principal()), paramX509Certificate.getSerialNumber(), getSubjectKeyId(paramX509Certificate));
  }
  
  public JcaX509CertificateHolderSelector(X500Principal paramX500Principal, BigInteger paramBigInteger)
  {
    super(convertPrincipal(paramX500Principal), paramBigInteger);
  }
  
  public JcaX509CertificateHolderSelector(X500Principal paramX500Principal, BigInteger paramBigInteger, byte[] paramArrayOfByte)
  {
    super(convertPrincipal(paramX500Principal), paramBigInteger, paramArrayOfByte);
  }
  
  private static X500Name convertPrincipal(X500Principal paramX500Principal)
  {
    if (paramX500Principal == null) {
      return null;
    }
    return X500Name.getInstance(paramX500Principal.getEncoded());
  }
  
  private static byte[] getSubjectKeyId(X509Certificate paramX509Certificate)
  {
    byte[] arrayOfByte = paramX509Certificate.getExtensionValue(X509Extension.subjectKeyIdentifier.getId());
    if (arrayOfByte != null) {
      return ASN1OctetString.getInstance(ASN1OctetString.getInstance(arrayOfByte).getOctets()).getOctets();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cert.selector.jcajce.JcaX509CertificateHolderSelector
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cms;

import org.bouncycastle.asn1.ASN1Set;

abstract interface AuthAttributesProvider
{
  public abstract ASN1Set getAuthAttributes();
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.cms.CMSObjectIdentifiers;

public class CMSAbsentContent
  implements CMSTypedData, CMSReadable
{
  private final ASN1ObjectIdentifier type;
  
  public CMSAbsentContent()
  {
    this(new ASN1ObjectIdentifier(CMSObjectIdentifiers.data.getId()));
  }
  
  public CMSAbsentContent(ASN1ObjectIdentifier paramASN1ObjectIdentifier)
  {
    type = paramASN1ObjectIdentifier;
  }
  
  public InputStream getInputStream()
  {
    return null;
  }
  
  public void write(OutputStream paramOutputStream)
    throws IOException, CMSException
  {}
  
  public Object getContent()
  {
    return null;
  }
  
  public ASN1ObjectIdentifier getContentType()
  {
    return type;
  }
}

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

import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;
import org.bouncycastle.asn1.kisa.KISAObjectIdentifiers;
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
import org.bouncycastle.asn1.ntt.NTTObjectIdentifiers;
import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers;
import org.bouncycastle.asn1.x9.X9ObjectIdentifiers;

public class CMSAlgorithm
{
  public static final ASN1ObjectIdentifier DES_EDE3_CBC = PKCSObjectIdentifiers.des_EDE3_CBC;
  public static final ASN1ObjectIdentifier RC2_CBC = PKCSObjectIdentifiers.RC2_CBC;
  public static final ASN1ObjectIdentifier IDEA_CBC = new ASN1ObjectIdentifier("1.3.6.1.4.1.188.7.1.1.2");
  public static final ASN1ObjectIdentifier CAST5_CBC = new ASN1ObjectIdentifier("1.2.840.113533.7.66.10");
  public static final ASN1ObjectIdentifier AES128_CBC = NISTObjectIdentifiers.id_aes128_CBC;
  public static final ASN1ObjectIdentifier AES192_CBC = NISTObjectIdentifiers.id_aes192_CBC;
  public static final ASN1ObjectIdentifier AES256_CBC = NISTObjectIdentifiers.id_aes256_CBC;
  public static final ASN1ObjectIdentifier CAMELLIA128_CBC = NTTObjectIdentifiers.id_camellia128_cbc;
  public static final ASN1ObjectIdentifier CAMELLIA192_CBC = NTTObjectIdentifiers.id_camellia192_cbc;
  public static final ASN1ObjectIdentifier CAMELLIA256_CBC = NTTObjectIdentifiers.id_camellia256_cbc;
  public static final ASN1ObjectIdentifier SEED_CBC = KISAObjectIdentifiers.id_seedCBC;
  public static final ASN1ObjectIdentifier DES_EDE3_WRAP = PKCSObjectIdentifiers.id_alg_CMS3DESwrap;
  public static final ASN1ObjectIdentifier AES128_WRAP = NISTObjectIdentifiers.id_aes128_wrap;
  public static final ASN1ObjectIdentifier AES192_WRAP = NISTObjectIdentifiers.id_aes192_wrap;
  public static final ASN1ObjectIdentifier AES256_WRAP = NISTObjectIdentifiers.id_aes256_wrap;
  public static final ASN1ObjectIdentifier CAMELLIA128_WRAP = NTTObjectIdentifiers.id_camellia128_wrap;
  public static final ASN1ObjectIdentifier CAMELLIA192_WRAP = NTTObjectIdentifiers.id_camellia192_wrap;
  public static final ASN1ObjectIdentifier CAMELLIA256_WRAP = NTTObjectIdentifiers.id_camellia256_wrap;
  public static final ASN1ObjectIdentifier SEED_WRAP = KISAObjectIdentifiers.id_npki_app_cmsSeed_wrap;
  public static final ASN1ObjectIdentifier ECDH_SHA1KDF = X9ObjectIdentifiers.dhSinglePass_stdDH_sha1kdf_scheme;
  public static final ASN1ObjectIdentifier ECMQV_SHA1KDF = X9ObjectIdentifiers.mqvSinglePass_sha1kdf_scheme;
  public static final ASN1ObjectIdentifier SHA1 = OIWObjectIdentifiers.idSHA1;
  public static final ASN1ObjectIdentifier SHA224 = NISTObjectIdentifiers.id_sha224;
  public static final ASN1ObjectIdentifier SHA256 = NISTObjectIdentifiers.id_sha256;
  public static final ASN1ObjectIdentifier SHA384 = NISTObjectIdentifiers.id_sha384;
  public static final ASN1ObjectIdentifier SHA512 = NISTObjectIdentifiers.id_sha512;
  public static final ASN1ObjectIdentifier MD5 = PKCSObjectIdentifiers.md5;
  public static final ASN1ObjectIdentifier GOST3411 = CryptoProObjectIdentifiers.gostR3411;
  public static final ASN1ObjectIdentifier RIPEMD128 = TeleTrusTObjectIdentifiers.ripemd128;
  public static final ASN1ObjectIdentifier RIPEMD160 = TeleTrusTObjectIdentifiers.ripemd160;
  public static final ASN1ObjectIdentifier RIPEMD256 = TeleTrusTObjectIdentifiers.ripemd256;
}

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

public class CMSAttributeTableGenerationException
  extends CMSRuntimeException
{
  Exception e;
  
  public CMSAttributeTableGenerationException(String paramString)
  {
    super(paramString);
  }
  
  public CMSAttributeTableGenerationException(String paramString, Exception paramException)
  {
    super(paramString);
    e = paramException;
  }
  
  public Exception getUnderlyingException()
  {
    return e;
  }
  
  public Throwable getCause()
  {
    return e;
  }
}

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

import java.util.Map;
import org.bouncycastle.asn1.cms.AttributeTable;

public abstract interface CMSAttributeTableGenerator
{
  public static final String CONTENT_TYPE = "contentType";
  public static final String DIGEST = "digest";
  public static final String SIGNATURE = "encryptedDigest";
  public static final String DIGEST_ALGORITHM_IDENTIFIER = "digestAlgID";
  
  public abstract AttributeTable getAttributes(Map paramMap)
    throws CMSAttributeTableGenerationException;
}

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

import java.io.IOException;
import java.io.InputStream;

class CMSAuthEnvelopedData$1
  implements CMSSecureReadable
{
  CMSAuthEnvelopedData$1(CMSAuthEnvelopedData paramCMSAuthEnvelopedData) {}
  
  public InputStream getInputStream()
    throws IOException, CMSException
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cms.CMSAuthEnvelopedData.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cms;

import java.io.IOException;
import java.io.InputStream;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Set;
import org.bouncycastle.asn1.cms.AuthEnvelopedData;
import org.bouncycastle.asn1.cms.ContentInfo;
import org.bouncycastle.asn1.cms.EncryptedContentInfo;
import org.bouncycastle.asn1.cms.OriginatorInfo;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;

class CMSAuthEnvelopedData
{
  RecipientInformationStore recipientInfoStore;
  ContentInfo contentInfo;
  private OriginatorInfo originator;
  private AlgorithmIdentifier authEncAlg;
  private ASN1Set authAttrs;
  private byte[] mac;
  private ASN1Set unauthAttrs;
  
  public CMSAuthEnvelopedData(byte[] paramArrayOfByte)
    throws CMSException
  {
    this(CMSUtils.readContentInfo(paramArrayOfByte));
  }
  
  public CMSAuthEnvelopedData(InputStream paramInputStream)
    throws CMSException
  {
    this(CMSUtils.readContentInfo(paramInputStream));
  }
  
  public CMSAuthEnvelopedData(ContentInfo paramContentInfo)
    throws CMSException
  {
    contentInfo = paramContentInfo;
    AuthEnvelopedData localAuthEnvelopedData = AuthEnvelopedData.getInstance(paramContentInfo.getContent());
    originator = localAuthEnvelopedData.getOriginatorInfo();
    ASN1Set localASN1Set = localAuthEnvelopedData.getRecipientInfos();
    EncryptedContentInfo localEncryptedContentInfo = localAuthEnvelopedData.getAuthEncryptedContentInfo();
    authEncAlg = localEncryptedContentInfo.getContentEncryptionAlgorithm();
    CMSSecureReadable local1 = new CMSSecureReadable()
    {
      public InputStream getInputStream()
        throws IOException, CMSException
      {
        return null;
      }
    };
    recipientInfoStore = CMSEnvelopedHelper.buildRecipientInformationStore(localASN1Set, authEncAlg, local1);
    authAttrs = localAuthEnvelopedData.getAuthAttrs();
    mac = localAuthEnvelopedData.getMac().getOctets();
    unauthAttrs = localAuthEnvelopedData.getUnauthAttrs();
  }
}

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

import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;

class CMSAuthEnvelopedGenerator
{
  public static final String AES128_CCM = NISTObjectIdentifiers.id_aes128_CCM.getId();
  public static final String AES192_CCM = NISTObjectIdentifiers.id_aes192_CCM.getId();
  public static final String AES256_CCM = NISTObjectIdentifiers.id_aes256_CCM.getId();
  public static final String AES128_GCM = NISTObjectIdentifiers.id_aes128_GCM.getId();
  public static final String AES192_GCM = NISTObjectIdentifiers.id_aes192_GCM.getId();
  public static final String AES256_GCM = NISTObjectIdentifiers.id_aes256_GCM.getId();
}

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

import org.bouncycastle.asn1.ASN1Set;

class CMSAuthenticatedData$1
  implements AuthAttributesProvider
{
  CMSAuthenticatedData$1(CMSAuthenticatedData paramCMSAuthenticatedData) {}
  
  public ASN1Set getAuthAttributes()
  {
    return CMSAuthenticatedData.access$000(this$0);
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cms.CMSAuthenticatedData.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cms;

import java.io.IOException;
import java.io.InputStream;
import java.security.AlgorithmParameters;
import java.security.NoSuchProviderException;
import java.security.Provider;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Set;
import org.bouncycastle.asn1.cms.Attribute;
import org.bouncycastle.asn1.cms.AttributeTable;
import org.bouncycastle.asn1.cms.AuthenticatedData;
import org.bouncycastle.asn1.cms.CMSAttributes;
import org.bouncycastle.asn1.cms.ContentInfo;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.cms.jcajce.JceAlgorithmIdentifierConverter;
import org.bouncycastle.operator.DigestCalculatorProvider;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.util.Arrays;

public class CMSAuthenticatedData
{
  RecipientInformationStore recipientInfoStore;
  ContentInfo contentInfo;
  private AlgorithmIdentifier macAlg;
  private ASN1Set authAttrs;
  private ASN1Set unauthAttrs;
  private byte[] mac;
  private OriginatorInformation originatorInfo;
  
  public CMSAuthenticatedData(byte[] paramArrayOfByte)
    throws CMSException
  {
    this(CMSUtils.readContentInfo(paramArrayOfByte));
  }
  
  public CMSAuthenticatedData(byte[] paramArrayOfByte, DigestCalculatorProvider paramDigestCalculatorProvider)
    throws CMSException
  {
    this(CMSUtils.readContentInfo(paramArrayOfByte), paramDigestCalculatorProvider);
  }
  
  public CMSAuthenticatedData(InputStream paramInputStream)
    throws CMSException
  {
    this(CMSUtils.readContentInfo(paramInputStream));
  }
  
  public CMSAuthenticatedData(InputStream paramInputStream, DigestCalculatorProvider paramDigestCalculatorProvider)
    throws CMSException
  {
    this(CMSUtils.readContentInfo(paramInputStream), paramDigestCalculatorProvider);
  }
  
  public CMSAuthenticatedData(ContentInfo paramContentInfo)
    throws CMSException
  {
    this(paramContentInfo, null);
  }
  
  public CMSAuthenticatedData(ContentInfo paramContentInfo, DigestCalculatorProvider paramDigestCalculatorProvider)
    throws CMSException
  {
    contentInfo = paramContentInfo;
    AuthenticatedData localAuthenticatedData = AuthenticatedData.getInstance(paramContentInfo.getContent());
    if (localAuthenticatedData.getOriginatorInfo() != null) {
      originatorInfo = new OriginatorInformation(localAuthenticatedData.getOriginatorInfo());
    }
    ASN1Set localASN1Set = localAuthenticatedData.getRecipientInfos();
    macAlg = localAuthenticatedData.getMacAlgorithm();
    authAttrs = localAuthenticatedData.getAuthAttrs();
    mac = localAuthenticatedData.getMac().getOctets();
    unauthAttrs = localAuthenticatedData.getUnauthAttrs();
    ContentInfo localContentInfo = localAuthenticatedData.getEncapsulatedContentInfo();
    CMSProcessableByteArray localCMSProcessableByteArray = new CMSProcessableByteArray(ASN1OctetString.getInstance(localContentInfo.getContent()).getOctets());
    if (authAttrs != null)
    {
      if (paramDigestCalculatorProvider == null) {
        throw new CMSException("a digest calculator provider is required if authenticated attributes are present");
      }
      try
      {
        CMSEnvelopedHelper.CMSDigestAuthenticatedSecureReadable localCMSDigestAuthenticatedSecureReadable = new CMSEnvelopedHelper.CMSDigestAuthenticatedSecureReadable(paramDigestCalculatorProvider.get(localAuthenticatedData.getDigestAlgorithm()), localCMSProcessableByteArray);
        recipientInfoStore = CMSEnvelopedHelper.buildRecipientInformationStore(localASN1Set, macAlg, localCMSDigestAuthenticatedSecureReadable, new AuthAttributesProvider()
        {
          public ASN1Set getAuthAttributes()
          {
            return authAttrs;
          }
        });
      }
      catch (OperatorCreationException localOperatorCreationException)
      {
        throw new CMSException("unable to create digest calculator: " + localOperatorCreationException.getMessage(), localOperatorCreationException);
      }
    }
    else
    {
      CMSEnvelopedHelper.CMSAuthenticatedSecureReadable localCMSAuthenticatedSecureReadable = new CMSEnvelopedHelper.CMSAuthenticatedSecureReadable(macAlg, localCMSProcessableByteArray);
      recipientInfoStore = CMSEnvelopedHelper.buildRecipientInformationStore(localASN1Set, macAlg, localCMSAuthenticatedSecureReadable);
    }
  }
  
  public OriginatorInformation getOriginatorInfo()
  {
    return originatorInfo;
  }
  
  public byte[] getMac()
  {
    return Arrays.clone(mac);
  }
  
  private byte[] encodeObj(ASN1Encodable paramASN1Encodable)
    throws IOException
  {
    if (paramASN1Encodable != null) {
      return paramASN1Encodable.toASN1Primitive().getEncoded();
    }
    return null;
  }
  
  public AlgorithmIdentifier getMacAlgorithm()
  {
    return macAlg;
  }
  
  public String getMacAlgOID()
  {
    return macAlg.getObjectId().getId();
  }
  
  public byte[] getMacAlgParams()
  {
    try
    {
      return encodeObj(macAlg.getParameters());
    }
    catch (Exception localException)
    {
      throw new RuntimeException("exception getting encryption parameters " + localException);
    }
  }
  
  /**
   * @deprecated
   */
  public AlgorithmParameters getMacAlgorithmParameters(String paramString)
    throws CMSException, NoSuchProviderException
  {
    return new JceAlgorithmIdentifierConverter().setProvider(paramString).getAlgorithmParameters(macAlg);
  }
  
  /**
   * @deprecated
   */
  public AlgorithmParameters getMacAlgorithmParameters(Provider paramProvider)
    throws CMSException
  {
    return new JceAlgorithmIdentifierConverter().setProvider(paramProvider).getAlgorithmParameters(macAlg);
  }
  
  public RecipientInformationStore getRecipientInfos()
  {
    return recipientInfoStore;
  }
  
  public ContentInfo getContentInfo()
  {
    return contentInfo;
  }
  
  public AttributeTable getAuthAttrs()
  {
    if (authAttrs == null) {
      return null;
    }
    return new AttributeTable(authAttrs);
  }
  
  public AttributeTable getUnauthAttrs()
  {
    if (unauthAttrs == null) {
      return null;
    }
    return new AttributeTable(unauthAttrs);
  }
  
  public byte[] getEncoded()
    throws IOException
  {
    return contentInfo.getEncoded();
  }
  
  public byte[] getContentDigest()
  {
    if (authAttrs != null) {
      return ASN1OctetString.getInstance(getAuthAttrs().get(CMSAttributes.messageDigest).getAttrValues().getObjectAt(0)).getOctets();
    }
    return null;
  }
}

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

import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.operator.DigestCalculator;
import org.bouncycastle.operator.DigestCalculatorProvider;
import org.bouncycastle.operator.OperatorCreationException;

class CMSAuthenticatedDataGenerator$1
  implements DigestCalculatorProvider
{
  CMSAuthenticatedDataGenerator$1(CMSAuthenticatedDataGenerator paramCMSAuthenticatedDataGenerator, DigestCalculator paramDigestCalculator) {}
  
  public DigestCalculator get(AlgorithmIdentifier paramAlgorithmIdentifier)
    throws OperatorCreationException
  {
    return val$digestCalculator;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cms.CMSAuthenticatedDataGenerator.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cms;

import java.io.IOException;
import java.io.OutputStream;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.cms.CMSObjectIdentifiers;

class CMSAuthenticatedDataGenerator$2
  implements CMSTypedData
{
  CMSAuthenticatedDataGenerator$2(CMSAuthenticatedDataGenerator paramCMSAuthenticatedDataGenerator, CMSProcessable paramCMSProcessable)
    throws CMSException, IOException
  {}
  
  public ASN1ObjectIdentifier getContentType()
  {
    return CMSObjectIdentifiers.data;
  }
  
  public void write(OutputStream paramOutputStream)
    throws IOException, CMSException
  {
    val$content.write(paramOutputStream);
  }
  
  public Object getContent()
  {
    return val$content;
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.cms.CMSAuthenticatedDataGenerator.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.bouncycastle.cms;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
import java.security.SecureRandom;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.crypto.KeyGenerator;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Set;
import org.bouncycastle.asn1.BEROctetString;
import org.bouncycastle.asn1.BERSet;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.asn1.DERSet;
import org.bouncycastle.asn1.cms.AttributeTable;
import org.bouncycastle.asn1.cms.AuthenticatedData;
import org.bouncycastle.asn1.cms.CMSObjectIdentifiers;
import org.bouncycastle.asn1.cms.ContentInfo;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
import org.bouncycastle.cms
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

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