code: public static PBES2Parameters getInstance(Object obj)
      {
          if (obj instanceof PBES2Parameters) {
              return (PBES2Parameters) obj;
          }
          if (obj instanceof org.bouncycastle.asn1.pkcs.PBES2Parameters) {
              return new PBES2Parameters(((org.bouncycastle.asn1.pkcs.PBES2Parameters) obj).getKeyDerivationFunc(),
                  ((org.bouncycastle.asn1.pkcs.PBES2Parameters) obj).getEncryptionScheme());
          }
          if (obj != null) {
              return new PBES2Parameters(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.