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

x33g5p2x  于2022-01-17 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(90)

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

ASN1Set.getEncoded介绍

暂无

代码示例

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

/**
 * return the DER encoding of the signed attributes.
 * @throws IOException if an encoding error occurs.
 */
public byte[] getEncodedSignedAttributes()
  throws IOException
{
  if (signedAttributeSet != null)
  {
    return signedAttributeSet.getEncoded(ASN1Encoding.DER);
  }
  return null;
}

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

/**
 * return the DER encoding of the signed attributes.
 * @throws IOException if an encoding error occurs.
 */
public byte[] getEncodedSignedAttributes()
  throws IOException
{
  if (signedAttributeSet != null)
  {
    return signedAttributeSet.getEncoded(ASN1Encoding.DER);
  }
  return null;
}

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

byte[] a = getEncoded((ASN1Encodable)set.elementAt(0));
  byte[] b = getEncoded((ASN1Encodable)set.elementAt(index + 1));

代码示例来源:origin: es.gob.afirma/afirma-crypto-cms-enveloper

/** Realiza la firma usando los atributos del firmante.
 * @param signatureAlgorithm Algoritmo para la firma.
 * @param keyEntry Clave para firmar.
 * @return Firma de los atributos.
 * @throws InvalidKeyException Cuando hay problemas de adecuación de la clave.
 * @throws NoSuchAlgorithmException Si el JRE no soporta algún algoritmo necesario
 * @throws IOException Cuando hay problemas de entrada / salida.
 * @throws SignatureException  Cuando ocurren problemas en la firma PKCS#1 */
private ASN1OctetString firma(final String signatureAlgorithm,
               final PrivateKeyEntry keyEntry) throws InvalidKeyException,
                                   NoSuchAlgorithmException,
                                   IOException,
                                   SignatureException {
  final Signature sig = Signature.getInstance(signatureAlgorithm);
  final byte[] tmp = this.signedAttr2.getEncoded(ASN1Encoding.DER);
  // Indicar clave privada para la firma
  sig.initSign(keyEntry.getPrivateKey());
  // Actualizamos la configuracion de firma
  sig.update(tmp);
  // firmamos y devolvemos.
  return new DEROctetString(sig.sign());
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-cms-enveloper

final byte[] tmp = signedAttr2.getEncoded(ASN1Encoding.DER);

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

/**
 * Return the MAC calculated for the recipient. Note: this call is only meaningful once all
 * the content has been read.
 *
 * @return  byte array containing the mac.
 */
public byte[] getMac()
{
  if (resultMac == null)
  {
    if (operator.isMacBased())
    {
      if (additionalData != null)
      {
        try
        {
          Streams.drain(operator.getInputStream(new ByteArrayInputStream(additionalData.getAuthAttributes().getEncoded(ASN1Encoding.DER))));
        }
        catch (IOException e)
        {
          throw new IllegalStateException("unable to drain input: " + e.getMessage());
        }
      }
      resultMac = operator.getMac();
    }
  }
  return resultMac;
}

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

/**
 * Return the MAC calculated for the recipient. Note: this call is only meaningful once all
 * the content has been read.
 *
 * @return  byte array containing the mac.
 */
public byte[] getMac()
{
  if (resultMac == null)
  {
    if (operator.isMacBased())
    {
      if (additionalData != null)
      {
        try
        {
          Streams.drain(operator.getInputStream(new ByteArrayInputStream(additionalData.getAuthAttributes().getEncoded(ASN1Encoding.DER))));
        }
        catch (IOException e)
        {
          throw new IllegalStateException("unable to drain input: " + e.getMessage());
        }
      }
      resultMac = operator.getMac();
    }
  }
  return resultMac;
}

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

return signedAttributes.getEncoded(ASN1Encoding.DER);

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

mOut.write(authed.getEncoded(ASN1Encoding.DER));

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

mOut.write(authed.getEncoded(ASN1Encoding.DER));

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

sOut.write(signedAttr.getEncoded(ASN1Encoding.DER));

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

mOut.write(authed.getEncoded(ASN1Encoding.DER));

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

mOut.write(authed.getEncoded(ASN1Encoding.DER));

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

sOut.write(signedAttr.getEncoded(ASN1Encoding.DER));

代码示例来源:origin: com.itextpdf/itextg

ASN1TaggedObject tagsig = (ASN1TaggedObject)signerInfo.getObjectAt(next);
ASN1Set sseq = ASN1Set.getInstance(tagsig, false);
sigAttr = sseq.getEncoded();
sigAttrDer = sseq.getEncoded(ASN1Encoding.DER);

代码示例来源:origin: es.gob.afirma/afirma-crypto-cms-enveloper

authAttr.getEncoded(ASN1Encoding.DER),
  this.cipherKey
);

代码示例来源:origin: es.gob.afirma/afirma-crypto-cms-enveloper

final byte[] mac = Utils.genMac(autenticationAlgorithm, authAttr.getEncoded(ASN1Encoding.DER), cipherKey);

代码示例来源:origin: es.gob.afirma/afirma-crypto-cms-enveloper

final byte[] mac = Utils.genMac(autenticationAlgorithm, genPack(authAttr.getEncoded(ASN1Encoding.DER), content2), cipherKey);

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

envGen.getRawOutputStream().write(recipients.getEncoded());

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

envGen.getRawOutputStream().write(recipients.getEncoded());

相关文章