org.bouncycastle.asn1.x509.X509Extension.isCritical()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(94)

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

X509Extension.isCritical介绍

暂无

代码示例

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

private ASN1ObjectIdentifier[] getExtensionOIDs(boolean isCritical)
{
  Vector oidVec = new Vector();
  for (int i = 0; i != ordering.size(); i++)
  {
    Object oid = ordering.elementAt(i);
    if (((X509Extension)extensions.get(oid)).isCritical() == isCritical)
    {
      oidVec.addElement(oid);
    }
  }
  return toOidArray(oidVec);
}

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

private ASN1ObjectIdentifier[] getExtensionOIDs(boolean isCritical)
{
  Vector oidVec = new Vector();
  for (int i = 0; i != ordering.size(); i++)
  {
    Object oid = ordering.elementAt(i);
    if (((X509Extension)extensions.get(oid)).isCritical() == isCritical)
    {
      oidVec.addElement(oid);
    }
  }
  return toOidArray(oidVec);
}

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

public boolean equals(
  Object  o)
{
  if (!(o instanceof X509Extension))
  {
    return false;
  }
  X509Extension   other = (X509Extension)o;
  return other.getValue().equals(this.getValue())
    && (other.isCritical() == this.isCritical());
}

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

public boolean equals(
  Object  o)
{
  if (!(o instanceof X509Extension))
  {
    return false;
  }
  X509Extension   other = (X509Extension)o;
  return other.getValue().equals(this.getValue())
    && (other.isCritical() == this.isCritical());
}

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

public int hashCode()
{
  if (this.isCritical())
  {
    return this.getValue().hashCode();
  }
  return ~this.getValue().hashCode();
}

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

public int hashCode()
{
  if (this.isCritical())
  {
    return this.getValue().hashCode();
  }
  return ~this.getValue().hashCode();
}

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

/**
 * <pre>
 *     Extensions        ::=   SEQUENCE SIZE (1..MAX) OF Extension
 *
 *     Extension         ::=   SEQUENCE {
 *        extnId            EXTENSION.&amp;id ({ExtensionSet}),
 *        critical          BOOLEAN DEFAULT FALSE,
 *        extnValue         OCTET STRING }
 * </pre>
 */
public ASN1Primitive toASN1Primitive()
{
  ASN1EncodableVector     vec = new ASN1EncodableVector();
  Enumeration             e = ordering.elements();
  while (e.hasMoreElements())
  {
    ASN1ObjectIdentifier    oid = (ASN1ObjectIdentifier)e.nextElement();
    X509Extension           ext = (X509Extension)extensions.get(oid);
    ASN1EncodableVector     v = new ASN1EncodableVector();
    v.add(oid);
    if (ext.isCritical())
    {
      v.add(ASN1Boolean.TRUE);
    }
    v.add(ext.getValue());
    vec.add(new DERSequence(v));
  }
  return new DERSequence(vec);
}

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

/**
 * <pre>
 *     Extensions        ::=   SEQUENCE SIZE (1..MAX) OF Extension
 *
 *     Extension         ::=   SEQUENCE {
 *        extnId            EXTENSION.&amp;id ({ExtensionSet}),
 *        critical          BOOLEAN DEFAULT FALSE,
 *        extnValue         OCTET STRING }
 * </pre>
 */
public ASN1Primitive toASN1Primitive()
{
  ASN1EncodableVector     vec = new ASN1EncodableVector();
  Enumeration             e = ordering.elements();
  while (e.hasMoreElements())
  {
    ASN1ObjectIdentifier    oid = (ASN1ObjectIdentifier)e.nextElement();
    X509Extension           ext = (X509Extension)extensions.get(oid);
    ASN1EncodableVector     v = new ASN1EncodableVector();
    v.add(oid);
    if (ext.isCritical())
    {
      v.add(ASN1Boolean.TRUE);
    }
    v.add(ext.getValue());
    vec.add(new DERSequence(v));
  }
  return new DERSequence(vec);
}

代码示例来源:origin: org.codeartisans.qipki/qipki-crypto

DERObjectIdentifier oid = ( DERObjectIdentifier ) e.nextElement();
X509Extension extension = requestedExtensions.getExtension( oid );
extractedExtensions.add( new X509ExtensionHolder( oid, extension.isCritical(), X509Extension.convertValueToObject( extension ) ) );

相关文章

微信公众号

最新文章

更多