public static String toString(PolicyInformation policyInformation) throws IOException {
  StringBuffer sbPolicyInformation=new StringBuffer();
  ASN1ObjectIdentifier policyIdentifier=policyInformation.getPolicyIdentifier();
  sbPolicyInformation.append(MessageFormat.format(res.getString("PolicyInformationUtil.PolicyIdentifier"),policyIdentifier.getId()));
  ASN1Sequence policyQualifiers=policyInformation.getPolicyQualifiers();
  if (policyQualifiers != null) {
    sbPolicyInformation.append(", ");
    StringBuffer sbPolicyQualifiers=new StringBuffer();
    for (int i=0; i < policyQualifiers.size(); i++) {
      PolicyQualifierInfo policyQualifierInfo=PolicyQualifierInfo.getInstance(policyQualifiers.getObjectAt(i));
      sbPolicyQualifiers.append(toString(policyQualifierInfo));
      if ((i + 1) < policyQualifiers.size()) {
        sbPolicyQualifiers.append(", ");
      }
    }
    sbPolicyInformation.append(MessageFormat.format(res.getString("PolicyInformationUtil.PolicyQualifiers"),sbPolicyQualifiers));
  }
  return sbPolicyInformation.toString();
}

public static String toString ( PolicyInformation policyInformation ) throws IOException { StringBuffer sbPolicyInformation = new StringBuffer ( ) ; ASN1ObjectIdentifier policyIdentifier = policyInformation . getPolicyIdentifier ( ) ; sbPolicyInformation . append ( MessageFormat . format ( res . getString ( "PolicyInformationUtil.PolicyIdentifier" ) , policyIdentifier . getId ( ) ) ) ; ASN1Sequence policyQualifiers = policyInformation . getPolicyQualifiers ( ) ; if ( policyQualifiers != null ) { sbPolicyInformation . append ( ", " ) ; StringBuffer sbPolicyQualifiers = new StringBuffer ( ) ; for ( int i = 0 ; i < policyQualifiers . size ( ) ; i ++ ) { PolicyQualifierInfo policyQualifierInfo = PolicyQualifierInfo . getInstance ( policyQualifiers . getObjectAt ( i ) ) ; sbPolicyQualifiers . append ( toString ( policyQualifierInfo ) ) ; if ( ( i + 1 ) < policyQualifiers . size ( ) ) { sbPolicyQualifiers . append ( ", " ) ; } } sbPolicyInformation . append ( MessageFormat . format ( res . getString ( "PolicyInformationUtil.PolicyQualifiers" ) , sbPolicyQualifiers ) ) ; } return sbPolicyInformation . toString ( ) ; }
get string representation of policy information .
