0
我正在開發配置文件證書軟件,並且需要使用V2Form for BasicCertificateID。如何在Bouncy Castle,Java中使用V2Form?
issuerGenName = new GeneralNames(new GeneralName(new X500Name(issuerName)));
ASN1Integer issuerSerialNumber = new ASN1Integer(Integer.parseInt(mainWindow.getIssuerSerialNumber()));
//IssuerSerial baseCertificateID = new IssuerSerial(issuerGenName, issuerSerialNumber);
ASN1EncodableVector vec = new ASN1EncodableVector();
ASN1EncodableVector vecS = new ASN1EncodableVector();
vecS.add(issuerGenName);
vecS.add(issuerSerialNumber);
ASN1Sequence seq = new DERSequence(vecS);
IssuerSerial baseCertificateID = IssuerSerial.getInstance(seq);
ASN1TaggedObject tagged = new DERTaggedObject(0, baseCertificateID);
//TODO Refazer
vec.add(issuerGenName);
vec.add(tagged);
ASN1Sequence seq2 = new DERSequence(vec);
V2Form teste = new V2Form(seq2);
issuer = new AttCertIssuer(teste);
attIssuer = new AttributeCertificateIssuer(issuer);
但這不行,我做錯了什麼?