1 // Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
2 // Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
3 // Decompiler options: packimports(3)
4 // Source File Name: SignedAttributes.java
6 package org.bouncycastle.asn1.cms;
8 import java.util.Vector;
9 import org.bouncycastle.asn1.*;
11 // Referenced classes of package org.bouncycastle.asn1.cms:
14 public class SignedAttributes
15 implements DEREncodable
18 public SignedAttributes(Vector vector)
20 setAttributes(vector);
23 public SignedAttributes(DERConstructedSet derconstructedset)
25 attributes = derconstructedset;
28 public SignedAttributes(SignedAttributes signedattributes)
30 attributes = signedattributes.attributes;
33 public static SignedAttributes getInstance(Object obj)
37 if(obj instanceof SignedAttributes)
38 return (SignedAttributes)obj;
39 if(obj instanceof DERConstructedSet)
40 return new SignedAttributes((DERConstructedSet)obj);
41 if(obj instanceof DERTaggedObject)
42 return getInstance(((DERTaggedObject)obj).getObject());
44 throw new IllegalArgumentException("Invalid SignedAttributes");
47 public static SignedAttributes newInstance(Object obj)
51 if(obj instanceof SignedAttributes)
52 return new SignedAttributes((SignedAttributes)obj);
53 if(obj instanceof DERConstructedSet)
54 return new SignedAttributes((DERConstructedSet)obj);
55 if(obj instanceof DERTaggedObject)
56 return getInstance(((DERTaggedObject)obj).getObject());
58 throw new IllegalArgumentException("Invalid SignedAttributes");
61 public Vector getAttributes()
63 int i = attributes.getSize();
64 Vector vector = new Vector();
65 for(int j = 0; j < i; j++)
66 vector.addElement(Attribute.getInstance(attributes.getObjectAt(j)));
71 private void setAttributes(Vector vector)
73 int i = vector.size();
74 attributes = new DERConstructedSet();
75 for(int j = 0; j < i; j++)
76 attributes.addObject(Attribute.getInstance(vector.elementAt(j)));
80 public DERObject getDERObject()
85 private DERConstructedSet attributes;