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

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

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

ASN1TaggedObject.isExplicit介绍

[英]return whether or not the object may be explicitly tagged.

Note: if the object has been read from an input stream, the only time you can be sure if isExplicit is returning the true state of affairs is if it returns false. An implicitly tagged object may appear to be explicitly tagged, so you need to understand the context under which the reading was done as well, see getObject below.
[中]返回是否可以显式标记对象。
注意:如果对象是从输入流读取的,那么唯一可以确定isExplicit是否返回真实状态的时间就是它是否返回false。隐式标记的对象可能看起来是显式标记的,因此您也需要了解执行读取的上下文,请参见下面的getObject。

代码示例

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

private KEKRecipientInfo getKEKInfo(ASN1TaggedObject o)
{
  if (o.isExplicit())
  {                        // compatibilty with erroneous version
    return KEKRecipientInfo.getInstance(o, true);
  }
  else
  {
    return KEKRecipientInfo.getInstance(o, false);
  }
}

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

private KEKRecipientInfo getKEKInfo(ASN1TaggedObject o)
{
  if (o.isExplicit())
  {                        // compatibilty with erroneous version
    return KEKRecipientInfo.getInstance(o, true);
  }
  else
  {
    return KEKRecipientInfo.getInstance(o, false);
  }
}

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

private String dumpTaggedObject(ASN1TaggedObject o) throws Asn1Exception, IOException {
  StringBuilder sb = new StringBuilder();
  sb.append(indentSequence.toString(indentLevel));
  if (o instanceof BERTaggedObject) {
    sb.append("BER TAGGED [");
  } else {
    sb.append("TAGGED [");
  }
  sb.append(Integer.toString(o.getTagNo()));
  sb.append(']');
  if (!o.isExplicit()) {
    sb.append(" IMPLICIT ");
  }
  sb.append(":");
  sb.append(NEWLINE);
  if (o.isEmpty()) {
    sb.append("EMPTY");
  } else {
    sb.append(dump(o.getObject()));
  }
  return sb.toString();
}

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

if (!obj.isExplicit())
if (obj.isExplicit())

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

break;
case 2:
  if (o.isExplicit())

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

if (!obj.isExplicit())
if (obj.isExplicit())

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

if (!obj.isExplicit())
if (obj.isExplicit())

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

/**
 * @deprecated use getInstance()
 */
public ContentInfo(
  ASN1Sequence  seq)
{
  if (seq.size() < 1 || seq.size() > 2)
  {
    throw new IllegalArgumentException("Bad sequence size: " + seq.size());
  }
  contentType = (ASN1ObjectIdentifier)seq.getObjectAt(0);
  if (seq.size() > 1)
  {
    ASN1TaggedObject tagged = (ASN1TaggedObject)seq.getObjectAt(1);
    if (!tagged.isExplicit() || tagged.getTagNo() != 0)
    {
      throw new IllegalArgumentException("Bad tag for 'content'");
    }
    content = tagged.getObject();
  }
}

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

/**
 * @deprecated use getInstance()
 */
public ContentInfo(
  ASN1Sequence  seq)
{
  if (seq.size() < 1 || seq.size() > 2)
  {
    throw new IllegalArgumentException("Bad sequence size: " + seq.size());
  }
  contentType = (ASN1ObjectIdentifier)seq.getObjectAt(0);
  if (seq.size() > 1)
  {
    ASN1TaggedObject tagged = (ASN1TaggedObject)seq.getObjectAt(1);
    if (!tagged.isExplicit() || tagged.getTagNo() != 0)
    {
      throw new IllegalArgumentException("Bad tag for 'content'");
    }
    content = tagged.getObject();
  }
}

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

buf.append(']');
if (!o.isExplicit())

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

buf.append(']');
if (!o.isExplicit())

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

if (!obj.isExplicit())
if (obj.isExplicit())

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

private DSTU4145ECBinary(ASN1Sequence seq)
{
  int index = 0;
  if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
  {
    ASN1TaggedObject taggedVersion = (ASN1TaggedObject)seq.getObjectAt(index);
    if (taggedVersion.isExplicit() && 0 == taggedVersion.getTagNo())
    {
      version = ASN1Integer.getInstance(taggedVersion.getLoadedObject()).getValue();
      index++;
    }
    else
    {
      throw new IllegalArgumentException("object parse error");
    }
  }
  f = DSTU4145BinaryField.getInstance(seq.getObjectAt(index));
  index++;
  a = ASN1Integer.getInstance(seq.getObjectAt(index));
  index++;
  b = ASN1OctetString.getInstance(seq.getObjectAt(index));
  index++;
  n = ASN1Integer.getInstance(seq.getObjectAt(index));
  index++;
  bp = ASN1OctetString.getInstance(seq.getObjectAt(index));
}

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

private DSTU4145ECBinary(ASN1Sequence seq)
{
  int index = 0;
  if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
  {
    ASN1TaggedObject taggedVersion = (ASN1TaggedObject)seq.getObjectAt(index);
    if (taggedVersion.isExplicit() && 0 == taggedVersion.getTagNo())
    {
      version = ASN1Integer.getInstance(taggedVersion.getLoadedObject()).getValue();
      index++;
    }
    else
    {
      throw new IllegalArgumentException("object parse error");
    }
  }
  f = DSTU4145BinaryField.getInstance(seq.getObjectAt(index));
  index++;
  a = ASN1Integer.getInstance(seq.getObjectAt(index));
  index++;
  b = ASN1OctetString.getInstance(seq.getObjectAt(index));
  index++;
  n = ASN1Integer.getInstance(seq.getObjectAt(index));
  index++;
  bp = ASN1OctetString.getInstance(seq.getObjectAt(index));
}

相关文章