[Solved] Cannot verify signature (cmssigneddata) bouncycastle

You need to add the certificate to a org.bouncycastle.util.CollectionStore, and add this store to the signature. I’m using BouncyCastle 1.56: import org.bouncycastle.cert.X509CertificateHolder; import org.bouncycastle.util.CollectionStore; // add these lines after gen.addSignerInfoGenerator(…) // cert is your X509Certificate X509CertificateHolder holder = new X509CertificateHolder(cert.getEncoded()); CollectionStore<X509CertificateHolder> certStore = new CollectionStore<>(Collections.singletonList(holder)); gen.addCertificates(certStore); // add the store to the signature The CollectionStore … Read more

[Solved] Using returned outputs from one function in another in Python

I would rewrite the main function to be something like: def GetStudentInput(): score = 0 for i in range (4): print(“Mrs Pearson’s Class Test Score Data”) name = CheckStringInput(“What’s Your Name: “) score += CheckNumericInput(“What’s Your Score: “) print(score) This eliminates the need for an extra function and avoids using a list since you don’t … Read more