public static SubjectKeyIdentifier getInstance(Object obj) {
    if (obj instanceof SubjectKeyIdentifier) {
      return (SubjectKeyIdentifier) obj;
    } else if (obj != null) {
      return new SubjectKeyIdentifier(ASN1OctetString.getInstance(obj));
    }

    return null;
  }
  /**
   * @deprecated use PrivateKeyInfo.getInstance()
   * @param seq
   */
  public PrivateKeyInfo(ASN1Sequence seq) {
    Enumeration e = seq.getObjects();

    BigInteger version = ((ASN1Integer) e.nextElement()).getValue();
    if (version.intValue() != 0) {
      throw new IllegalArgumentException("wrong version for private key info");
    }

    algId = AlgorithmIdentifier.getInstance(e.nextElement());
    privKey = ASN1OctetString.getInstance(e.nextElement());

    if (e.hasMoreElements()) {
      attributes = ASN1Set.getInstance((ASN1TaggedObject) e.nextElement(), false);
    }
  }
 public static SubjectKeyIdentifier getInstance(ASN1TaggedObject obj, boolean explicit) {
   return getInstance(ASN1OctetString.getInstance(obj, explicit));
 }