org.spongycastle.asn1.ASN1EncodableVector类的使用及代码示例

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

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

ASN1EncodableVector介绍

[英]Mutable class for building ASN.1 constructed objects such as SETs or SEQUENCEs.
[中]用于构建ASN的可变类。1构造对象,如集合或序列。

代码示例

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

public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector  v = new ASN1EncodableVector();

    v.add(a);
    v.add(b);
    v.add(p);
    v.add(q);
    v.add(x);
    v.add(y);

    return new DERSequence(v);
  }
}

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

/**
 * Create a SEQUENCE containing a vector of objects.
 * @param v the vector of objects to be put in the SEQUENCE.
 */
protected ASN1Sequence(
  ASN1EncodableVector v)
{
  for (int i = 0; i != v.size(); i++)
  {
    seq.addElement(v.get(i));
  }
}

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

public RevRepContentBuilder add(PKIStatusInfo status, CertId certId)
{
  if (this.status.size() != this.revCerts.size())
  {
    throw new IllegalStateException("status and revCerts sequence must be in common order");
  }
  this.status.add(status);
  this.revCerts.add(certId);
  return this;
}

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

/**
 * @param attribute
 */
public void addAttribute(Attribute attribute)
{
  attributes.add(attribute);
}

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

static BERSet createSet(ASN1EncodableVector v)
  {
    return v.size() < 1 ? EMPTY_SET : new BERSet(v);
  }
}

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

private void addOptional(ASN1EncodableVector v, ASN1Encodable obj)
  {
    if (obj != null)
    {
      v.add(obj);
    }
  }
}

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

public RevRepContentBuilder add(PKIStatusInfo status, CertId certId)
{
  if (this.status.size() != this.revCerts.size())
  {
    throw new IllegalStateException("status and revCerts sequence must be in common order");
  }
  this.status.add(status);
  this.revCerts.add(certId);
  return this;
}

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

static ASN1Set createSet(ASN1EncodableVector v)
  {
    return v.size() < 1 ? EMPTY_SET : new DLSet(v);
  }
}

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

public ASN1Primitive toASN1Primitive()
{
  ASN1EncodableVector v = new ASN1EncodableVector();
  v.add(version);
  v.add(digestAlgorithm);
  v.add(encapContentInfo);
  v.add(digest);
  return new BERSequence(v);
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-core-pkcs7

/** Genera un estructura de tipo SET de formato ASN1 a partir de una lista de objectos ya existente.
   * @param derObjects
   *        Una lista con los nuevos objetos a obtener el tipo SET
   * @param v Vector con los objectos ya existentes
   * @return Un SET de ASN1 con los elementos de la lista introducida. */
  public static ASN1Set fillRestCerts(final List<ASN1Encodable> derObjects, final ASN1EncodableVector v) {
    for (final ASN1Encodable d : derObjects) {
      v.add(d);
    }
    return new BERSet(v);
  }
}

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

private ASN1Primitive getObjFromVector(ASN1EncodableVector v, int index)
{
  if (v.size() <= index)
  {
    throw new IllegalArgumentException("too few objects in input vector");
  }
  return v.get(index).toASN1Primitive();
}
/**

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

static ASN1Set createSet(ASN1EncodableVector v)
  {
    return v.size() < 1 ? EMPTY_SET : new DLSet(v);
  }
}

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

public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);
    v.add(compressionAlgorithm);
    v.add(encapContentInfo);

    return new BERSequence(v);
  }
}

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

private void addOptional(ASN1EncodableVector v, int tagNo, ASN1Encodable obj)
  {
    if (obj != null)
    {
      v.add(new DERTaggedObject(true, tagNo, obj));
    }
  }
}

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

public AttributeTable(
  ASN1EncodableVector v)
{
  for (int i = 0; i != v.size(); i++)
  {
    Attribute   a = Attribute.getInstance(v.get(i));
    addAttribute(a.getAttrType(), a);
  }
}

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

static BERSet createSet(ASN1EncodableVector v)
  {
    return v.size() < 1 ? EMPTY_SET : new BERSet(v);
  }
}

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

public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector seq = new ASN1EncodableVector();
    seq.add(currency);
    seq.add(amount);
    seq.add(exponent); 
    
    return new DERSequence(seq);
  }
}

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

static ASN1Sequence createSequence(ASN1EncodableVector v)
{
  return v.size() < 1 ? EMPTY_SEQUENCE : new DLSequence(v);
}

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

public void addCapability(
  ASN1ObjectIdentifier capability,
  ASN1Encodable params)
{
  ASN1EncodableVector  v = new ASN1EncodableVector();
  v.add(capability);
  v.add(params);
  capabilities.add(new DERSequence(v));
}

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

public ASN1Primitive toASN1Primitive()
  {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(seqNumber);
    v.add(hashAlgorithm);
    v.add(anchorHashes);

    return new DERSequence(v);
  }
}

相关文章

微信公众号

最新文章

更多