1 2 package com.ca.commons.security.cert.extensions; 3 4 import com.ca.commons.security.asn1.*; 5 6 19 public class PolicyMappings implements V3Extension 20 { 21 String value = null; 22 23 public void init(ASN1Object asn1object) throws Exception 24 { 25 if (!asn1object.isASN1Type(ASN1Type.SEQUENCE)) 26 throw new Exception ("Wrong ASN.1 type for PolicyMappings"); 27 28 for (int i = 0; i < asn1object.size(); i++) 29 { 30 Sequence seq = (Sequence) asn1object.getComponent(i); 31 for (int j = 0; j < seq.size(); j++) 32 { 33 ASN1Object nextComp = seq.getComponent(j); 34 String certPolicyID = nextComp.getValue().toString(); 35 36 if (j == 0) 37 { 38 if (value == null) 39 value = "Issuer Domain Policy: " + certPolicyID; 40 else 41 value = value + "\n" + "Issuer Domain Policy: " + certPolicyID; 42 } 43 else if (j == 1) 44 { 45 value = value + "\n" + "Subject Domain Policy: " + certPolicyID; 46 } 47 } 48 } 49 } 50 51 public String toString() 52 { 53 return value; 54 } 55 } 56 57 | Popular Tags |