本文整理汇总了Java中org.bouncycastle.asn1.crmf.CertReqMsg类的典型用法代码示例。如果您正苦于以下问题:Java CertReqMsg类的具体用法?Java CertReqMsg怎么用?Java CertReqMsg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CertReqMsg类属于org.bouncycastle.asn1.crmf包,在下文中一共展示了CertReqMsg类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSubsequentMessage
import org.bouncycastle.asn1.crmf.CertReqMsg; //导入依赖的package包/类
public void testSubsequentMessage()
throws Exception
{
KeyPairGenerator kGen = KeyPairGenerator.getInstance("RSA", BC);
kGen.initialize(512);
KeyPair kp = kGen.generateKeyPair();
X509CertificateHolder cert = makeV3Certificate(kp, "CN=Test", kp, "CN=Test");
ContentSigner signer = new JcaContentSignerBuilder("SHA256withRSA").setProvider(BC).build(
kp.getPrivate());
GeneralName user = new GeneralName(new X500Name("CN=Test"));
CertificateRequestMessageBuilder builder = new JcaCertificateRequestMessageBuilder(
BigInteger.valueOf(1)).setPublicKey(kp.getPublic()).setProofOfPossessionSubsequentMessage(
SubsequentMessage.encrCert);
ProtectedPKIMessage certRequestMsg = new ProtectedPKIMessageBuilder(user,
user).setTransactionID(new byte[] { 1, 2, 3, 4, 5 }).setBody(
new PKIBody(PKIBody.TYPE_KEY_UPDATE_REQ, new CertReqMessages(builder.build().toASN1Structure()))).addCMPCertificate(
cert).build(signer);
ProtectedPKIMessage msg = new ProtectedPKIMessage(new GeneralPKIMessage(certRequestMsg.toASN1Structure().getEncoded()));
CertReqMessages reqMsgs = CertReqMessages.getInstance(msg.getBody().getContent());
CertReqMsg reqMsg = reqMsgs.toCertReqMsgArray()[0];
assertEquals(ProofOfPossession.TYPE_KEY_ENCIPHERMENT, reqMsg.getPopo().getType());
}
示例2: CertificateRequestMessage
import org.bouncycastle.asn1.crmf.CertReqMsg; //导入依赖的package包/类
public CertificateRequestMessage(CertReqMsg certReqMsg)
{
this.certReqMsg = certReqMsg;
this.controls = certReqMsg.getCertReq().getControls();
}
示例3: JcaCertificateRequestMessage
import org.bouncycastle.asn1.crmf.CertReqMsg; //导入依赖的package包/类
public JcaCertificateRequestMessage(byte[] certReqMsg)
{
this(CertReqMsg.getInstance(certReqMsg));
}
示例4: JcaCertificateRequestMessage
import org.bouncycastle.asn1.crmf.CertReqMsg; //导入依赖的package包/类
public JcaCertificateRequestMessage(CertReqMsg certReqMsg)
{
super(certReqMsg);
}
示例5: toASN1Structure
import org.bouncycastle.asn1.crmf.CertReqMsg; //导入依赖的package包/类
/**
* Return the underlying ASN.1 object defining this CertificateRequestMessage object.
*
* @return a CertReqMsg.
*/
public CertReqMsg toASN1Structure()
{
return certReqMsg;
}