1 2 package com.ca.commons.security.cert.extensions; 3 4 import java.util.Hashtable ; 5 import com.ca.commons.security.asn1.*; 6 7 27 public class ExtendedKeyUsage implements V3Extension 28 { 29 String value = null; 30 31 public void init(ASN1Object asn1object) throws Exception 32 { 33 if (!asn1object.isASN1Type(ASN1Type.SEQUENCE)) 34 throw new Exception ("Wrong ASN.1 type for ExtendedKeyUsage"); 35 36 for (int i = 0; i < asn1object.size(); i++) 37 { 38 Object pur = asn1object.getComponent(i).getValue(); 39 if ( pur instanceof String ) { String spur = (String ) pur; 41 spur = ASN1OID.getName(spur); 42 if (spur != null) { 43 if (value == null) 44 value = spur; 45 else 46 value = value + "\n" + spur; 47 } 48 } 49 } 50 } 51 52 public String toString() 53 { 54 return value; 55 } 56 } 57 58 | Popular Tags |