bcpkix-jdk15on-147

 hash: " + localIOException.getMessage(), localIOException);
    }
  }
  
  void validate(DigestCalculatorProvider paramDigestCalculatorProvider, byte[] paramArrayOfByte)
    throws ImprintDigestInvalidException, CMSException
  {
    byte[] arrayOfByte = paramArrayOfByte;
    for (int i = 0; i < timeStamps.length; i++) {
      try
      {
        TimeStampToken localTimeStampToken = getTimeStampToken(timeStamps[i]);
        if (i > 0)
        {
          TimeStampTokenInfo localTimeStampTokenInfo = localTimeStampToken.getTimeStampInfo();
          DigestCalculator localDigestCalculator = paramDigestCalculatorProvider.get(localTimeStampTokenInfo.getHashAlgorithm());
          localDigestCalculator.getOutputStream().write(timeStamps[(i - 1)].getEncoded("DER"));
          arrayOfByte = localDigestCalculator.getDigest();
        }
        compareDigest(localTimeStampToken, arrayOfByte);
      }
      catch (IOException localIOException)
      {
        throw new CMSException("exception calculating hash: " + localIOException.getMessage(), localIOException);
      }
      catch (OperatorCreationException localOperatorCreationException)
      {
        throw new CMSException("cannot create digest: " + localOperatorCreationException.getMessage(), localOperatorCreationException);
      }
    }
  }
  
  void validate(DigestCalculatorProvider paramDigestCalculatorProvider, byte[] paramArrayOfByte, TimeStampToken paramTimeStampToken)
    throws ImprintDigestInvalidException, CMSException
  {
    byte[] arrayOfByte1 = paramArrayOfByte;
    byte[] arrayOfByte2;
    try
    {
      arrayOfByte2 = paramTimeStampToken.getEncoded();
    }
    catch (IOException localIOException1)
    {
      throw new CMSException("exception encoding timeStampToken: " + localIOException1.getMessage(), localIOException1);
    }
    for (int i = 0; i < timeStamps.length; i++) {
      try
      {
        TimeStampToken localTimeStampToken = getTimeStampToken(timeStamps[i]);
        if (i > 0)
        {
          TimeStampTokenInfo localTimeStampTokenInfo = localTimeStampToken.getTimeStampInfo();
          DigestCalculator localDigestCalculator = paramDigestCalculatorProvider.get(localTimeStampTokenInfo.getHashAlgorithm());
          localDigestCalculator.getOutputStream().write(timeStamps[(i - 1)].getEncoded("DER"));
          arrayOfByte1 = localDigestCalculator.getDigest();
        }
        compareDigest(localTimeStampToken, arrayOfByte1);
        if (Arrays.areEqual(localTimeStampToken.getEncoded(), arrayOfByte2)) {
          return;
        }
      }
      catch (IOException localIOException2)
      {
        throw new CMSException("exception calculating hash: " + localIOException2.getMessage(), localIOException2);
      }
      catch (OperatorCreationException localOperatorCreationException)
      {
        throw new CMSException("cannot create digest: " + localOperatorCreationException.getMessage(), localOperatorCreationException);
      }
    }
    throw new ImprintDigestInvalidException("passed in token not associated with timestamps present", paramTimeStampToken);
  }
  
  private void compareDigest(TimeStampToken paramTimeStampToken, byte[] paramArrayOfByte)
    throws ImprintDigestInvalidException
  {
    TimeStampTokenInfo localTimeStampTokenInfo = paramTimeStampToken.getTimeStampInfo();
    byte[] arrayOfByte = localTimeStampTokenInfo.getMessageImprintDigest();
    if (!Arrays.areEqual(paramArrayOfByte, arrayOfByte)) {
      throw new ImprintDigestInvalidException("hash calculated is different from MessageImprintDigest found in TimeStampToken", paramTimeStampToken);
    }
  }
  
  String getFileName()
  {
    return metaDataUtil.getFileName();
  }
  
  String getMediaType()
  {
    return metaDataUtil.getMediaType();
  }
  
  AttributeTable getOtherMetaData()
  {
    return new AttributeTable(metaDataUtil.getOtherMetaData());
  }
}

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

public class VOMSAttribute$FQAN
{
  String fqan;
  String group;
  String role;
  String capability;
  
  public VOMSAttribute$FQAN(VOMSAttribute paramVOMSAttribute, String paramString)
  {
    fqan = paramString;
  }
  
  public VOMSAttribute$FQAN(VOMSAttribute paramVOMSAttribute, String paramString1, String paramString2, String paramString3)
  {
    group = paramString1;
    role = paramString2;
    capability = paramString3;
  }
  
  public String getFQAN()
  {
    if (fqan != null) {
      return fqan;
    }
    fqan = (group + "/Role=" + (role != null ? role : "") + (capability != null ? "/Capability=" + capability : ""));
    return fqan;
  }
  
  protected void split()
  {
    int i = fqan.length();
    int j = fqan.indexOf("/Role=");
    if (j < 0) {
      return;
    }
    group = fqan.substring(0, j);
    int k = fqan.indexOf("/Capability=", j + 6);
    String str = k < 0 ? fqan.substring(j + 6) : fqan.substring(j + 6, k);
    role = (str.length() == 0 ? null : str);
    str = k < 0 ? null : fqan.substring(k + 12);
    capability = ((str == null) || (str.length() == 0) ? null : str);
  }
  
  public String getGroup()
  {
    if ((group == null) && (fqan != null)) {
      split();
    }
    return group;
  }
  
  public String getRole()
  {
    if ((group == null) && (fqan != null)) {
      split();
    }
    return role;
  }
  
  public String getCapability()
  {
    if ((group == null) && (fqan != null)) {
      split();
    }
    return capability;
  }
  
  public String toString()
  {
    return getFQAN();
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.DERIA5String;
import org.bouncycastle.asn1.x509.GeneralName;
import org.bouncycastle.asn1.x509.IetfAttrSyntax;
import org.bouncycastle.x509.X509Attribute;
import org.bouncycastle.x509.X509AttributeCertificate;

public class VOMSAttribute
{
  public static final String VOMS_ATTR_OID = "1.3.6.1.4.1.8005.100.100.4";
  private X509AttributeCertificate myAC;
  private String myHostPort;
  private String myVo;
  private List myStringList = new ArrayList();
  private List myFQANs = new ArrayList();
  
  public VOMSAttribute(X509AttributeCertificate paramX509AttributeCertificate)
  {
    if (paramX509AttributeCertificate == null) {
      throw new IllegalArgumentException("VOMSAttribute: AttributeCertificate is NULL");
    }
    myAC = paramX509AttributeCertificate;
    X509Attribute[] arrayOfX509Attribute = paramX509AttributeCertificate.getAttributes("1.3.6.1.4.1.8005.100.100.4");
    if (arrayOfX509Attribute == null) {
      return;
    }
    try
    {
      for (int i = 0; i != arrayOfX509Attribute.length; i++)
      {
        IetfAttrSyntax localIetfAttrSyntax = IetfAttrSyntax.getInstance(arrayOfX509Attribute[i].getValues()[0]);
        String str1 = ((DERIA5String)localIetfAttrSyntax.getPolicyAuthority().getNames()[0].getName()).getString();
        int j = str1.indexOf("://");
        if ((j < 0) || (j == str1.length() - 1)) {
          throw new IllegalArgumentException("Bad encoding of VOMS policyAuthority : [" + str1 + "]");
        }
        myVo = str1.substring(0, j);
        myHostPort = str1.substring(j + 3);
        if (localIetfAttrSyntax.getValueType() != 1) {
          throw new IllegalArgumentException("VOMS attribute values are not encoded as octet strings, policyAuthority = " + str1);
        }
        ASN1OctetString[] arrayOfASN1OctetString = (ASN1OctetString[])localIetfAttrSyntax.getValues();
        for (int k = 0; k != arrayOfASN1OctetString.length; k++)
        {
          String str2 = new String(arrayOfASN1OctetString[k].getOctets());
          FQAN localFQAN = new FQAN(str2);
          if ((!myStringList.contains(str2)) && (str2.startsWith("/" + myVo + "/")))
          {
            myStringList.add(str2);
            myFQANs.add(localFQAN);
          }
        }
      }
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw localIllegalArgumentException;
    }
    catch (Exception localException)
    {
      throw new IllegalArgumentException("Badly encoded VOMS extension in AC issued by " + paramX509AttributeCertificate.getIssuer());
    }
  }
  
  public X509AttributeCertificate getAC()
  {
    return myAC;
  }
  
  public List getFullyQualifiedAttributes()
  {
    return myStringList;
  }
  
  public List getListOfFQAN()
  {
    return myFQANs;
  }
  
  public String getHostPort()
  {
    return myHostPort;
  }
  
  public String getVO()
  {
    return myVo;
  }
  
  public String toString()
  {
    return "VO      :" + myVo + "\n" + "HostPort:" + myHostPort + "\n" + "FQANs   :" + myFQANs;
  }
  
  public class FQAN
  {
    String fqan;
    String group;
    String role;
    String capability;
    
    public FQAN(String paramString)
    {
      fqan = paramString;
    }
    
    public FQAN(String paramString1, String paramString2, String paramString3)
    {
      group = paramString1;
      role = paramString2;
      capability = paramString3;
    }
    
    public String getFQAN()
    {
      if (fqan != null) {
        return fqan;
      }
      fqan = (group + "/Role=" + (role != null ? role : "") + (capability != null ? "/Capability=" + capability : ""));
      return fqan;
    }
    
    protected void split()
    {
      int i = fqan.length();
      int j = fqan.indexOf("/Role=");
      if (j < 0) {
        return;
      }
      group = fqan.substring(0, j);
      int k = fqan.indexOf("/Capability=", j + 6);
      String str = k < 0 ? fqan.substring(j + 6) : fqan.substring(j + 6, k);
      role = (str.length() == 0 ? null : str);
      str = k < 0 ? null : fqan.substring(k + 12);
      capability = ((str == null) || (str.length() == 0) ? null : str);
    }
    
    public String getGroup()
    {
      if ((group == null) && (fqan != null)) {
        split();
      }
      return group;
    }
    
    public String getRole()
    {
      if ((group == null) && (fqan != null)) {
        split();
      }
      return role;
    }
    
    public String getCapability()
    {
      if ((group == null) && (fqan != null)) {
        split();
      }
      return capability;
    }
    
    public String toString()
    {
      return getFQAN();
    }
  }
}

/* Location:
 * Qualified Name:     org.bouncycastle.voms.VOMSAttribute
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
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-2017. Infinite Loop Ltd