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);
    }
  }
 protected SubjectKeyIdentifier(ASN1OctetString keyid) {
   this.keyidentifier = keyid.getOctets();
 }
 public static SubjectKeyIdentifier getInstance(ASN1TaggedObject obj, boolean explicit) {
   return getInstance(ASN1OctetString.getInstance(obj, explicit));
 }
 public ASN1Encodable parsePrivateKey() throws IOException {
   return ASN1Primitive.fromByteArray(privKey.getOctets());
 }