code: public static PBKDF2Params getInstance(Object obj)
      {
          if (obj instanceof PBKDF2Params) {
              return (PBKDF2Params) obj;
          }
  
          if (obj instanceof org.bouncycastle.asn1.pkcs.PBKDF2Params) {
              org.bouncycastle.asn1.pkcs.PBKDF2Params params = (org.bouncycastle.asn1.pkcs.PBKDF2Params) obj;
              if (params.getKeyLength() != null) {
                  return new PBKDF2Params(params.getSalt(),
                      params.getIterationCount().intValue(), params.getKeyLength().intValue());
              } else {
                  return new PBKDF2Params(params.getSalt(), params.getIterationCount().intValue());
              }
          }
  
          if (obj != null) {
              return new PBKDF2Params(ASN1Sequence.getInstance(obj));
          }
  
          return null;
      }
docs: Static factory methods to create new instance from existing instance or encoded data.
  
  @param obj a compatible object, either another instance or a ASN.1 sequence.
  @return a new instance.