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

x33g5p2x  于2022-01-16 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(100)

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

ASN1Primitive.getEncoded介绍

暂无

代码示例

代码示例来源:origin: com.madgag.spongycastle/core

private static byte[] toByteArray(ASN1Primitive obj)
{
  try
  {
    return obj.getEncoded();
  }
  catch (IOException e)
  {
    throw new IllegalArgumentException("Unable to encode object");
  }
}

代码示例来源:origin: com.madgag/sc-light-jdk15on

private static byte[] toByteArray(ASN1Primitive obj)
{
  try
  {
    return obj.getEncoded();
  }
  catch (IOException e)
  {
    throw new IllegalArgumentException("Unable to encode object");
  }
}

代码示例来源:origin: com.madgag.spongycastle/core

private byte[] getDEREncoded(
  ASN1Encodable obj)
{
  try
  {
    return obj.toASN1Primitive().getEncoded(ASN1Encoding.DER);
  }
  catch (IOException e)
  {
    throw new IllegalArgumentException("cannot encode object added to SET");
  }
}

代码示例来源:origin: com.madgag.spongycastle/core

/**
 * Constructor from the encoding of an ASN.1 object.
 *
 * @param obj the object to be encoded.
 */
public DEROctetString(
  ASN1Encodable obj)
  throws IOException
{
  super(obj.toASN1Primitive().getEncoded(ASN1Encoding.DER));
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private byte[] encodeObj(
    ASN1Encodable obj)
    throws IOException
  {
    if (obj != null)
    {
      return obj.toASN1Primitive().getEncoded();
    }

    return null;
  }
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private byte[] encodeObj(
  ASN1Encodable obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private byte[] encodeObj(
  ASN1Encodable obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private byte[] encodeObj(
  ASN1Encodable obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private byte[] encodeObj(
  ASN1Encodable obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private byte[] encodeObj(
    ASN1Encodable obj)
    throws IOException
  {
    if (obj != null)
    {
      return obj.toASN1Primitive().getEncoded();
    }

    return null;
  }
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private byte[] encodeObj(
  ASN1Encodable obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private byte[] encodeObj(
  ASN1Encodable obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

private byte[] encodeObj(
  ASN1Encodable    obj)
  throws IOException
{
  if (obj != null)
  {
    return obj.toASN1Primitive().getEncoded();
  }
  return null;
}

代码示例来源:origin: com.madgag.spongycastle/pkix

private InputStream getContentStream(ASN1Encodable encodable)
    throws IOException
  {
    byte[] encoded = encodable.toASN1Primitive().getEncoded(ASN1Encoding.DER);
    int index = 1;

    while ((encoded[index] & 0xff) > 127)
    {
      index++;
    }

    index++;

    return new ByteArrayInputStream(encoded, index, encoded.length - index);
  }
}

代码示例来源:origin: com.madgag/sc-light-jdk15on

public PrivateKeyInfo(
  AlgorithmIdentifier algId,
  ASN1Encodable       privateKey,
  ASN1Set             attributes)
  throws IOException
{
  this.privKey = new DEROctetString(privateKey.toASN1Primitive().getEncoded(ASN1Encoding.DER));
  this.algId = algId;
  this.attributes = attributes;
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

/**
 * add a given extension field for the standard extensions tag (tag 3)
 * @throws IOException
 * @deprecated use method taking ASN1ObjectIdentifier
 */
public void addExtension(
  String          OID,
  boolean         critical,
  ASN1Encodable   value)
  throws IOException
{
  this.addExtension(OID, critical, value.toASN1Primitive().getEncoded());
}

代码示例来源:origin: com.madgag.spongycastle/pkix

public X509TrustedCertificateBlock(byte[] encoding)
  throws IOException
{
  ASN1InputStream aIn = new ASN1InputStream(encoding);
  this.certificateHolder = new X509CertificateHolder(aIn.readObject().getEncoded());
  this.trustBlock = new CertificateTrustBlock(aIn.readObject().getEncoded());
}

代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on

public X509TrustedCertificateBlock(byte[] encoding)
  throws IOException
{
  ASN1InputStream aIn = new ASN1InputStream(encoding);
  this.certificateHolder = new X509CertificateHolder(aIn.readObject().getEncoded());
  this.trustBlock = new CertificateTrustBlock(aIn.readObject().getEncoded());
}

代码示例来源:origin: com.madgag.spongycastle/core

public DERBitString(
  ASN1Encodable obj)
  throws IOException
{
  super(obj.toASN1Primitive().getEncoded(ASN1Encoding.DER), 0);
}

代码示例来源:origin: com.madgag.spongycastle/core

public DLBitString(
  ASN1Encodable obj)
  throws IOException
{
  super(obj.toASN1Primitive().getEncoded(ASN1Encoding.DER), 0);
}

相关文章