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

x33g5p2x  于11个月前 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(29)

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

AlgorithmIdentifier.toASN1Primitive介绍

[英]Produce an object suitable for an ASN1OutputStream.

AlgorithmIdentifier ::= SEQUENCE { 
algorithm OBJECT IDENTIFIER, 
parameters ANY DEFINED BY algorithm OPTIONAL }

[中]生成适合ASN1OutputStream的对象

AlgorithmIdentifier ::= SEQUENCE { 
algorithm OBJECT IDENTIFIER, 
parameters ANY DEFINED BY algorithm OPTIONAL }

代码示例

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

public ASN1Primitive toASN1Primitive()
  {
    return algId.toASN1Primitive();
  }
}

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

public ASN1Primitive toASN1Primitive()
  {
    return algId.toASN1Primitive();
  }
}

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

public ASN1Primitive toASN1Primitive()
  {
    return algId.toASN1Primitive();
  }
}

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

public ASN1Primitive toASN1Primitive()
  {
    return algId.toASN1Primitive();
  }
}

代码示例来源:origin: eu.eu-emi.security/canl

private X509Certificate sign(TBSCertificate toSign, AlgorithmIdentifier sigAlg, 
    String sigAlgName,
    PrivateKey key, String provider, SecureRandom random) 
  throws InvalidKeyException, NoSuchProviderException, NoSuchAlgorithmException, 
  SignatureException, IOException, CertificateParsingException
  
{
  byte[] signature = calculateSignature(sigAlgName, 
      provider, key, random, toSign);
  ASN1EncodableVector v = new ASN1EncodableVector();
  v.add(toSign);
  v.add(sigAlg.toASN1Primitive());
  v.add(new DERBitString(signature));
  DERSequence derCertificate = new DERSequence(v);
  CertificateFactory factory;
  try
  {
    factory = CertificateFactory.getInstance("X.509");
    ByteArrayInputStream bais = new ByteArrayInputStream(derCertificate.getEncoded(ASN1Encoding.DER));
    return (X509Certificate) factory.generateCertificate(bais);
  } catch (CertificateException e)
  {
    throw new RuntimeException("The generated proxy " +
        "certificate was not parsed by the JDK", e);
  }
}

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

public EncryptedData(
  ASN1ObjectIdentifier contentType,
  AlgorithmIdentifier     encryptionAlgorithm,
  ASN1Encodable content)
{
  ASN1EncodableVector v = new ASN1EncodableVector();
  v.add(contentType);
  v.add(encryptionAlgorithm.toASN1Primitive());
  v.add(new BERTaggedObject(false, 0, content));
  data = new BERSequence(v);
}

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

public EncryptedData(
  ASN1ObjectIdentifier contentType,
  AlgorithmIdentifier     encryptionAlgorithm,
  ASN1Encodable content)
{
  ASN1EncodableVector v = new ASN1EncodableVector();
  v.add(contentType);
  v.add(encryptionAlgorithm.toASN1Primitive());
  v.add(new BERTaggedObject(false, 0, content));
  data = new BERSequence(v);
}

相关文章