org.bouncycastle.asn1.ASN1Integer.getEncoded()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中org.bouncycastle.asn1.ASN1Integer.getEncoded()方法的一些代码示例,展示了ASN1Integer.getEncoded()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ASN1Integer.getEncoded()方法的具体详情如下:
包路径:org.bouncycastle.asn1.ASN1Integer
类名称:ASN1Integer
方法名:getEncoded

ASN1Integer.getEncoded介绍

暂无

代码示例

代码示例来源:origin: kaikramer/keystore-explorer

private byte[] encodeDsaPublicKeyAsBitString(DSAPublicKey dsaPublicKey) throws IOException {
    ASN1Integer publicKey = new ASN1Integer(dsaPublicKey.getY());

    return publicKey.getEncoded(ASN1Encoding.DER);
  }
}

代码示例来源:origin: kaikramer/keystore-explorer

private byte[] encodeDsaPublicKeyAsBitString(DSAPublicKey dsaPublicKey) throws SpkacException {
  try {
    ASN1Integer publicKey = new ASN1Integer(dsaPublicKey.getY());
    return publicKey.getEncoded(ASN1Encoding.DER);
  } catch (Exception ex) {
    throw new SpkacException(res.getString("NoEncodeDsaPublicKey.exception.message"), ex);
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

void encode(ASN1OutputStream out)
  throws IOException
{
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  if (directReference != null)
  {
    baos.write(directReference.getEncoded(ASN1Encoding.DER));
  }
  if (indirectReference != null)
  {
    baos.write(indirectReference.getEncoded(ASN1Encoding.DER));
  }
  if (dataValueDescriptor != null)
  {
    baos.write(dataValueDescriptor.getEncoded(ASN1Encoding.DER));
  }
  DERTaggedObject obj = new DERTaggedObject(true, encoding, externalContent);
  baos.write(obj.getEncoded(ASN1Encoding.DER));
  out.writeEncoded(BERTags.CONSTRUCTED, BERTags.EXTERNAL, baos.toByteArray());
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

void encode(ASN1OutputStream out)
    throws IOException
  {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    if (directReference != null)
    {
      baos.write(directReference.getEncoded(ASN1Encoding.DL));
    }
    if (indirectReference != null)
    {
      baos.write(indirectReference.getEncoded(ASN1Encoding.DL));
    }
    if (dataValueDescriptor != null)
    {
      baos.write(dataValueDescriptor.getEncoded(ASN1Encoding.DL));
    }
    DERTaggedObject obj = new DERTaggedObject(true, encoding, externalContent);
    baos.write(obj.getEncoded(ASN1Encoding.DL));
    out.writeEncoded(BERTags.CONSTRUCTED, BERTags.EXTERNAL, baos.toByteArray());
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

void encode(ASN1OutputStream out)
    throws IOException
  {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    if (directReference != null)
    {
      baos.write(directReference.getEncoded(ASN1Encoding.DER));
    }
    if (indirectReference != null)
    {
      baos.write(indirectReference.getEncoded(ASN1Encoding.DER));
    }
    if (dataValueDescriptor != null)
    {
      baos.write(dataValueDescriptor.getEncoded(ASN1Encoding.DER));
    }
    DERTaggedObject obj = new DERTaggedObject(true, encoding, externalContent);
    baos.write(obj.getEncoded(ASN1Encoding.DER));
    out.writeEncoded(BERTags.CONSTRUCTED, BERTags.EXTERNAL, baos.toByteArray());
  }
}

相关文章