code: public void setPolicy(Set<String> certPolicySet) throws IOException {
          if (certPolicySet == null) {
              policySet = null;
              policy = null;
          } else {
              // Snapshot set and parse it
              Set<String> tempSet = Collections.unmodifiableSet
                                          (new HashSet<String>(certPolicySet));
              /* Convert to Vector of ObjectIdentifiers */
              Iterator<String> i = tempSet.iterator();
              Vector<CertificatePolicyId> polIdVector = new Vector<CertificatePolicyId>();
              while (i.hasNext()) {
                  Object o = i.next();
                  if (!(o instanceof String)) {
                      throw new IOException("non String in certPolicySet");
                  }
                  polIdVector.add(new CertificatePolicyId(new ObjectIdentifier(
                    (String)o)));
              }
              // If everything went OK, make the changes
              policySet = tempSet;
              policy = new CertificatePolicySet(polIdVector);
          }
      }
docs: Sets the policy constraint. The {@code X509Certificate} must
  include at least one of the specified policies in its certificate
  policies extension. If {@code certPolicySet} is empty, then the
  {@code X509Certificate} must include at least some specified policy
  in its certificate policies extension. If {@code certPolicySet} is
  {@code null}, no policy check will be performed.
  <p>
  Note that the {@code Set} is cloned to protect against
  subsequent modifications.
  
  @param certPolicySet a {@code Set} of certificate policy OIDs in
  string format (or {@code null}). Each OID is
  represented by a set of nonnegative integers
  separated by periods.
  @throws IOException if a parsing error occurs on the OID such as
  the first component is not 0, 1 or 2 or the second component is
  greater than 39.
  @see #getPolicy