AttributeTable.java
资源名称:security.rar [点击查看]
上传用户:lior1029
上传日期:2013-05-07
资源大小:209k
文件大小:1k
源码类别:
CA认证
开发平台:
Java
- package org.bouncycastle.asn1.cms;
- import java.util.Hashtable;
- import org.bouncycastle.asn1.ASN1Set;
- import org.bouncycastle.asn1.DERObjectIdentifier;
- import org.bouncycastle.asn1.DEREncodableVector;
- public class AttributeTable
- {
- private Hashtable attributes = new Hashtable();
- public AttributeTable(
- Hashtable attrs)
- {
- attributes = new Hashtable(attrs);
- }
- public AttributeTable(
- DEREncodableVector v)
- {
- for (int i = 0; i != v.size(); i++)
- {
- Attribute a = Attribute.getInstance(v.get(i));
- attributes.put(a.getAttrType(), a);
- }
- }
- public AttributeTable(
- ASN1Set s)
- {
- for (int i = 0; i != s.size(); i++)
- {
- Attribute a = Attribute.getInstance(s.getObjectAt(i));
- attributes.put(a.getAttrType(), a);
- }
- }
- public Attribute get(
- DERObjectIdentifier oid)
- {
- return (Attribute)attributes.get(oid);
- }
- public Hashtable toHashtable()
- {
- return new Hashtable(attributes);
- }
- }