コード例 #1
0
ファイル: Extension.java プロジェクト: cFerg/MineJava
  public void encode(OutputStream out) throws IOException {
    if (out == null) {
      throw new NullPointerException();
    }

    DerOutputStream dos1 = new DerOutputStream();
    DerOutputStream dos2 = new DerOutputStream();

    dos1.putOID(extensionId);
    if (critical) {
      dos1.putBoolean(critical);
    }
    dos1.putOctetString(extensionValue);

    dos2.write(DerValue.tag_Sequence, dos1);
    out.write(dos2.toByteArray());
  }
コード例 #2
0
ファイル: Extension.java プロジェクト: cFerg/MineJava
  public void encode(DerOutputStream out) throws IOException {

    if (extensionId == null) {
      throw new IOException("Null OID to encode for the extension!");
    }
    if (extensionValue == null) {
      throw new IOException("No value to encode for the extension!");
    }

    DerOutputStream dos = new DerOutputStream();

    dos.putOID(extensionId);
    if (critical) {
      dos.putBoolean(critical);
    }
    dos.putOctetString(extensionValue);

    out.write(DerValue.tag_Sequence, dos);
  }